{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
#if __GLASGOW_HASKELL__ >= 708 && __GLASGOW_HASKELL__ < 710
{-# OPTIONS_GHC -fno-warn-amp #-}
#endif
module Data.Functor.Bind (
Functor(..)
, (<$>)
, ( $>)
, Apply(..)
, (<..>)
, liftF3
, WrappedApplicative(..)
, MaybeApply(..)
, Bind(..)
, (-<<)
, (-<-)
, (->-)
, apDefault
, returning
) where
import Data.Functor.Apply
import Data.Functor.Bind.Class
infixr 1 -<<, -<-, ->-
(-<<) :: Bind m => (a -> m b) -> m a -> m b
-<< :: forall (m :: * -> *) a b. Bind m => (a -> m b) -> m a -> m b
(-<<) = (m a -> (a -> m b) -> m b) -> (a -> m b) -> m a -> m b
forall a b c. (a -> b -> c) -> b -> a -> c
flip m a -> (a -> m b) -> m b
forall a b. m a -> (a -> m b) -> m b
forall (m :: * -> *) a b. Bind m => m a -> (a -> m b) -> m b
(>>-)
(->-) :: Bind m => (a -> m b) -> (b -> m c) -> a -> m c
a -> m b
f ->- :: forall (m :: * -> *) a b c.
Bind m =>
(a -> m b) -> (b -> m c) -> a -> m c
->- b -> m c
g = \a
a -> a -> m b
f a
a m b -> (b -> m c) -> m c
forall a b. m a -> (a -> m b) -> m b
forall (m :: * -> *) a b. Bind m => m a -> (a -> m b) -> m b
>>- b -> m c
g
(-<-) :: Bind m => (b -> m c) -> (a -> m b) -> a -> m c
b -> m c
g -<- :: forall (m :: * -> *) b c a.
Bind m =>
(b -> m c) -> (a -> m b) -> a -> m c
-<- a -> m b
f = \a
a -> a -> m b
f a
a m b -> (b -> m c) -> m c
forall a b. m a -> (a -> m b) -> m b
forall (m :: * -> *) a b. Bind m => m a -> (a -> m b) -> m b
>>- b -> m c
g