Applicative combinators.

This commit is contained in:
Stephen Diehl
2016-10-14 10:56:37 +01:00
parent a2e97dc936
commit c061df8f06
2 changed files with 27 additions and 1 deletions
+3
View File
@@ -29,6 +29,9 @@ infixl 4 $>
($>) :: Functor f => f a -> b -> f b
($>) = flip (<$)
(<<$>>) :: (Functor f, Functor g) => (a -> b) -> f (g a) -> f (g b)
(<<$>>) = fmap . fmap
void :: Functor f => f a -> f ()
void x = () <$ x
#endif