diff options
Diffstat (limited to 'Alpha.hs')
-rw-r--r-- | Alpha.hs | 23 |
1 files changed, 12 insertions, 11 deletions
@@ -39,7 +39,8 @@ module Alpha -- * Mapping (/>), (</), - (<//), + (<%), + (%>), -- * inding bind, @@ -98,33 +99,33 @@ compose f g x = g (f x) (.>) :: (a -> b) -> (b -> c) -> (a -> c) f .> g = compose f g --- infixl 0 .> - -- | Left-composition operator -- -- Pronunciation: gal-dot (<.) :: (b -> c) -> (a -> b) -> (a -> c) g <. f = compose f g --- infixr 0 <. - -- | Alias for map, fmap, <$> -- -- Pronunciation: gal-fas (</) :: Functor f => (a -> b) -> f a -> f b f </ g = fmap f g --- infixr 1 </ +-- | Double fmap. A function on the right goes "into" two functors +-- (i.e. it goes "two levels deep"), applies the function to the inner +-- values, then returns the result wrapped in the two functors. +-- +-- Pronunciation: gal-cen +(<%) :: (Functor f0, Functor f1) => (b -> a) -> f0 (f1 b) -> f0 (f1 a) +(<%) = fmap <. fmap -- | Double fmap. A function on the left goes "into" two functors -- (i.e. it goes "two levels deep"), applies the function to the inner -- values, then returns the result wrapped in the two functors. -- --- Pronunciation: gal-fas-fas -(<//) :: (Functor f0, Functor f1) => (a -> b) -> f0 (f1 a) -> f0 (f1 b) -(<//) = fmap .> fmap - --- infixr 1 <// +-- Pronunciation: cen-gar +(%>) :: (Functor f0, Functor f1) => (a -> b) -> f0 (f1 a) -> f0 (f1 b) +(%>) = fmap .> fmap -- | Normal function application. Do the right side, then pass the -- return value to the function on the left side. |