Skip to content

Instantly share code, notes, and snippets.

@onlyshk
Created December 7, 2011 06:59
Show Gist options
  • Save onlyshk/1441795 to your computer and use it in GitHub Desktop.
Save onlyshk/1441795 to your computer and use it in GitHub Desktop.
Function lifting
lift :: (a -> b) -> Pair a -> Pair b
lift = fmap
plus2 :: Pair Int -> Pair Int
plus2 = lift (+2)
-- plus2 (Pair 2 3) ---> Pair 4 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment