Skip to content

Instantly share code, notes, and snippets.

@tibastral
Last active September 8, 2018 04:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tibastral/917215ffe1353ce7eeb6094881a08230 to your computer and use it in GitHub Desktop.
Save tibastral/917215ffe1353ce7eeb6094881a08230 to your computer and use it in GitHub Desktop.
add2AndProduct1 : List Int -> Int
add2AndProduct1 list =
List.product (List.map (\e -> e + 2) list)
add2AndProduct2 : List Int -> Int
add2AndProduct2 list =
list
|> List.map (\e -> e + 2)
|> List.product
add2AndProduct3 : List Int -> Int
add2AndProduct3 list =
list
|> List.map ((+) 2)
|> List.product
add2AndProduct4 : List Int -> Int
add2AndProduct4 =
List.map ((+) 2) >> List.product
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment