Skip to content

Instantly share code, notes, and snippets.

@artur-s
Created March 19, 2017 17:59
Show Gist options
  • Save artur-s/ab2823d705b30b9b81b0f75a03c4e6d6 to your computer and use it in GitHub Desktop.
Save artur-s/ab2823d705b30b9b81b0f75a03c4e6d6 to your computer and use it in GitHub Desktop.
Composing functors is for free
let optionListMap f = (Option.map >> List.map) f
let square x = x * x
let squareLifted = optionListMap square
squareLifted [Some 2; None; Some 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment