Skip to content

Instantly share code, notes, and snippets.

@nobsun
Created July 29, 2014 08:18
Show Gist options
  • Save nobsun/265e67f54ef562f32693 to your computer and use it in GitHub Desktop.
Save nobsun/265e67f54ef562f32693 to your computer and use it in GitHub Desktop.
ssum :: Num a => [a] -> [a] -> a
ssum = foldr f (const 0)
where
f x g [] = 0
f x g (y:ys) = x * y + g ys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment