Skip to content

Instantly share code, notes, and snippets.

@TheSeamau5
Created December 17, 2014 23:12
Show Gist options
  • Save TheSeamau5/9bab2b31efcf8c91b786 to your computer and use it in GitHub Desktop.
Save TheSeamau5/9bab2b31efcf8c91b786 to your computer and use it in GitHub Desktop.
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