Skip to content

Instantly share code, notes, and snippets.

@TheSeamau5
Created January 25, 2015 19:00
Show Gist options
  • Save TheSeamau5/491a5ea53170fb6bca71 to your computer and use it in GitHub Desktop.
Save TheSeamau5/491a5ea53170fb6bca71 to your computer and use it in GitHub Desktop.
mapAll for Arrays
mapAll : (a -> a -> a) -> Array a -> Array (Array a)
mapAll f array =
let innerMap tempArray =
case head tempArray of
Nothing -> empty
Just x -> push (map (f x) array) (innerMap (rest tempArray))
in
innerMap array
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment