definitive-base-2.6.3: A small Prelude wrapper to simplify my own Haskell developments

Safe HaskellNone
LanguageHaskell2010

Algebra.Applicative

Contents

Description

A module describing applicative functors

Synopsis

Documentation

class Functor f => SemiApplicative f where Source #

Methods

(<*>) :: f (a -> b) -> f a -> f b infixl 1 Source #

(<*>) :: Monad f => f (a -> b) -> f a -> f b infixl 1 Source #

Instances

SemiApplicative Strict Source # 

Methods

(<*>) :: Strict (a -> b) -> Strict a -> Strict b Source #

SemiApplicative TimeVal Source # 

Methods

(<*>) :: TimeVal (a -> b) -> TimeVal a -> TimeVal b Source #

Monoid a => SemiApplicative (Const a) Source # 

Methods

(<*>) :: Const a (a -> b) -> Const a a -> Const a b Source #

SemiApplicative f => SemiApplicative (Backwards f) Source # 

Methods

(<*>) :: Backwards f (a -> b) -> Backwards f a -> Backwards f b Source #

SemiApplicative (Zip []) Source # 

Methods

(<*>) :: Zip [] (a -> b) -> Zip [] a -> Zip [] b Source #

SemiApplicative (Zip Maybe) Source # 

Methods

(<*>) :: Zip Maybe (a -> b) -> Zip Maybe a -> Zip Maybe b Source #

SemiApplicative (Zip Tree) Source # 

Methods

(<*>) :: Zip Tree (a -> b) -> Zip Tree a -> Zip Tree b Source #

(Functor f, SemiApplicative (Zip f)) => SemiApplicative (Zip (Free f)) Source # 

Methods

(<*>) :: Zip (Free f) (a -> b) -> Zip (Free f) a -> Zip (Free f) b Source #

SemiApplicative (ContT m) Source # 

Methods

(<*>) :: ContT m (a -> b) -> ContT m a -> ContT m b Source #

Applicative m => SemiApplicative (Cofree m) Source # 

Methods

(<*>) :: Cofree m (a -> b) -> Cofree m a -> Cofree m b Source #

Functor f => SemiApplicative (Free f) Source # 

Methods

(<*>) :: Free f (a -> b) -> Free f a -> Free f b Source #

SemiApplicative m => SemiApplicative (StrictT m) Source # 

Methods

(<*>) :: StrictT m (a -> b) -> StrictT m a -> StrictT m b Source #

SemiApplicative m => SemiApplicative (MaybeT m) Source # 

Methods

(<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b Source #

SemiApplicative m => SemiApplicative (TreeT m) Source # 

Methods

(<*>) :: TreeT m (a -> b) -> TreeT m a -> TreeT m b Source #

SemiApplicative m => SemiApplicative (ListT m) Source # 

Methods

(<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b Source #

SemiApplicative (LogicT m) Source # 

Methods

(<*>) :: LogicT m (a -> b) -> LogicT m a -> LogicT m b Source #

SemiApplicative (IOVar w) Source # 

Methods

(<*>) :: IOVar w (a -> b) -> IOVar w a -> IOVar w b Source #

(SemiApplicative f, SemiApplicative g) => SemiApplicative (Compose' f g) Source # 

Methods

(<*>) :: Compose' f g (a -> b) -> Compose' f g a -> Compose' f g b Source #

SemiApplicative m => SemiApplicative (EitherT e m) Source # 

Methods

(<*>) :: EitherT e m (a -> b) -> EitherT e m a -> EitherT e m b Source #

Monad m => SemiApplicative (ReaderT r m) Source # 

Methods

(<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b Source #

Monad m => SemiApplicative (StateT s m) Source # 

Methods

(<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b Source #

(Monad m, Monoid w) => SemiApplicative (WriterT w m) Source # 

Methods

(<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b Source #

Ring t => SemiApplicative (ProbT t m) Source # 

Methods

(<*>) :: ProbT t m (a -> b) -> ProbT t m a -> ProbT t m b Source #

(Monad m, Monoid w) => SemiApplicative (CounterT w acc m) Source # 

Methods

(<*>) :: CounterT w acc m (a -> b) -> CounterT w acc m a -> CounterT w acc m b Source #

(Monoid w, Monad m) => SemiApplicative (RWST r w s m) Source # 

Methods

(<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b Source #

newtype Zip f a Source #

A wrapper type for lists with zipping Applicative instances, such that Zip [f1,...,fn] <*> Zip [x1,...,xn] == Zip [f1 x1,...,fn xn]

Constructors

Zip 

Fields

Instances

Unit (Zip []) Source # 

Methods

pure :: a -> Zip [] a Source #

Unit (Zip Maybe) Source # 

Methods

pure :: a -> Zip Maybe a Source #

Unit (Zip Tree) Source # 

Methods

pure :: a -> Zip Tree a Source #

Unit (Zip (Free f)) Source # 

Methods

pure :: a -> Zip (Free f) a Source #

Foldable f => Foldable (Zip f) Source # 

Methods

fold :: Monoid m => Zip f m -> m Source #

Applicative (Zip []) Source # 
Applicative (Zip Maybe) Source # 
Applicative (Zip Tree) Source # 
(Functor f, Applicative (Zip f)) => Applicative (Zip (Free f)) Source # 
SemiApplicative (Zip []) Source # 

Methods

(<*>) :: Zip [] (a -> b) -> Zip [] a -> Zip [] b Source #

SemiApplicative (Zip Maybe) Source # 

Methods

(<*>) :: Zip Maybe (a -> b) -> Zip Maybe a -> Zip Maybe b Source #

SemiApplicative (Zip Tree) Source # 

Methods

(<*>) :: Zip Tree (a -> b) -> Zip Tree a -> Zip Tree b Source #

(Functor f, SemiApplicative (Zip f)) => SemiApplicative (Zip (Free f)) Source # 

Methods

(<*>) :: Zip (Free f) (a -> b) -> Zip (Free f) a -> Zip (Free f) b Source #

Functor f => Functor (Zip f) Source # 

Methods

map :: (a -> b) -> Zip f a -> Zip f b Source #

(Applicative (Zip f), Monoid a) => Monoid (Zip f a) Source # 

Methods

zero :: Zip f a Source #

(SemiApplicative (Zip f), Semigroup a) => Semigroup (Zip f a) Source # 

Methods

(+) :: Zip f a -> Zip f a -> Zip f a Source #

newtype Backwards f a Source #

A wrapper for applicative functors with actions executed in the reverse order

Constructors

Backwards 

Fields

Instances

Unit f => Unit (Backwards f) Source # 

Methods

pure :: a -> Backwards f a Source #

Applicative f => Applicative (Backwards f) Source # 
SemiApplicative f => SemiApplicative (Backwards f) Source # 

Methods

(<*>) :: Backwards f (a -> b) -> Backwards f a -> Backwards f b Source #

Functor f => Functor (Backwards f) Source # 

Methods

map :: (a -> b) -> Backwards f a -> Backwards f b Source #

Ring (f a) => Ring (Backwards f a) Source # 

Methods

one :: Backwards f a Source #

Semiring (f a) => Semiring (Backwards f a) Source # 

Methods

(*) :: Backwards f a -> Backwards f a -> Backwards f a Source #

Monoid (f a) => Monoid (Backwards f a) Source # 

Methods

zero :: Backwards f a Source #

Semigroup (f a) => Semigroup (Backwards f a) Source # 

Methods

(+) :: Backwards f a -> Backwards f a -> Backwards f a Source #

(*>) :: SemiApplicative f => f b -> f a -> f a infixl 3 Source #

(<*) :: SemiApplicative f => f a -> f b -> f a infixl 3 Source #

(<**>) :: SemiApplicative f => f (a -> b) -> f a -> f b infixl 1 Source #

ap :: Applicative f => f (a -> b) -> f a -> f b Source #

between :: SemiApplicative f => f b -> f c -> f a -> f a Source #

liftA :: Functor f => (a -> b) -> f a -> f b Source #

liftA2 :: SemiApplicative f => (a -> b -> c) -> f a -> f b -> f c Source #

liftA3 :: SemiApplicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source #

liftA4 :: SemiApplicative f => (a -> b -> c -> d -> e) -> f a -> f b -> f c -> f d -> f e Source #

forever :: SemiApplicative f => f a -> f b Source #

zap :: SemiApplicative (Zip f) => f (a -> b) -> f a -> f b Source #

zap3 :: SemiApplicative (Zip f) => f (a -> b -> c) -> f a -> f b -> f c Source #

zipWith :: (Functor f, SemiApplicative (Zip f)) => (a -> b -> c) -> f a -> f b -> f c Source #

zipWith3 :: (Functor f, SemiApplicative (Zip f)) => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source #

plusA :: (SemiApplicative f, Semigroup a) => f a -> f a -> f a Source #

zeroA :: (Unit f, Monoid a) => f a Source #

Orphan instances

Monad Tree Source # 

Methods

join :: Tree (Tree a) -> Tree a Source #

(>>=) :: Tree a -> (a -> Tree b) -> Tree b Source #

Applicative Tree Source # 
SemiApplicative Tree Source # 

Methods

(<*>) :: Tree (a -> b) -> Tree a -> Tree b Source #

Monoid k => Unit (Assoc k) Source # 

Methods

pure :: a -> Assoc k a Source #

Monoid k => Unit (Increasing k) Source # 

Methods

pure :: a -> Increasing k a Source #

Monad ((->) a) Source # 

Methods

join :: (a -> a -> a) -> a -> a Source #

(>>=) :: (a -> a) -> (a -> a -> b) -> a -> b Source #

Monad (Either a) Source # 

Methods

join :: Either a (Either a a) -> Either a a Source #

(>>=) :: Either a a -> (a -> Either a b) -> Either a b Source #

Monoid w => Monad ((,) w) Source # 

Methods

join :: (w, (w, a)) -> (w, a) Source #

(>>=) :: (w, a) -> (a -> (w, b)) -> (w, b) Source #

(Monoid k, Ord k) => Monad (Increasing k) Source # 

Methods

join :: Increasing k (Increasing k a) -> Increasing k a Source #

(>>=) :: Increasing k a -> (a -> Increasing k b) -> Increasing k b Source #

Applicative ((->) a) Source # 
Applicative (Either a) Source # 
Monoid w => Applicative ((,) w) Source # 
(Monoid k, Ord k) => Applicative (Increasing k) Source # 
SemiApplicative ((->) a) Source # 

Methods

(<*>) :: (a -> a -> b) -> (a -> a) -> a -> b Source #

SemiApplicative (Either a) Source # 

Methods

(<*>) :: Either a (a -> b) -> Either a a -> Either a b Source #

Monoid w => SemiApplicative ((,) w) Source # 

Methods

(<*>) :: (w, a -> b) -> (w, a) -> (w, b) Source #

(Monoid k, Ord k) => SemiApplicative (Increasing k) Source # 

Methods

(<*>) :: Increasing k (a -> b) -> Increasing k a -> Increasing k b Source #

(Unit f, Unit g) => Unit ((:**:) f g) Source # 

Methods

pure :: a -> (f :**: g) a Source #

Ring b => Ring (a -> b) Source # 

Methods

one :: a -> b Source #

Semiring b => Semiring (a -> b) Source # 

Methods

(*) :: (a -> b) -> (a -> b) -> a -> b Source #

Monoid b => Monoid (a -> b) Source # 

Methods

zero :: a -> b Source #

Semigroup b => Semigroup (a -> b) Source # 

Methods

(+) :: (a -> b) -> (a -> b) -> a -> b Source #

(Applicative f, Applicative g) => Applicative ((:**:) f g) Source # 
(Applicative f, Applicative g) => Applicative ((:.:) f g) Source # 
(SemiApplicative f, SemiApplicative g) => SemiApplicative ((:**:) f g) Source # 

Methods

(<*>) :: (f :**: g) (a -> b) -> (f :**: g) a -> (f :**: g) b Source #

(SemiApplicative f, SemiApplicative g) => SemiApplicative ((:.:) f g) Source # 

Methods

(<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b Source #

(Applicative f, Monoid (g a)) => Monoid ((:.:) f g a) Source # 

Methods

zero :: (f :.: g) a Source #

(SemiApplicative f, Semigroup (g a)) => Semigroup ((:.:) f g a) Source # 

Methods

(+) :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a Source #