Skip to content

Instantly share code, notes, and snippets.

Created December 17, 2014 23:12
What would you like to do?
MapAll Function in Elm. Applies a 2-ary function to each element in a list to each element in a list
mapAll : (a -> a -> a) -> List a -> List (List a)
mapAll f list =
let innerMapAll f tempList =
case tempList of
[] -> []
x :: xs -> map (f x) list :: innerMapAll f xs
in innerMapAll f list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment