Skip to content

Commit b759878

Browse files
authored
Merge pull request #213 from milesfrain/patch-1
Add example for lift2
2 parents fae9e76 + 26c19dd commit b759878

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Control/Apply.purs

+6
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ infixl 4 applySecond as *>
5959

6060
-- | Lift a function of two arguments to a function which accepts and returns
6161
-- | values wrapped with the type constructor `f`.
62+
-- |
63+
-- | ```purescript
64+
-- | lift2 add (Just 1) (Just 2) == Just 3
65+
-- | lift2 add Nothing (Just 2) == Nothing
66+
-- |```
67+
-- |
6268
lift2 :: forall a b c f. Apply f => (a -> b -> c) -> f a -> f b -> f c
6369
lift2 f a b = f <$> a <*> b
6470

0 commit comments

Comments
 (0)