1
1
mirror of https://github.com/github/semantic.git synced 2024-12-23 06:41:45 +03:00

Give a default definition for <&> in terms of liftC2.

This commit is contained in:
Rob Rix 2017-04-21 11:50:10 -04:00
parent 2119f3b7ed
commit 9ba51f537a

View File

@ -6,6 +6,7 @@ infixl 4 <&>
class Alternative f => Conjunctive f where
(<&>) :: f (a -> b) -> f a -> f b
f <&> a = liftC2 ($) f a
liftC2 :: (a -> b -> c) -> f a -> f b -> f c
liftC2 f a b = f <$> a <*> b