loading...

re: Daily Challenge #225 - Square'n'Sum VIEW POST

FULL DISCUSSION
 

Elm

I really wish flip is part of the core library...

flip : (a -> b -> c) -> (b -> a -> c)
flip f a b = f b a

squareSum : List Int -> Int
squareSum integers =
    List.foldl (flip (^) 2 >> (+)) 0 integers
code of conduct - report abuse