{-# LANGUAGE CPP #-}
#if __GLASGOW_HASKELL__ >= 702
{-# LANGUAGE Trustworthy #-}
#endif
module Data.Functor.Apply (
Functor(..)
, (<$>)
, ( $>)
, Apply(..)
, (<..>)
, liftF3
, WrappedApplicative(..)
, MaybeApply(..)
) where
import Control.Comonad
import Data.Functor.Bind.Class
infixl 4 <..>
(<..>) :: Apply w => w a -> w (a -> b) -> w b
<..> :: w a -> w (a -> b) -> w b
(<..>) = (a -> (a -> b) -> b) -> w a -> w (a -> b) -> w b
forall (f :: * -> *) a b c.
Apply f =>
(a -> b -> c) -> f a -> f b -> f c
liftF2 (((a -> b) -> a -> b) -> a -> (a -> b) -> b
forall a b c. (a -> b -> c) -> b -> a -> c
flip (a -> b) -> a -> b
forall a. a -> a
id)
{-# INLINE (<..>) #-}
liftF3 :: Apply w => (a -> b -> c -> d) -> w a -> w b -> w c -> w d
liftF3 :: (a -> b -> c -> d) -> w a -> w b -> w c -> w d
liftF3 a -> b -> c -> d
f w a
a w b
b w c
c = a -> b -> c -> d
f (a -> b -> c -> d) -> w a -> w (b -> c -> d)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> w a
a w (b -> c -> d) -> w b -> w (c -> d)
forall (f :: * -> *) a b. Apply f => f (a -> b) -> f a -> f b
<.> w b
b w (c -> d) -> w c -> w d
forall (f :: * -> *) a b. Apply f => f (a -> b) -> f a -> f b
<.> w c
c
{-# INLINE liftF3 #-}