planet-mitchell-0.1.0: Planet Mitchell

Applicative

Synopsis

# Applicative

class Functor f => Applicative (f :: * -> *) where #

A functor with application, providing operations to

• embed pure expressions (pure), and
• sequence computations and combine their results (<*> and liftA2).

A minimal complete definition must include implementations of pure and of either <*> or liftA2. If it defines both, then they must behave the same as their default definitions:

(<*>) = liftA2 id
liftA2 f x y = f <$> x <*> y Further, any definition must satisfy the following: identity pure id <*> v = v composition pure (.) <*> u <*> v <*> w = u <*> (v <*> w) homomorphism pure f <*> pure x = pure (f x) interchange u <*> pure y = pure ($ y) <*> u

The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:

• u *> v = (id <$ u) <*> v • u <* v = liftA2 const u v As a consequence of these laws, the Functor instance for f will satisfy • fmap f x = pure f <*> x It may be useful to note that supposing forall x y. p (q x y) = f x . g y it follows from the above that liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v If f is also a Monad, it should satisfy • pure = return • (<*>) = ap • (*>) = (>>) (which implies that pure and <*> satisfy the applicative functor laws). Minimal complete definition pure, ((<*>) | liftA2) Methods pure :: a -> f a # Lift a value. (<*>) :: f (a -> b) -> f a -> f b infixl 4 # Sequential application. A few functors support an implementation of <*> that is more efficient than the default one. liftA2 :: (a -> b -> c) -> f a -> f b -> f c # Lift a binary function to actions. Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>. (*>) :: f a -> f b -> f b infixl 4 # Sequence actions, discarding the value of the first argument. (<*) :: f a -> f b -> f a infixl 4 # Sequence actions, discarding the value of the second argument. Instances  Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a -> [a] #(<*>) :: [a -> b] -> [a] -> [b] #liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] #(*>) :: [a] -> [b] -> [b] #(<*) :: [a] -> [b] -> [a] # Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a -> Maybe a #(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b #liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #(*>) :: Maybe a -> Maybe b -> Maybe b #(<*) :: Maybe a -> Maybe b -> Maybe a # Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a -> IO a #(<*>) :: IO (a -> b) -> IO a -> IO b #liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c #(*>) :: IO a -> IO b -> IO b #(<*) :: IO a -> IO b -> IO a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> Par1 a #(<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b #liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c #(*>) :: Par1 a -> Par1 b -> Par1 b #(<*) :: Par1 a -> Par1 b -> Par1 a # Instance detailsDefined in Language.Haskell.TH.Syntax Methodspure :: a -> Q a #(<*>) :: Q (a -> b) -> Q a -> Q b #liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c #(*>) :: Q a -> Q b -> Q b #(<*) :: Q a -> Q b -> Q a # Instance detailsDefined in Data.Aeson.Types.Internal Methodspure :: a -> IResult a #(<*>) :: IResult (a -> b) -> IResult a -> IResult b #liftA2 :: (a -> b -> c) -> IResult a -> IResult b -> IResult c #(*>) :: IResult a -> IResult b -> IResult b #(<*) :: IResult a -> IResult b -> IResult a # Instance detailsDefined in Data.Aeson.Types.Internal Methodspure :: a -> Result a #(<*>) :: Result (a -> b) -> Result a -> Result b #liftA2 :: (a -> b -> c) -> Result a -> Result b -> Result c #(*>) :: Result a -> Result b -> Result b #(<*) :: Result a -> Result b -> Result a # Instance detailsDefined in Data.Aeson.Types.Internal Methodspure :: a -> Parser a #(<*>) :: Parser (a -> b) -> Parser a -> Parser b #liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c #(*>) :: Parser a -> Parser b -> Parser b #(<*) :: Parser a -> Parser b -> Parser a # Instance detailsDefined in Data.Approximate.Type Methodspure :: a -> Approximate a #(<*>) :: Approximate (a -> b) -> Approximate a -> Approximate b #liftA2 :: (a -> b -> c) -> Approximate a -> Approximate b -> Approximate c #(*>) :: Approximate a -> Approximate b -> Approximate b #(<*) :: Approximate a -> Approximate b -> Approximate a # Instance detailsDefined in Control.Concurrent.Async Methodspure :: a -> Concurrently a #(<*>) :: Concurrently (a -> b) -> Concurrently a -> Concurrently b #liftA2 :: (a -> b -> c) -> Concurrently a -> Concurrently b -> Concurrently c #(*>) :: Concurrently a -> Concurrently b -> Concurrently b #(<*) :: Concurrently a -> Concurrently b -> Concurrently a # Since: base-4.9.0.0 Instance detailsDefined in Data.Complex Methodspure :: a -> Complex a #(<*>) :: Complex (a -> b) -> Complex a -> Complex b #liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c #(*>) :: Complex a -> Complex b -> Complex b #(<*) :: Complex a -> Complex b -> Complex a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Min a #(<*>) :: Min (a -> b) -> Min a -> Min b #liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c #(*>) :: Min a -> Min b -> Min b #(<*) :: Min a -> Min b -> Min a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Max a #(<*>) :: Max (a -> b) -> Max a -> Max b #liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c #(*>) :: Max a -> Max b -> Max b #(<*) :: Max a -> Max b -> Max a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> First a #(<*>) :: First (a -> b) -> First a -> First b #liftA2 :: (a -> b -> c) -> First a -> First b -> First c #(*>) :: First a -> First b -> First b #(<*) :: First a -> First b -> First a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Last a #(<*>) :: Last (a -> b) -> Last a -> Last b #liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c #(*>) :: Last a -> Last b -> Last b #(<*) :: Last a -> Last b -> Last a # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Option a #(<*>) :: Option (a -> b) -> Option a -> Option b #liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c #(*>) :: Option a -> Option b -> Option b #(<*) :: Option a -> Option b -> Option a # f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsN = 'ZipList' (zipWithN f xs1 ... xsN)where zipWithN refers to the zipWith function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example:(\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..] = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..]) = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}Since: base-2.1 Instance detailsDefined in Control.Applicative Methodspure :: a -> ZipList a #(<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b #liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c #(*>) :: ZipList a -> ZipList b -> ZipList b #(<*) :: ZipList a -> ZipList b -> ZipList a # Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methodspure :: a -> Identity a #(<*>) :: Identity (a -> b) -> Identity a -> Identity b #liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #(*>) :: Identity a -> Identity b -> Identity b #(<*) :: Identity a -> Identity b -> Identity a # Since: base-4.8.0.0 Instance detailsDefined in GHC.Conc.Sync Methodspure :: a -> STM a #(<*>) :: STM (a -> b) -> STM a -> STM b #liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c #(*>) :: STM a -> STM b -> STM b #(<*) :: STM a -> STM b -> STM a # Instance detailsDefined in Data.Monoid Methodspure :: a -> First a #(<*>) :: First (a -> b) -> First a -> First b #liftA2 :: (a -> b -> c) -> First a -> First b -> First c #(*>) :: First a -> First b -> First b #(<*) :: First a -> First b -> First a # Instance detailsDefined in Data.Monoid Methodspure :: a -> Last a #(<*>) :: Last (a -> b) -> Last a -> Last b #liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c #(*>) :: Last a -> Last b -> Last b #(<*) :: Last a -> Last b -> Last a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodspure :: a -> Dual a #(<*>) :: Dual (a -> b) -> Dual a -> Dual b #liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c #(*>) :: Dual a -> Dual b -> Dual b #(<*) :: Dual a -> Dual b -> Dual a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodspure :: a -> Sum a #(<*>) :: Sum (a -> b) -> Sum a -> Sum b #liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c #(*>) :: Sum a -> Sum b -> Sum b #(<*) :: Sum a -> Sum b -> Sum a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodspure :: a -> Product a #(<*>) :: Product (a -> b) -> Product a -> Product b #liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c #(*>) :: Product a -> Product b -> Product b #(<*) :: Product a -> Product b -> Product a # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methodspure :: a -> Down a #(<*>) :: Down (a -> b) -> Down a -> Down b #liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c #(*>) :: Down a -> Down b -> Down b #(<*) :: Down a -> Down b -> Down a # Since: base-4.6.0.0 Instance detailsDefined in Text.ParserCombinators.ReadPrec Methodspure :: a -> ReadPrec a #(<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b #liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c #(*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b #(<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a # Since: base-4.6.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methodspure :: a -> ReadP a #(<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b #liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c #(*>) :: ReadP a -> ReadP b -> ReadP b #(<*) :: ReadP a -> ReadP b -> ReadP a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodspure :: a -> NonEmpty a #(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a # Applicative Put Instance detailsDefined in Data.ByteString.Builder.Internal Methodspure :: a -> Put a #(<*>) :: Put (a -> b) -> Put a -> Put b #liftA2 :: (a -> b -> c) -> Put a -> Put b -> Put c #(*>) :: Put a -> Put b -> Put b #(<*) :: Put a -> Put b -> Put a # Instance detailsDefined in Data.Tree Methodspure :: a -> Tree a #(<*>) :: Tree (a -> b) -> Tree a -> Tree b #liftA2 :: (a -> b -> c) -> Tree a -> Tree b -> Tree c #(*>) :: Tree a -> Tree b -> Tree b #(<*) :: Tree a -> Tree b -> Tree a # Since: containers-0.5.4 Instance detailsDefined in Data.Sequence.Internal Methodspure :: a -> Seq a #(<*>) :: Seq (a -> b) -> Seq a -> Seq b #liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c #(*>) :: Seq a -> Seq b -> Seq b #(<*) :: Seq a -> Seq b -> Seq a # Instance detailsDefined in Data.DList Methodspure :: a -> DList a #(<*>) :: DList (a -> b) -> DList a -> DList b #liftA2 :: (a -> b -> c) -> DList a -> DList b -> DList c #(*>) :: DList a -> DList b -> DList b #(<*) :: DList a -> DList b -> DList a # Instance detailsDefined in Control.Parallel.Strategies Methodspure :: a -> Eval a #(<*>) :: Eval (a -> b) -> Eval a -> Eval b #liftA2 :: (a -> b -> c) -> Eval a -> Eval b -> Eval c #(*>) :: Eval a -> Eval b -> Eval b #(<*) :: Eval a -> Eval b -> Eval a # Instance detailsDefined in Data.Vector Methodspure :: a -> Vector a #(<*>) :: Vector (a -> b) -> Vector a -> Vector b #liftA2 :: (a -> b -> c) -> Vector a -> Vector b -> Vector c #(*>) :: Vector a -> Vector b -> Vector b #(<*) :: Vector a -> Vector b -> Vector a # Instance detailsDefined in Numeric.Log Methodspure :: a -> Log a #(<*>) :: Log (a -> b) -> Log a -> Log b #liftA2 :: (a -> b -> c) -> Log a -> Log b -> Log c #(*>) :: Log a -> Log b -> Log b #(<*) :: Log a -> Log b -> Log a # Instance detailsDefined in Control.Monad.Managed Methodspure :: a -> Managed a #(<*>) :: Managed (a -> b) -> Managed a -> Managed b #liftA2 :: (a -> b -> c) -> Managed a -> Managed b -> Managed c #(*>) :: Managed a -> Managed b -> Managed b #(<*) :: Managed a -> Managed b -> Managed a # Instance detailsDefined in Options.Applicative.Types Methodspure :: a -> ReadM a #(<*>) :: ReadM (a -> b) -> ReadM a -> ReadM b #liftA2 :: (a -> b -> c) -> ReadM a -> ReadM b -> ReadM c #(*>) :: ReadM a -> ReadM b -> ReadM b #(<*) :: ReadM a -> ReadM b -> ReadM a # Instance detailsDefined in Options.Applicative.Types Methodspure :: a -> Parser a #(<*>) :: Parser (a -> b) -> Parser a -> Parser b #liftA2 :: (a -> b -> c) -> Parser a -> Parser b -> Parser c #(*>) :: Parser a -> Parser b -> Parser b #(<*) :: Parser a -> Parser b -> Parser a # Instance detailsDefined in Options.Applicative.Types Methodspure :: a -> ParserM a #(<*>) :: ParserM (a -> b) -> ParserM a -> ParserM b #liftA2 :: (a -> b -> c) -> ParserM a -> ParserM b -> ParserM c #(*>) :: ParserM a -> ParserM b -> ParserM b #(<*) :: ParserM a -> ParserM b -> ParserM a # Instance detailsDefined in Options.Applicative.Types Methodspure :: a -> ParserResult a #(<*>) :: ParserResult (a -> b) -> ParserResult a -> ParserResult b #liftA2 :: (a -> b -> c) -> ParserResult a -> ParserResult b -> ParserResult c #(*>) :: ParserResult a -> ParserResult b -> ParserResult b #(<*) :: ParserResult a -> ParserResult b -> ParserResult a # Instance detailsDefined in Data.Primitive.SmallArray Methodspure :: a -> SmallArray a #(<*>) :: SmallArray (a -> b) -> SmallArray a -> SmallArray b #liftA2 :: (a -> b -> c) -> SmallArray a -> SmallArray b -> SmallArray c #(*>) :: SmallArray a -> SmallArray b -> SmallArray b #(<*) :: SmallArray a -> SmallArray b -> SmallArray a # Instance detailsDefined in Data.Primitive.Array Methodspure :: a -> Array a #(<*>) :: Array (a -> b) -> Array a -> Array b #liftA2 :: (a -> b -> c) -> Array a -> Array b -> Array c #(*>) :: Array a -> Array b -> Array b #(<*) :: Array a -> Array b -> Array a # The function pure returns a value that is constant in time. Semantically,pure :: a -> Behavior a pure x = \time -> xThe combinator <*> applies a time-varying function to a time-varying value.(<*>) :: Behavior (a -> b) -> Behavior a -> Behavior b fx <*> bx = \time -> fx time$ bx time Instance detailsDefined in Reactive.Banana.Types Methodspure :: a -> Behavior a #(<*>) :: Behavior (a -> b) -> Behavior a -> Behavior b #liftA2 :: (a -> b -> c) -> Behavior a -> Behavior b -> Behavior c #(*>) :: Behavior a -> Behavior b -> Behavior b #(<*) :: Behavior a -> Behavior b -> Behavior a # Instance detailsDefined in Reactive.Banana.Types Methodspure :: a -> Future a #(<*>) :: Future (a -> b) -> Future a -> Future b #liftA2 :: (a -> b -> c) -> Future a -> Future b -> Future c #(*>) :: Future a -> Future b -> Future b #(<*) :: Future a -> Future b -> Future a # Instance detailsDefined in Reactive.Banana.Types Methodspure :: a -> Moment a #(<*>) :: Moment (a -> b) -> Moment a -> Moment b #liftA2 :: (a -> b -> c) -> Moment a -> Moment b -> Moment c #(*>) :: Moment a -> Moment b -> Moment b #(<*) :: Moment a -> Moment b -> Moment a # Instance detailsDefined in Reactive.Banana.Types Methodspure :: a -> MomentIO a #(<*>) :: MomentIO (a -> b) -> MomentIO a -> MomentIO b #liftA2 :: (a -> b -> c) -> MomentIO a -> MomentIO b -> MomentIO c #(*>) :: MomentIO a -> MomentIO b -> MomentIO b #(<*) :: MomentIO a -> MomentIO b -> MomentIO a # Applicative Cleanup Instance detailsDefined in System.Process.Typed Methodspure :: a -> Cleanup a #(<*>) :: Cleanup (a -> b) -> Cleanup a -> Cleanup b #liftA2 :: (a -> b -> c) -> Cleanup a -> Cleanup b -> Cleanup c #(*>) :: Cleanup a -> Cleanup b -> Cleanup b #(<*) :: Cleanup a -> Cleanup b -> Cleanup a # Instance details Methodspure :: a -> Element a #(<*>) :: Element (a -> b) -> Element a -> Element b #liftA2 :: (a -> b -> c) -> Element a -> Element b -> Element c #(*>) :: Element a -> Element b -> Element b #(<*) :: Element a -> Element b -> Element a # Instance detailsDefined in UnliftIO.Memoize Methodspure :: a -> Memoized a #(<*>) :: Memoized (a -> b) -> Memoized a -> Memoized b #liftA2 :: (a -> b -> c) -> Memoized a -> Memoized b -> Memoized c #(*>) :: Memoized a -> Memoized b -> Memoized b #(<*) :: Memoized a -> Memoized b -> Memoized a # Since: base-4.5.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methodspure :: a -> P a #(<*>) :: P (a -> b) -> P a -> P b #liftA2 :: (a -> b -> c) -> P a -> P b -> P c #(*>) :: P a -> P b -> P b #(<*) :: P a -> P b -> P a # () :=> (Applicative ((->) a :: * -> *)) Instance detailsDefined in Data.Constraint Methodsins :: () :- Applicative ((->) a) # () :=> (Applicative []) Instance detailsDefined in Data.Constraint Methodsins :: () :- Applicative [] # Instance detailsDefined in Data.Constraint Methods () :=> (Applicative IO) Instance detailsDefined in Data.Constraint Methodsins :: () :- Applicative IO # () :=> (Applicative (Either a)) Instance detailsDefined in Data.Constraint Methodsins :: () :- Applicative (Either a) # Since: base-3.0 Instance detailsDefined in Data.Either Methodspure :: a -> Either e a #(<*>) :: Either e (a -> b) -> Either e a -> Either e b #liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c #(*>) :: Either e a -> Either e b -> Either e b #(<*) :: Either e a -> Either e b -> Either e a # Applicative (U1 :: * -> *) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> U1 a #(<*>) :: U1 (a -> b) -> U1 a -> U1 b #liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c #(*>) :: U1 a -> U1 b -> U1 b #(<*) :: U1 a -> U1 b -> U1 a # Monoid a => Applicative ((,) a) For tuples, the Monoid constraint on a determines how the first values merge. For example, Strings concatenate:("hello ", (+15)) <*> ("world!", 2002) ("hello world!",2017)Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a0 -> (a, a0) #(<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) #liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) #(*>) :: (a, a0) -> (a, b) -> (a, b) #(<*) :: (a, a0) -> (a, b) -> (a, a0) # Since: base-4.4.0.0 Instance detailsDefined in GHC.ST Methodspure :: a -> ST s a #(<*>) :: ST s (a -> b) -> ST s a -> ST s b #liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c #(*>) :: ST s a -> ST s b -> ST s b #(<*) :: ST s a -> ST s b -> ST s a # Instance detailsDefined in Text.Earley.Parser.Internal Methodspure :: a -> Results s a #(<*>) :: Results s (a -> b) -> Results s a -> Results s b #liftA2 :: (a -> b -> c) -> Results s a -> Results s b -> Results s c #(*>) :: Results s a -> Results s b -> Results s b #(<*) :: Results s a -> Results s b -> Results s a # Instance detailsDefined in Text.Earley.Grammar Methodspure :: a -> Grammar r a #(<*>) :: Grammar r (a -> b) -> Grammar r a -> Grammar r b #liftA2 :: (a -> b -> c) -> Grammar r a -> Grammar r b -> Grammar r c #(*>) :: Grammar r a -> Grammar r b -> Grammar r b #(<*) :: Grammar r a -> Grammar r b -> Grammar r a # Representable f => Applicative (Co f) Instance detailsDefined in Data.Functor.Rep Methodspure :: a -> Co f a #(<*>) :: Co f (a -> b) -> Co f a -> Co f b #liftA2 :: (a -> b -> c) -> Co f a -> Co f b -> Co f c #(*>) :: Co f a -> Co f b -> Co f b #(<*) :: Co f a -> Co f b -> Co f a # Monad m => Applicative (WrappedMonad m) Since: base-2.1 Instance detailsDefined in Control.Applicative Methodspure :: a -> WrappedMonad m a #(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b #liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c #(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b #(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a # Arrow a => Applicative (ArrowMonad a) Since: base-4.6.0.0 Instance detailsDefined in Control.Arrow Methodspure :: a0 -> ArrowMonad a a0 #(<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b #liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c #(*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b #(<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 # Applicative (Proxy :: * -> *) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methodspure :: a -> Proxy a #(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #(*>) :: Proxy a -> Proxy b -> Proxy b #(<*) :: Proxy a -> Proxy b -> Proxy a # (Functor m, Monad m) => Applicative (MaybeT m) Instance detailsDefined in Control.Monad.Trans.Maybe Methodspure :: a -> MaybeT m a #(<*>) :: MaybeT m (a -> b) -> MaybeT m a -> MaybeT m b #liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c #(*>) :: MaybeT m a -> MaybeT m b -> MaybeT m b #(<*) :: MaybeT m a -> MaybeT m b -> MaybeT m a # Instance detailsDefined in Control.Foldl Methodspure :: a0 -> Fold a a0 #(<*>) :: Fold a (a0 -> b) -> Fold a a0 -> Fold a b #liftA2 :: (a0 -> b -> c) -> Fold a a0 -> Fold a b -> Fold a c #(*>) :: Fold a a0 -> Fold a b -> Fold a b #(<*) :: Fold a a0 -> Fold a b -> Fold a a0 # Alternative f => Applicative (Cofree f) Instance detailsDefined in Control.Comonad.Cofree Methodspure :: a -> Cofree f a #(<*>) :: Cofree f (a -> b) -> Cofree f a -> Cofree f b #liftA2 :: (a -> b -> c) -> Cofree f a -> Cofree f b -> Cofree f c #(*>) :: Cofree f a -> Cofree f b -> Cofree f b #(<*) :: Cofree f a -> Cofree f b -> Cofree f a # Functor f => Applicative (Free f) Instance detailsDefined in Control.Monad.Free Methodspure :: a -> Free f a #(<*>) :: Free f (a -> b) -> Free f a -> Free f b #liftA2 :: (a -> b -> c) -> Free f a -> Free f b -> Free f c #(*>) :: Free f a -> Free f b -> Free f b #(<*) :: Free f a -> Free f b -> Free f a # Instance detailsDefined in Control.Applicative.Free Methodspure :: a -> Ap f a #(<*>) :: Ap f (a -> b) -> Ap f a -> Ap f b #liftA2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c #(*>) :: Ap f a -> Ap f b -> Ap f b #(<*) :: Ap f a -> Ap f b -> Ap f a # Functor f => Applicative (Curried f) Instance detailsDefined in Data.Generics.Internal.VL.Traversal Methodspure :: a -> Curried f a #(<*>) :: Curried f (a -> b) -> Curried f a -> Curried f b #liftA2 :: (a -> b -> c) -> Curried f a -> Curried f b -> Curried f c #(*>) :: Curried f a -> Curried f b -> Curried f b #(<*) :: Curried f a -> Curried f b -> Curried f a # Applicative f => Applicative (Yoneda f) Instance detailsDefined in Data.Generics.Internal.VL.Traversal Methodspure :: a -> Yoneda f a #(<*>) :: Yoneda f (a -> b) -> Yoneda f a -> Yoneda f b #liftA2 :: (a -> b -> c) -> Yoneda f a -> Yoneda f b -> Yoneda f c #(*>) :: Yoneda f a -> Yoneda f b -> Yoneda f b #(<*) :: Yoneda f a -> Yoneda f b -> Yoneda f a # Applicative f => Applicative (Yoneda f) Instance detailsDefined in Data.Functor.Yoneda Methodspure :: a -> Yoneda f a #(<*>) :: Yoneda f (a -> b) -> Yoneda f a -> Yoneda f b #liftA2 :: (a -> b -> c) -> Yoneda f a -> Yoneda f b -> Yoneda f c #(*>) :: Yoneda f a -> Yoneda f b -> Yoneda f b #(<*) :: Yoneda f a -> Yoneda f b -> Yoneda f a # Instance detailsDefined in Control.Lens.Reified Methodspure :: a -> ReifiedGetter s a #(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #liftA2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c #(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a # Instance detailsDefined in Control.Lens.Reified Methodspure :: a -> ReifiedFold s a #(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #liftA2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c #(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a # Instance detailsDefined in Control.Lens.Internal.Indexed Methodspure :: a -> Indexing f a #(<*>) :: Indexing f (a -> b) -> Indexing f a -> Indexing f b #liftA2 :: (a -> b -> c) -> Indexing f a -> Indexing f b -> Indexing f c #(*>) :: Indexing f a -> Indexing f b -> Indexing f b #(<*) :: Indexing f a -> Indexing f b -> Indexing f a # Instance detailsDefined in Control.Lens.Internal.Indexed Methodspure :: a -> Indexing64 f a #(<*>) :: Indexing64 f (a -> b) -> Indexing64 f a -> Indexing64 f b #liftA2 :: (a -> b -> c) -> Indexing64 f a -> Indexing64 f b -> Indexing64 f c #(*>) :: Indexing64 f a -> Indexing64 f b -> Indexing64 f b #(<*) :: Indexing64 f a -> Indexing64 f b -> Indexing64 f a # Monad m => Applicative (ListT m) Instance detailsDefined in List.Transformer Methodspure :: a -> ListT m a #(<*>) :: ListT m (a -> b) -> ListT m a -> ListT m b #liftA2 :: (a -> b -> c) -> ListT m a -> ListT m b -> ListT m c #(*>) :: ListT m a -> ListT m b -> ListT m b #(<*) :: ListT m a -> ListT m b -> ListT m a # Instance detailsDefined in Control.Monad.Logic Methodspure :: a -> LogicT f a #(<*>) :: LogicT f (a -> b) -> LogicT f a -> LogicT f b #liftA2 :: (a -> b -> c) -> LogicT f a -> LogicT f b -> LogicT f c #(*>) :: LogicT f a -> LogicT f b -> LogicT f b #(<*) :: LogicT f a -> LogicT f b -> LogicT f a # (Applicative (Rep p), Representable p) => Applicative (Prep p) Instance detailsDefined in Data.Profunctor.Rep Methodspure :: a -> Prep p a #(<*>) :: Prep p (a -> b) -> Prep p a -> Prep p b #liftA2 :: (a -> b -> c) -> Prep p a -> Prep p b -> Prep p c #(*>) :: Prep p a -> Prep p b -> Prep p b #(<*) :: Prep p a -> Prep p b -> Prep p a # Instance detailsDefined in Data.Functor.Bind.Class Methodspure :: a -> WrappedApplicative f a #(<*>) :: WrappedApplicative f (a -> b) -> WrappedApplicative f a -> WrappedApplicative f b #liftA2 :: (a -> b -> c) -> WrappedApplicative f a -> WrappedApplicative f b -> WrappedApplicative f c #(*>) :: WrappedApplicative f a -> WrappedApplicative f b -> WrappedApplicative f b #(<*) :: WrappedApplicative f a -> WrappedApplicative f b -> WrappedApplicative f a # Apply f => Applicative (MaybeApply f) Instance detailsDefined in Data.Functor.Bind.Class Methodspure :: a -> MaybeApply f a #(<*>) :: MaybeApply f (a -> b) -> MaybeApply f a -> MaybeApply f b #liftA2 :: (a -> b -> c) -> MaybeApply f a -> MaybeApply f b -> MaybeApply f c #(*>) :: MaybeApply f a -> MaybeApply f b -> MaybeApply f b #(<*) :: MaybeApply f a -> MaybeApply f b -> MaybeApply f a # Instance detailsDefined in Data.Text.Internal.Read Methodspure :: a -> IParser t a #(<*>) :: IParser t (a -> b) -> IParser t a -> IParser t b #liftA2 :: (a -> b -> c) -> IParser t a -> IParser t b -> IParser t c #(*>) :: IParser t a -> IParser t b -> IParser t b #(<*) :: IParser t a -> IParser t b -> IParser t a # Since: unliftio-0.1.0.0 Instance detailsDefined in UnliftIO.Async Methodspure :: a -> Concurrently m a #(<*>) :: Concurrently m (a -> b) -> Concurrently m a -> Concurrently m b #liftA2 :: (a -> b -> c) -> Concurrently m a -> Concurrently m b -> Concurrently m c #(*>) :: Concurrently m a -> Concurrently m b -> Concurrently m b #(<*) :: Concurrently m a -> Concurrently m b -> Concurrently m a # Applicative f => Applicative (AltSum f) Instance detailsDefined in Control.Compactable Methodspure :: a -> AltSum f a #(<*>) :: AltSum f (a -> b) -> AltSum f a -> AltSum f b #liftA2 :: (a -> b -> c) -> AltSum f a -> AltSum f b -> AltSum f c #(*>) :: AltSum f a -> AltSum f b -> AltSum f b #(<*) :: AltSum f a -> AltSum f b -> AltSum f a # Applicative (SetM s) Instance detailsDefined in Data.Graph Methodspure :: a -> SetM s a #(<*>) :: SetM s (a -> b) -> SetM s a -> SetM s b #liftA2 :: (a -> b -> c) -> SetM s a -> SetM s b -> SetM s c #(*>) :: SetM s a -> SetM s b -> SetM s b #(<*) :: SetM s a -> SetM s b -> SetM s a # Applicative (SortedAp f) Instance detailsDefined in Data.HashMap.Strict.InsOrd Methodspure :: a -> SortedAp f a #(<*>) :: SortedAp f (a -> b) -> SortedAp f a -> SortedAp f b #liftA2 :: (a -> b -> c) -> SortedAp f a -> SortedAp f b -> SortedAp f c #(*>) :: SortedAp f a -> SortedAp f b -> SortedAp f b #(<*) :: SortedAp f a -> SortedAp f b -> SortedAp f a # Applicative (IncrementalDecoder s) Instance detailsDefined in Codec.CBOR.Read Methodspure :: a -> IncrementalDecoder s a #(<*>) :: IncrementalDecoder s (a -> b) -> IncrementalDecoder s a -> IncrementalDecoder s b #liftA2 :: (a -> b -> c) -> IncrementalDecoder s a -> IncrementalDecoder s b -> IncrementalDecoder s c #(*>) :: IncrementalDecoder s a -> IncrementalDecoder s b -> IncrementalDecoder s b #(<*) :: IncrementalDecoder s a -> IncrementalDecoder s b -> IncrementalDecoder s a # Class (Functor f) (Applicative f) Instance detailsDefined in Data.Constraint Methods Class (Applicative f) (Monad f) Instance detailsDefined in Data.Constraint Methods Class (Applicative f) (Alternative f) Instance detailsDefined in Data.Constraint Methods (Monad m) :=> (Applicative (WrappedMonad m)) Instance detailsDefined in Data.Constraint Methods (Monoid a) :=> (Applicative ((,) a)) Instance detailsDefined in Data.Constraint Methods (Monoid a) :=> (Applicative (Const a :: * -> *)) Instance detailsDefined in Data.Constraint Methods Applicative f => Applicative (Rec1 f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> Rec1 f a #(<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b #liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c #(*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b #(<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a # Applicative (Results s t) Instance detailsDefined in Text.Earley.Generator.Internal Methodspure :: a -> Results s t a #(<*>) :: Results s t (a -> b) -> Results s t a -> Results s t b #liftA2 :: (a -> b -> c) -> Results s t a -> Results s t b -> Results s t c #(*>) :: Results s t a -> Results s t b -> Results s t b #(<*) :: Results s t a -> Results s t b -> Results s t a # Arrow a => Applicative (WrappedArrow a b) Since: base-2.1 Instance detailsDefined in Control.Applicative Methodspure :: a0 -> WrappedArrow a b a0 #(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 #liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c #(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 #(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 # Monoid m => Applicative (Const m :: * -> *) Since: base-2.0.1 Instance detailsDefined in Data.Functor.Const Methodspure :: a -> Const m a #(<*>) :: Const m (a -> b) -> Const m a -> Const m b #liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c #(*>) :: Const m a -> Const m b -> Const m b #(<*) :: Const m a -> Const m b -> Const m a # Applicative f => Applicative (Alt f) Instance detailsDefined in Data.Semigroup.Internal Methodspure :: a -> Alt f a #(<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b #liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c #(*>) :: Alt f a -> Alt f b -> Alt f b #(<*) :: Alt f a -> Alt f b -> Alt f a # Biapplicative p => Applicative (Join p) Instance detailsDefined in Data.Bifunctor.Join Methodspure :: a -> Join p a #(<*>) :: Join p (a -> b) -> Join p a -> Join p b #liftA2 :: (a -> b -> c) -> Join p a -> Join p b -> Join p c #(*>) :: Join p a -> Join p b -> Join p b #(<*) :: Join p a -> Join p b -> Join p a # Biapplicative p => Applicative (Fix p) Instance detailsDefined in Data.Bifunctor.Fix Methodspure :: a -> Fix p a #(<*>) :: Fix p (a -> b) -> Fix p a -> Fix p b #liftA2 :: (a -> b -> c) -> Fix p a -> Fix p b -> Fix p c #(*>) :: Fix p a -> Fix p b -> Fix p b #(<*) :: Fix p a -> Fix p b -> Fix p a # Instance detailsDefined in Control.Monad.Trans.Identity Methodspure :: a -> IdentityT m a #(<*>) :: IdentityT m (a -> b) -> IdentityT m a -> IdentityT m b #liftA2 :: (a -> b -> c) -> IdentityT m a -> IdentityT m b -> IdentityT m c #(*>) :: IdentityT m a -> IdentityT m b -> IdentityT m b #(<*) :: IdentityT m a -> IdentityT m b -> IdentityT m a # (Applicative f, Monad f) => Applicative (WhenMissing f x) Equivalent to ReaderT k (ReaderT x (MaybeT f)).Since: containers-0.5.9 Instance detailsDefined in Data.IntMap.Internal Methodspure :: a -> WhenMissing f x a #(<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b #liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c #(*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b #(<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a # (Functor m, Monad m) => Applicative (ExceptT e m) Instance detailsDefined in Control.Monad.Trans.Except Methodspure :: a -> ExceptT e m a #(<*>) :: ExceptT e m (a -> b) -> ExceptT e m a -> ExceptT e m b #liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c #(*>) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m b #(<*) :: ExceptT e m a -> ExceptT e m b -> ExceptT e m a # Monad m => Applicative (GT m g) Instance detailsDefined in Data.Graph.Inductive.Query.Monad Methodspure :: a -> GT m g a #(<*>) :: GT m g (a -> b) -> GT m g a -> GT m g b #liftA2 :: (a -> b -> c) -> GT m g a -> GT m g b -> GT m g c #(*>) :: GT m g a -> GT m g b -> GT m g b #(<*) :: GT m g a -> GT m g b -> GT m g a # Monad m => Applicative (FoldM m a) Instance detailsDefined in Control.Foldl Methodspure :: a0 -> FoldM m a a0 #(<*>) :: FoldM m a (a0 -> b) -> FoldM m a a0 -> FoldM m a b #liftA2 :: (a0 -> b -> c) -> FoldM m a a0 -> FoldM m a b -> FoldM m a c #(*>) :: FoldM m a a0 -> FoldM m a b -> FoldM m a b #(<*) :: FoldM m a a0 -> FoldM m a b -> FoldM m a a0 # (Functor f, Monad m) => Applicative (FreeT f m) Instance detailsDefined in Control.Monad.Trans.Free Methodspure :: a -> FreeT f m a #(<*>) :: FreeT f m (a -> b) -> FreeT f m a -> FreeT f m b #liftA2 :: (a -> b -> c) -> FreeT f m a -> FreeT f m b -> FreeT f m c #(*>) :: FreeT f m a -> FreeT f m b -> FreeT f m b #(<*) :: FreeT f m a -> FreeT f m b -> FreeT f m a # (Alternative f, Applicative w) => Applicative (CofreeT f w) Instance detailsDefined in Control.Comonad.Trans.Cofree Methodspure :: a -> CofreeT f w a #(<*>) :: CofreeT f w (a -> b) -> CofreeT f w a -> CofreeT f w b #liftA2 :: (a -> b -> c) -> CofreeT f w a -> CofreeT f w b -> CofreeT f w c #(*>) :: CofreeT f w a -> CofreeT f w b -> CofreeT f w b #(<*) :: CofreeT f w a -> CofreeT f w b -> CofreeT f w a # (Applicative f, Applicative g) => Applicative (Day f g) Instance detailsDefined in Data.Functor.Day Methodspure :: a -> Day f g a #(<*>) :: Day f g (a -> b) -> Day f g a -> Day f g b #liftA2 :: (a -> b -> c) -> Day f g a -> Day f g b -> Day f g c #(*>) :: Day f g a -> Day f g b -> Day f g b #(<*) :: Day f g a -> Day f g b -> Day f g a # (Functor m, Monad m) => Applicative (ErrorT e m) Instance detailsDefined in Control.Monad.Trans.Error Methodspure :: a -> ErrorT e m a #(<*>) :: ErrorT e m (a -> b) -> ErrorT e m a -> ErrorT e m b #liftA2 :: (a -> b -> c) -> ErrorT e m a -> ErrorT e m b -> ErrorT e m c #(*>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b #(<*) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m a # Apply f-actions in the reverse order. Instance detailsDefined in Control.Applicative.Backwards Methodspure :: a -> Backwards f a #(<*>) :: Backwards f (a -> b) -> Backwards f a -> Backwards f b #liftA2 :: (a -> b -> c) -> Backwards f a -> Backwards f b -> Backwards f c #(*>) :: Backwards f a -> Backwards f b -> Backwards f b #(<*) :: Backwards f a -> Backwards f b -> Backwards f a # Applicative (Mafic a b) Instance detailsDefined in Control.Lens.Internal.Magma Methodspure :: a0 -> Mafic a b a0 #(<*>) :: Mafic a b (a0 -> b0) -> Mafic a b a0 -> Mafic a b b0 #liftA2 :: (a0 -> b0 -> c) -> Mafic a b a0 -> Mafic a b b0 -> Mafic a b c #(*>) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b b0 #(<*) :: Mafic a b a0 -> Mafic a b b0 -> Mafic a b a0 # Applicative (Indexed i a) Instance detailsDefined in Control.Lens.Internal.Indexed Methodspure :: a0 -> Indexed i a a0 #(<*>) :: Indexed i a (a0 -> b) -> Indexed i a a0 -> Indexed i a b #liftA2 :: (a0 -> b -> c) -> Indexed i a a0 -> Indexed i a b -> Indexed i a c #(*>) :: Indexed i a a0 -> Indexed i a b -> Indexed i a b #(<*) :: Indexed i a a0 -> Indexed i a b -> Indexed i a a0 # (Functor m, Monad m) => Applicative (StateT s m) Instance detailsDefined in Control.Monad.Trans.State.Lazy Methodspure :: a -> StateT s m a #(<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b #liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c #(*>) :: StateT s m a -> StateT s m b -> StateT s m b #(<*) :: StateT s m a -> StateT s m b -> StateT s m a # Applicative (STE e s) Instance detailsDefined in Control.Monad.STE.Internal Methodspure :: a -> STE e s a #(<*>) :: STE e s (a -> b) -> STE e s a -> STE e s b #liftA2 :: (a -> b -> c) -> STE e s a -> STE e s b -> STE e s c #(*>) :: STE e s a -> STE e s b -> STE e s b #(<*) :: STE e s a -> STE e s b -> STE e s a # (Functor m, Monad m) => Applicative (StateT s m) Instance detailsDefined in Control.Monad.Trans.State.Strict Methodspure :: a -> StateT s m a #(<*>) :: StateT s m (a -> b) -> StateT s m a -> StateT s m b #liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c #(*>) :: StateT s m a -> StateT s m b -> StateT s m b #(<*) :: StateT s m a -> StateT s m b -> StateT s m a # (Profunctor p, Arrow p) => Applicative (Closure p a) Instance detailsDefined in Data.Profunctor.Closed Methodspure :: a0 -> Closure p a a0 #(<*>) :: Closure p a (a0 -> b) -> Closure p a a0 -> Closure p a b #liftA2 :: (a0 -> b -> c) -> Closure p a a0 -> Closure p a b -> Closure p a c #(*>) :: Closure p a a0 -> Closure p a b -> Closure p a b #(<*) :: Closure p a a0 -> Closure p a b -> Closure p a a0 # (Profunctor p, Arrow p) => Applicative (Tambara p a) Instance detailsDefined in Data.Profunctor.Strong Methodspure :: a0 -> Tambara p a a0 #(<*>) :: Tambara p a (a0 -> b) -> Tambara p a a0 -> Tambara p a b #liftA2 :: (a0 -> b -> c) -> Tambara p a a0 -> Tambara p a b -> Tambara p a c #(*>) :: Tambara p a a0 -> Tambara p a b -> Tambara p a b #(<*) :: Tambara p a a0 -> Tambara p a b -> Tambara p a a0 # Applicative f => Applicative (Star f a) Instance detailsDefined in Data.Profunctor.Types Methodspure :: a0 -> Star f a a0 #(<*>) :: Star f a (a0 -> b) -> Star f a a0 -> Star f a b #liftA2 :: (a0 -> b -> c) -> Star f a a0 -> Star f a b -> Star f a c #(*>) :: Star f a a0 -> Star f a b -> Star f a b #(<*) :: Star f a a0 -> Star f a b -> Star f a a0 # Applicative (Costar f a) Instance detailsDefined in Data.Profunctor.Types Methodspure :: a0 -> Costar f a a0 #(<*>) :: Costar f a (a0 -> b) -> Costar f a a0 -> Costar f a b #liftA2 :: (a0 -> b -> c) -> Costar f a a0 -> Costar f a b -> Costar f a c #(*>) :: Costar f a a0 -> Costar f a b -> Costar f a b #(<*) :: Costar f a a0 -> Costar f a b -> Costar f a a0 # Applicative f => Applicative (Static f a) Instance detailsDefined in Data.Semigroupoid.Static Methodspure :: a0 -> Static f a a0 #(<*>) :: Static f a (a0 -> b) -> Static f a a0 -> Static f a b #liftA2 :: (a0 -> b -> c) -> Static f a a0 -> Static f a b -> Static f a c #(*>) :: Static f a a0 -> Static f a b -> Static f a b #(<*) :: Static f a a0 -> Static f a b -> Static f a a0 # Instance detailsDefined in Data.Tagged Methodspure :: a -> Tagged s a #(<*>) :: Tagged s (a -> b) -> Tagged s a -> Tagged s b #liftA2 :: (a -> b -> c) -> Tagged s a -> Tagged s b -> Tagged s c #(*>) :: Tagged s a -> Tagged s b -> Tagged s b #(<*) :: Tagged s a -> Tagged s b -> Tagged s a # (Functor m, Monad m) => Applicative (WriterT w m) Instance detailsDefined in Control.Monad.Trans.Writer.CPS.Internal Methodspure :: a -> WriterT w m a #(<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b #liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c #(*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #(<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a # Monoid m => Applicative (Holes t m) Instance detailsDefined in Control.Lens.Traversal Methodspure :: a -> Holes t m a #(<*>) :: Holes t m (a -> b) -> Holes t m a -> Holes t m b #liftA2 :: (a -> b -> c) -> Holes t m a -> Holes t m b -> Holes t m c #(*>) :: Holes t m a -> Holes t m b -> Holes t m b #(<*) :: Holes t m a -> Holes t m b -> Holes t m a # Applicative ((->) a :: * -> *) Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a0 -> a -> a0 #(<*>) :: (a -> a0 -> b) -> (a -> a0) -> a -> b #liftA2 :: (a0 -> b -> c) -> (a -> a0) -> (a -> b) -> a -> c #(*>) :: (a -> a0) -> (a -> b) -> a -> b #(<*) :: (a -> a0) -> (a -> b) -> a -> a0 # (Applicative f, Applicative g) => Applicative (f :*: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> (f :*: g) a #(<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b #liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c #(*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #(<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a # Applicative (Prod r e t) Instance detailsDefined in Text.Earley.Grammar Methodspure :: a -> Prod r e t a #(<*>) :: Prod r e t (a -> b) -> Prod r e t a -> Prod r e t b #liftA2 :: (a -> b -> c) -> Prod r e t a -> Prod r e t b -> Prod r e t c #(*>) :: Prod r e t a -> Prod r e t b -> Prod r e t b #(<*) :: Prod r e t a -> Prod r e t b -> Prod r e t a # (Applicative f, Applicative g) => Applicative (Product f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methodspure :: a -> Product f g a #(<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b #liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c #(*>) :: Product f g a -> Product f g b -> Product f g b #(<*) :: Product f g a -> Product f g b -> Product f g a # Applicative (Cokleisli w a) Instance detailsDefined in Control.Comonad Methodspure :: a0 -> Cokleisli w a a0 #(<*>) :: Cokleisli w a (a0 -> b) -> Cokleisli w a a0 -> Cokleisli w a b #liftA2 :: (a0 -> b -> c) -> Cokleisli w a a0 -> Cokleisli w a b -> Cokleisli w a c #(*>) :: Cokleisli w a a0 -> Cokleisli w a b -> Cokleisli w a b #(<*) :: Cokleisli w a a0 -> Cokleisli w a b -> Cokleisli w a a0 # (Monad f, Applicative f) => Applicative (WhenMatched f x y) Equivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))Since: containers-0.5.9 Instance detailsDefined in Data.IntMap.Internal Methodspure :: a -> WhenMatched f x y a #(<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b #liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c #(*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b #(<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a # (Applicative f, Monad f) => Applicative (WhenMissing f k x) Equivalent to  ReaderT k (ReaderT x (MaybeT f)) .Since: containers-0.5.9 Instance detailsDefined in Data.Map.Internal Methodspure :: a -> WhenMissing f k x a #(<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b #liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c #(*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b #(<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a # Applicative (Molten i a b) Instance detailsDefined in Control.Lens.Internal.Magma Methodspure :: a0 -> Molten i a b a0 #(<*>) :: Molten i a b (a0 -> b0) -> Molten i a b a0 -> Molten i a b b0 #liftA2 :: (a0 -> b0 -> c) -> Molten i a b a0 -> Molten i a b b0 -> Molten i a b c #(*>) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b b0 #(<*) :: Molten i a b a0 -> Molten i a b b0 -> Molten i a b a0 # Applicative (Bazaar p a b) Instance detailsDefined in Control.Lens.Internal.Bazaar Methodspure :: a0 -> Bazaar p a b a0 #(<*>) :: Bazaar p a b (a0 -> b0) -> Bazaar p a b a0 -> Bazaar p a b b0 #liftA2 :: (a0 -> b0 -> c) -> Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b c #(*>) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b b0 #(<*) :: Bazaar p a b a0 -> Bazaar p a b b0 -> Bazaar p a b a0 # Applicative m => Applicative (ReaderT r m) Instance detailsDefined in Control.Monad.Trans.Reader Methodspure :: a -> ReaderT r m a #(<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b #liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c #(*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #(<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a # Stream s => Applicative (ParsecT e s m) pure returns a parser that succeeds without consuming input. Instance detailsDefined in Text.Megaparsec.Internal Methodspure :: a -> ParsecT e s m a #(<*>) :: ParsecT e s m (a -> b) -> ParsecT e s m a -> ParsecT e s m b #liftA2 :: (a -> b -> c) -> ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m c #(*>) :: ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m b #(<*) :: ParsecT e s m a -> ParsecT e s m b -> ParsecT e s m a # Applicative (ContT r m) Instance detailsDefined in Control.Monad.Trans.Cont Methodspure :: a -> ContT r m a #(<*>) :: ContT r m (a -> b) -> ContT r m a -> ContT r m b #liftA2 :: (a -> b -> c) -> ContT r m a -> ContT r m b -> ContT r m c #(*>) :: ContT r m a -> ContT r m b -> ContT r m b #(<*) :: ContT r m a -> ContT r m b -> ContT r m a # Applicative f => Applicative (M1 i c f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> M1 i c f a #(<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b #liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 #(*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b #(<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a # (Applicative f, Applicative g) => Applicative (f :.: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> (f :.: g) a #(<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b #liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c #(*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b #(<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a # (Applicative f, Applicative g) => Applicative (Compose f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Compose Methodspure :: a -> Compose f g a #(<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b #liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c #(*>) :: Compose f g a -> Compose f g b -> Compose f g b #(<*) :: Compose f g a -> Compose f g b -> Compose f g a # (Monad f, Applicative f) => Applicative (WhenMatched f k x y) Equivalent to  ReaderT k (ReaderT x (ReaderT y (MaybeT f))) Since: containers-0.5.9 Instance detailsDefined in Data.Map.Internal Methodspure :: a -> WhenMatched f k x y a #(<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b #liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c #(*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b #(<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a # Applicative (TakingWhile p f a b) Instance detailsDefined in Control.Lens.Internal.Magma Methodspure :: a0 -> TakingWhile p f a b a0 #(<*>) :: TakingWhile p f a b (a0 -> b0) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 #liftA2 :: (a0 -> b0 -> c) -> TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b c #(*>) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b b0 #(<*) :: TakingWhile p f a b a0 -> TakingWhile p f a b b0 -> TakingWhile p f a b a0 # Applicative (BazaarT p g a b) Instance detailsDefined in Control.Lens.Internal.Bazaar Methodspure :: a0 -> BazaarT p g a b a0 #(<*>) :: BazaarT p g a b (a0 -> b0) -> BazaarT p g a b a0 -> BazaarT p g a b b0 #liftA2 :: (a0 -> b0 -> c) -> BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b c #(*>) :: BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b b0 #(<*) :: BazaarT p g a b a0 -> BazaarT p g a b b0 -> BazaarT p g a b a0 # Instance detailsDefined in Data.Reflection Methodspure :: a -> ReflectedApplicative f s a #(<*>) :: ReflectedApplicative f s (a -> b) -> ReflectedApplicative f s a -> ReflectedApplicative f s b #liftA2 :: (a -> b -> c) -> ReflectedApplicative f s a -> ReflectedApplicative f s b -> ReflectedApplicative f s c #(*>) :: ReflectedApplicative f s a -> ReflectedApplicative f s b -> ReflectedApplicative f s b #(<*) :: ReflectedApplicative f s a -> ReflectedApplicative f s b -> ReflectedApplicative f s a #

between :: Applicative m => m open -> m close -> m a -> m a #

between open close p parses open, followed by p and close. Returns the value returned by p.

braces = between (symbol "{") (symbol "}")

filterM :: Applicative m => (a -> m Bool) -> [a] -> m [a] #

This generalizes the list-based filter function.

forever :: Applicative f => f a -> f b #

forever act repeats the action infinitely.

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

Lift a ternary function to actions.

replicateM :: Applicative m => Int -> m a -> m [a] #

replicateM n act performs the action n times, gathering the results.

replicateM_ :: Applicative m => Int -> m a -> m () #

Like replicateM, but discards the result.

unless :: Applicative f => Bool -> f () -> f () #

The reverse of when.

when :: Applicative f => Bool -> f () -> f () #

Conditional execution of Applicative expressions. For example,

when debug (putStrLn "Debugging")

will output the string Debugging if the Boolean value debug is True, and otherwise do nothing.

zipWithM :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m [c] #

The zipWithM function generalizes zipWith to arbitrary applicative functors.

zipWithM_ :: Applicative m => (a -> b -> m c) -> [a] -> [b] -> m () #

zipWithM_ is the extension of zipWithM which ignores the final result.

# Alternative

class Applicative f => Alternative (f :: * -> *) where #

A monoid on applicative functors.

If defined, some and many should be the least solutions of the equations:

• some v = (:) <$> v <*> many v • many v = some v <|> pure [] Minimal complete definition Methods empty :: f a # The identity of <|> (<|>) :: f a -> f a -> f a infixl 3 # An associative binary operation many :: f a -> f [a] # Zero or more. Instances  Since: base-2.1 Instance detailsDefined in GHC.Base Methodsempty :: [a] #(<|>) :: [a] -> [a] -> [a] #some :: [a] -> [[a]] #many :: [a] -> [[a]] # Since: base-2.1 Instance detailsDefined in GHC.Base Methodsempty :: Maybe a #(<|>) :: Maybe a -> Maybe a -> Maybe a #some :: Maybe a -> Maybe [a] #many :: Maybe a -> Maybe [a] # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodsempty :: IO a #(<|>) :: IO a -> IO a -> IO a #some :: IO a -> IO [a] #many :: IO a -> IO [a] # Instance detailsDefined in Data.Aeson.Types.Internal Methods(<|>) :: IResult a -> IResult a -> IResult a #some :: IResult a -> IResult [a] #many :: IResult a -> IResult [a] # Instance detailsDefined in Data.Aeson.Types.Internal Methodsempty :: Result a #(<|>) :: Result a -> Result a -> Result a #some :: Result a -> Result [a] #many :: Result a -> Result [a] # Instance detailsDefined in Data.Aeson.Types.Internal Methodsempty :: Parser a #(<|>) :: Parser a -> Parser a -> Parser a #some :: Parser a -> Parser [a] #many :: Parser a -> Parser [a] # Instance detailsDefined in Control.Concurrent.Async Methods(<|>) :: Concurrently a -> Concurrently a -> Concurrently a #some :: Concurrently a -> Concurrently [a] #many :: Concurrently a -> Concurrently [a] # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsempty :: Option a #(<|>) :: Option a -> Option a -> Option a #some :: Option a -> Option [a] #many :: Option a -> Option [a] # Since: base-4.11.0.0 Instance detailsDefined in Control.Applicative Methods(<|>) :: ZipList a -> ZipList a -> ZipList a #some :: ZipList a -> ZipList [a] #many :: ZipList a -> ZipList [a] # Since: base-4.8.0.0 Instance detailsDefined in GHC.Conc.Sync Methodsempty :: STM a #(<|>) :: STM a -> STM a -> STM a #some :: STM a -> STM [a] #many :: STM a -> STM [a] # Since: base-4.6.0.0 Instance detailsDefined in Text.ParserCombinators.ReadPrec Methods(<|>) :: ReadPrec a -> ReadPrec a -> ReadPrec a #some :: ReadPrec a -> ReadPrec [a] #many :: ReadPrec a -> ReadPrec [a] # Since: base-4.6.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methodsempty :: ReadP a #(<|>) :: ReadP a -> ReadP a -> ReadP a #some :: ReadP a -> ReadP [a] #many :: ReadP a -> ReadP [a] # Since: containers-0.5.4 Instance detailsDefined in Data.Sequence.Internal Methodsempty :: Seq a #(<|>) :: Seq a -> Seq a -> Seq a #some :: Seq a -> Seq [a] #many :: Seq a -> Seq [a] # Instance detailsDefined in Data.DList Methodsempty :: DList a #(<|>) :: DList a -> DList a -> DList a #some :: DList a -> DList [a] #many :: DList a -> DList [a] # Instance detailsDefined in Data.Vector Methodsempty :: Vector a #(<|>) :: Vector a -> Vector a -> Vector a #some :: Vector a -> Vector [a] #many :: Vector a -> Vector [a] # Instance detailsDefined in Options.Applicative.Types Methodsempty :: ReadM a #(<|>) :: ReadM a -> ReadM a -> ReadM a #some :: ReadM a -> ReadM [a] #many :: ReadM a -> ReadM [a] # Instance detailsDefined in Options.Applicative.Types Methodsempty :: Parser a #(<|>) :: Parser a -> Parser a -> Parser a #some :: Parser a -> Parser [a] #many :: Parser a -> Parser [a] # Instance detailsDefined in Data.Primitive.SmallArray Methods(<|>) :: SmallArray a -> SmallArray a -> SmallArray a #some :: SmallArray a -> SmallArray [a] #many :: SmallArray a -> SmallArray [a] # Instance detailsDefined in Data.Primitive.Array Methodsempty :: Array a #(<|>) :: Array a -> Array a -> Array a #some :: Array a -> Array [a] #many :: Array a -> Array [a] # Instance details Methods(<|>) :: Element a -> Element a -> Element a #some :: Element a -> Element [a] #many :: Element a -> Element [a] # Since: base-4.5.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methodsempty :: P a #(<|>) :: P a -> P a -> P a #some :: P a -> P [a] #many :: P a -> P [a] # () :=> (Alternative []) Instance detailsDefined in Data.Constraint Methodsins :: () :- Alternative [] # Instance detailsDefined in Data.Constraint Methods Alternative (U1 :: * -> *) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsempty :: U1 a #(<|>) :: U1 a -> U1 a -> U1 a #some :: U1 a -> U1 [a] #many :: U1 a -> U1 [a] # Instance detailsDefined in Text.Earley.Parser.Internal Methodsempty :: Results s a #(<|>) :: Results s a -> Results s a -> Results s a #some :: Results s a -> Results s [a] #many :: Results s a -> Results s [a] # Since: base-2.1 Instance detailsDefined in Control.Applicative Methodsempty :: WrappedMonad m a #(<|>) :: WrappedMonad m a -> WrappedMonad m a -> WrappedMonad m a #some :: WrappedMonad m a -> WrappedMonad m [a] #many :: WrappedMonad m a -> WrappedMonad m [a] # Since: base-4.6.0.0 Instance detailsDefined in Control.Arrow Methodsempty :: ArrowMonad a a0 #(<|>) :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 #some :: ArrowMonad a a0 -> ArrowMonad a [a0] #many :: ArrowMonad a a0 -> ArrowMonad a [a0] # Alternative (Proxy :: * -> *) Since: base-4.9.0.0 Instance detailsDefined in Data.Proxy Methodsempty :: Proxy a #(<|>) :: Proxy a -> Proxy a -> Proxy a #some :: Proxy a -> Proxy [a] #many :: Proxy a -> Proxy [a] # (Functor m, Monad m) => Alternative (MaybeT m) Instance detailsDefined in Control.Monad.Trans.Maybe Methodsempty :: MaybeT m a #(<|>) :: MaybeT m a -> MaybeT m a -> MaybeT m a #some :: MaybeT m a -> MaybeT m [a] #many :: MaybeT m a -> MaybeT m [a] # Alternative v => Alternative (Free v) This violates the Alternative laws, handle with care. Instance detailsDefined in Control.Monad.Free Methodsempty :: Free v a #(<|>) :: Free v a -> Free v a -> Free v a #some :: Free v a -> Free v [a] #many :: Free v a -> Free v [a] # Alternative f => Alternative (Yoneda f) Instance detailsDefined in Data.Functor.Yoneda Methodsempty :: Yoneda f a #(<|>) :: Yoneda f a -> Yoneda f a -> Yoneda f a #some :: Yoneda f a -> Yoneda f [a] #many :: Yoneda f a -> Yoneda f [a] # Instance detailsDefined in Control.Lens.Reified Methodsempty :: ReifiedFold s a #(<|>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #some :: ReifiedFold s a -> ReifiedFold s [a] #many :: ReifiedFold s a -> ReifiedFold s [a] # Monad m => Alternative (ListT m) Instance detailsDefined in List.Transformer Methodsempty :: ListT m a #(<|>) :: ListT m a -> ListT m a -> ListT m a #some :: ListT m a -> ListT m [a] #many :: ListT m a -> ListT m [a] # Instance detailsDefined in Control.Monad.Logic Methodsempty :: LogicT f a #(<|>) :: LogicT f a -> LogicT f a -> LogicT f a #some :: LogicT f a -> LogicT f [a] #many :: LogicT f a -> LogicT f [a] # Instance detailsDefined in Data.Functor.Bind.Class Methods(<|>) :: WrappedApplicative f a -> WrappedApplicative f a -> WrappedApplicative f a #some :: WrappedApplicative f a -> WrappedApplicative f [a] #many :: WrappedApplicative f a -> WrappedApplicative f [a] # Since: unliftio-0.1.0.0 Instance detailsDefined in UnliftIO.Async Methodsempty :: Concurrently m a #(<|>) :: Concurrently m a -> Concurrently m a -> Concurrently m a #some :: Concurrently m a -> Concurrently m [a] #many :: Concurrently m a -> Concurrently m [a] # Alternative f => Alternative (AltSum f) Instance detailsDefined in Control.Compactable Methodsempty :: AltSum f a #(<|>) :: AltSum f a -> AltSum f a -> AltSum f a #some :: AltSum f a -> AltSum f [a] #many :: AltSum f a -> AltSum f [a] # Class (Applicative f) (Alternative f) Instance detailsDefined in Data.Constraint Methods Instance detailsDefined in Data.Constraint Methods Alternative f => Alternative (Rec1 f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsempty :: Rec1 f a #(<|>) :: Rec1 f a -> Rec1 f a -> Rec1 f a #some :: Rec1 f a -> Rec1 f [a] #many :: Rec1 f a -> Rec1 f [a] # Alternative (Results t s) Instance detailsDefined in Text.Earley.Generator.Internal Methodsempty :: Results t s a #(<|>) :: Results t s a -> Results t s a -> Results t s a #some :: Results t s a -> Results t s [a] #many :: Results t s a -> Results t s [a] # (ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b) Since: base-2.1 Instance detailsDefined in Control.Applicative Methodsempty :: WrappedArrow a b a0 #(<|>) :: WrappedArrow a b a0 -> WrappedArrow a b a0 -> WrappedArrow a b a0 #some :: WrappedArrow a b a0 -> WrappedArrow a b [a0] #many :: WrappedArrow a b a0 -> WrappedArrow a b [a0] # Alternative f => Alternative (Alt f) Instance detailsDefined in Data.Semigroup.Internal Methodsempty :: Alt f a #(<|>) :: Alt f a -> Alt f a -> Alt f a #some :: Alt f a -> Alt f [a] #many :: Alt f a -> Alt f [a] # Instance detailsDefined in Control.Monad.Trans.Identity Methodsempty :: IdentityT m a #(<|>) :: IdentityT m a -> IdentityT m a -> IdentityT m a #some :: IdentityT m a -> IdentityT m [a] #many :: IdentityT m a -> IdentityT m [a] # (Functor m, Monad m, Monoid e) => Alternative (ExceptT e m) Instance detailsDefined in Control.Monad.Trans.Except Methodsempty :: ExceptT e m a #(<|>) :: ExceptT e m a -> ExceptT e m a -> ExceptT e m a #some :: ExceptT e m a -> ExceptT e m [a] #many :: ExceptT e m a -> ExceptT e m [a] # (Functor f, MonadPlus m) => Alternative (FreeT f m) Instance detailsDefined in Control.Monad.Trans.Free Methodsempty :: FreeT f m a #(<|>) :: FreeT f m a -> FreeT f m a -> FreeT f m a #some :: FreeT f m a -> FreeT f m [a] #many :: FreeT f m a -> FreeT f m [a] # (Functor m, Monad m, Error e) => Alternative (ErrorT e m) Instance detailsDefined in Control.Monad.Trans.Error Methodsempty :: ErrorT e m a #(<|>) :: ErrorT e m a -> ErrorT e m a -> ErrorT e m a #some :: ErrorT e m a -> ErrorT e m [a] #many :: ErrorT e m a -> ErrorT e m [a] # Try alternatives in the same order as f. Instance detailsDefined in Control.Applicative.Backwards Methodsempty :: Backwards f a #(<|>) :: Backwards f a -> Backwards f a -> Backwards f a #some :: Backwards f a -> Backwards f [a] #many :: Backwards f a -> Backwards f [a] # (Functor m, MonadPlus m) => Alternative (StateT s m) Instance detailsDefined in Control.Monad.Trans.State.Lazy Methodsempty :: StateT s m a #(<|>) :: StateT s m a -> StateT s m a -> StateT s m a #some :: StateT s m a -> StateT s m [a] #many :: StateT s m a -> StateT s m [a] # (Functor m, MonadPlus m) => Alternative (StateT s m) Instance detailsDefined in Control.Monad.Trans.State.Strict Methodsempty :: StateT s m a #(<|>) :: StateT s m a -> StateT s m a -> StateT s m a #some :: StateT s m a -> StateT s m [a] #many :: StateT s m a -> StateT s m [a] # (Profunctor p, ArrowPlus p) => Alternative (Closure p a) Instance detailsDefined in Data.Profunctor.Closed Methodsempty :: Closure p a a0 #(<|>) :: Closure p a a0 -> Closure p a a0 -> Closure p a a0 #some :: Closure p a a0 -> Closure p a [a0] #many :: Closure p a a0 -> Closure p a [a0] # (Profunctor p, ArrowPlus p) => Alternative (Tambara p a) Instance detailsDefined in Data.Profunctor.Strong Methodsempty :: Tambara p a a0 #(<|>) :: Tambara p a a0 -> Tambara p a a0 -> Tambara p a a0 #some :: Tambara p a a0 -> Tambara p a [a0] #many :: Tambara p a a0 -> Tambara p a [a0] # Alternative f => Alternative (Star f a) Instance detailsDefined in Data.Profunctor.Types Methodsempty :: Star f a a0 #(<|>) :: Star f a a0 -> Star f a a0 -> Star f a a0 #some :: Star f a a0 -> Star f a [a0] #many :: Star f a a0 -> Star f a [a0] # (Functor m, MonadPlus m) => Alternative (WriterT w m) Instance detailsDefined in Control.Monad.Trans.Writer.CPS.Internal Methodsempty :: WriterT w m a #(<|>) :: WriterT w m a -> WriterT w m a -> WriterT w m a #some :: WriterT w m a -> WriterT w m [a] #many :: WriterT w m a -> WriterT w m [a] # Class (Monad f, Alternative f) (MonadPlus f) Instance detailsDefined in Data.Constraint Methodscls :: MonadPlus f :- (Monad f, Alternative f) # (Alternative f, Alternative g) => Alternative (f :*: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsempty :: (f :*: g) a #(<|>) :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a #some :: (f :*: g) a -> (f :*: g) [a] #many :: (f :*: g) a -> (f :*: g) [a] # Alternative (Prod r e t) Instance detailsDefined in Text.Earley.Grammar Methodsempty :: Prod r e t a #(<|>) :: Prod r e t a -> Prod r e t a -> Prod r e t a #some :: Prod r e t a -> Prod r e t [a] #many :: Prod r e t a -> Prod r e t [a] # (Alternative f, Alternative g) => Alternative (Product f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methodsempty :: Product f g a #(<|>) :: Product f g a -> Product f g a -> Product f g a #some :: Product f g a -> Product f g [a] #many :: Product f g a -> Product f g [a] # Alternative m => Alternative (ReaderT r m) Instance detailsDefined in Control.Monad.Trans.Reader Methodsempty :: ReaderT r m a #(<|>) :: ReaderT r m a -> ReaderT r m a -> ReaderT r m a #some :: ReaderT r m a -> ReaderT r m [a] #many :: ReaderT r m a -> ReaderT r m [a] # (Ord e, Stream s) => Alternative (ParsecT e s m) empty is a parser that fails without consuming input. Instance detailsDefined in Text.Megaparsec.Internal Methodsempty :: ParsecT e s m a #(<|>) :: ParsecT e s m a -> ParsecT e s m a -> ParsecT e s m a #some :: ParsecT e s m a -> ParsecT e s m [a] #many :: ParsecT e s m a -> ParsecT e s m [a] # Alternative f => Alternative (M1 i c f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsempty :: M1 i c f a #(<|>) :: M1 i c f a -> M1 i c f a -> M1 i c f a #some :: M1 i c f a -> M1 i c f [a] #many :: M1 i c f a -> M1 i c f [a] # (Alternative f, Applicative g) => Alternative (f :.: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsempty :: (f :.: g) a #(<|>) :: (f :.: g) a -> (f :.: g) a -> (f :.: g) a #some :: (f :.: g) a -> (f :.: g) [a] #many :: (f :.: g) a -> (f :.: g) [a] # (Alternative f, Applicative g) => Alternative (Compose f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Compose Methodsempty :: Compose f g a #(<|>) :: Compose f g a -> Compose f g a -> Compose f g a #some :: Compose f g a -> Compose f g [a] #many :: Compose f g a -> Compose f g [a] # endBy :: Alternative m => m a -> m sep -> m [a] # endBy p sep parses zero or more occurrences of p, separated and ended by sep. Returns a list of values returned by p. cStatements = cStatement endBy semicolon endBy1 :: Alternative m => m a -> m sep -> m (NonEmpty a) # endBy1 p sep parses one or more occurrences of p, separated and ended by sep. Returns a non-empty list of values returned by p. guard :: Alternative f => Bool -> f () # Conditional failure of Alternative computations. Defined by guard True = pure () guard False = empty  #### Examples Expand Common uses of guard include conditionally signaling an error in an error monad and conditionally rejecting the current choice in an Alternative-based parser. As an example of signaling an error in the error monad Maybe, consider a safe division function safeDiv x y that returns Nothing when the denominator y is zero and Just (x div y) otherwise. For example: >>> safeDiv 4 0 Nothing >>> safeDiv 4 2 Just 2  A definition of safeDiv using guards, but not guard: safeDiv :: Int -> Int -> Maybe Int safeDiv x y | y /= 0 = Just (x div y) | otherwise = Nothing  A definition of safeDiv using guard and Monad do-notation: safeDiv :: Int -> Int -> Maybe Int safeDiv x y = do guard (y /= 0) return (x div y)  manyTill :: Alternative m => m a -> m end -> m [a] # manyTill p end applies parser p zero or more times until parser end succeeds. Returns the list of values returned by p. See also: skipMany, skipManyTill. optional :: (Alt f, Applicative f) => f a -> f (Maybe a) # One or none. sepBy :: Alternative m => m a -> m sep -> m [a] # sepBy p sep parses zero or more occurrences of p, separated by sep. Returns a list of values returned by p. commaSep p = p sepBy comma sepEndBy :: Alternative m => m a -> m sep -> m [a] # sepEndBy p sep parses zero or more occurrences of p, separated and optionally ended by sep. Returns a list of values returned by p. sepBy1 :: Alternative m => m a -> m sep -> m (NonEmpty a) # sepBy1 p sep parses one or more occurrences of p, separated by sep. Returns a non-empty list of values returned by p. sepEndBy1 :: Alternative m => m a -> m sep -> m (NonEmpty a) # sepEndBy1 p sep parses one or more occurrences of p, separated and optionally ended by sep. Returns a non-empty list of values returned by p. skipMany :: Alternative m => m a -> m () # skipMany p applies the parser p zero or more times, skipping its result. See also: manyTill, skipManyTill. skipManyTill :: Alternative m => m a -> m end -> m end # skipManyTill p end applies the parser p zero or more times skipping results until parser end succeeds. Result parsed by end is then returned. See also: manyTill, skipMany. skipSome :: Alternative m => m a -> m () # skipSome p applies the parser p one or more times, skipping its result. See also: someTill, skipSomeTill. skipSomeTill :: Alternative m => m a -> m end -> m end # skipSomeTill p end applies the parser p one or more times skipping results until parser end succeeds. Result parsed by end is then returned. See also: someTill, skipSome. some1 :: Alternative f => f a -> f (NonEmpty a) # some1 x sequences x one or more times. someTill :: Alternative m => m a -> m end -> m (NonEmpty a) # someTill p end works similarly to manyTill p end, but p should succeed at least once. See also: skipSome, skipSomeTill. ## Newtypes newtype Alt (f :: k -> *) (a :: k) :: forall k. (k -> *) -> k -> * # Monoid under <|>. Since: base-4.8.0.0 Constructors  Alt FieldsgetAlt :: f a Instances  Generic1 (Alt f :: k -> *) Instance detailsDefined in Data.Semigroup.Internal Associated Typestype Rep1 (Alt f) :: k -> * # Methodsfrom1 :: Alt f a -> Rep1 (Alt f) a #to1 :: Rep1 (Alt f) a -> Alt f a # Monad f => Monad (Alt f) Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Alt f a -> (a -> Alt f b) -> Alt f b #(>>) :: Alt f a -> Alt f b -> Alt f b #return :: a -> Alt f a #fail :: String -> Alt f a # Functor f => Functor (Alt f) Instance detailsDefined in Data.Semigroup.Internal Methodsfmap :: (a -> b) -> Alt f a -> Alt f b #(<$) :: a -> Alt f b -> Alt f a # MonadFix f => MonadFix (Alt f) Since: base-4.8.0.0 Instance detailsDefined in Control.Monad.Fix Methodsmfix :: (a -> Alt f a) -> Alt f a # Applicative f => Applicative (Alt f) Instance detailsDefined in Data.Semigroup.Internal Methodspure :: a -> Alt f a #(<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b #liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c #(*>) :: Alt f a -> Alt f b -> Alt f b #(<*) :: Alt f a -> Alt f b -> Alt f a # Alternative f => Alternative (Alt f) Instance detailsDefined in Data.Semigroup.Internal Methodsempty :: Alt f a #(<|>) :: Alt f a -> Alt f a -> Alt f a #some :: Alt f a -> Alt f [a] #many :: Alt f a -> Alt f [a] # Instance detailsDefined in Data.Functor.Contravariant Methodscontramap :: (a -> b) -> Alt f b -> Alt f a #(>$) :: b -> Alt f b -> Alt f a # MonadPlus f => MonadPlus (Alt f) Instance detailsDefined in Data.Semigroup.Internal Methodsmzero :: Alt f a #mplus :: Alt f a -> Alt f a -> Alt f a # MonadZip f => MonadZip (Alt f) Since: base-4.8.0.0 Instance detailsDefined in Control.Monad.Zip Methodsmzip :: Alt f a -> Alt f b -> Alt f (a, b) #mzipWith :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c #munzip :: Alt f (a, b) -> (Alt f a, Alt f b) # Functor a => Compactable (Alt a) Instance detailsDefined in Control.Compactable Methodscompact :: Alt a (Maybe a0) -> Alt a a0 #separate :: Alt a (Either l r) -> (Alt a l, Alt a r) #filter :: (a0 -> Bool) -> Alt a a0 -> Alt a a0 #partition :: (a0 -> Bool) -> Alt a a0 -> (Alt a a0, Alt a a0) #fmapMaybe :: Functor (Alt a) => (a0 -> Maybe b) -> Alt a a0 -> Alt a b #fmapEither :: Functor (Alt a) => (a0 -> Either l r) -> Alt a a0 -> (Alt a l, Alt a r) #applyMaybe :: Applicative (Alt a) => Alt a (a0 -> Maybe b) -> Alt a a0 -> Alt a b #applyEither :: Applicative (Alt a) => Alt a (a0 -> Either l r) -> Alt a a0 -> (Alt a l, Alt a r) #bindMaybe :: Monad (Alt a) => Alt a a0 -> (a0 -> Alt a (Maybe b)) -> Alt a b #bindEither :: Monad (Alt a) => Alt a a0 -> (a0 -> Alt a (Either l r)) -> (Alt a l, Alt a r) #traverseMaybe :: (Applicative g, Traversable (Alt a)) => (a0 -> g (Maybe b)) -> Alt a a0 -> g (Alt a b) #traverseEither :: (Applicative g, Traversable (Alt a)) => (a0 -> g (Either l r)) -> Alt a a0 -> g (Alt a l, Alt a r) # (Alternative a, Monad a) => CompactFold (Alt a) Instance detailsDefined in Control.Compactable MethodscompactFold :: Foldable g => Alt a (g a0) -> Alt a a0 #separateFold :: Bifoldable g => Alt a (g a0 b) -> (Alt a a0, Alt a b) #fmapFold :: (Functor (Alt a), Foldable g) => (a0 -> g b) -> Alt a a0 -> Alt a b #fmapBifold :: (Functor (Alt a), Bifoldable g) => (a0 -> g l r) -> Alt a a0 -> (Alt a l, Alt a r) #applyFold :: (Applicative (Alt a), Foldable g) => Alt a (a0 -> g b) -> Alt a a0 -> Alt a b #applyBifold :: (Applicative (Alt a), Bifoldable g) => Alt a (a0 -> g l r) -> Alt a a0 -> (Alt a l, Alt a r) #bindFold :: (Monad (Alt a), Foldable g) => Alt a a0 -> (a0 -> Alt a (g b)) -> Alt a b #bindBifold :: (Monad (Alt a), Bifoldable g) => Alt a a0 -> (a0 -> Alt a (g l r)) -> (Alt a l, Alt a r) #traverseFold :: (Applicative h, Foldable g, Traversable (Alt a)) => (a0 -> h (g b)) -> Alt a a0 -> h (Alt a b) #traverseBifold :: (Applicative h, Bifoldable g, Traversable (Alt a)) => (a0 -> h (g l r)) -> Alt a a0 -> h (Alt a l, Alt a r) # Divisible f => Divisible (Alt f) Instance detailsDefined in Data.Functor.Contravariant.Divisible Methodsdivide :: (a -> (b, c)) -> Alt f b -> Alt f c -> Alt f a #conquer :: Alt f a # Decidable f => Decidable (Alt f) Instance detailsDefined in Data.Functor.Contravariant.Divisible Methodslose :: (a -> Void) -> Alt f a #choose :: (a -> Either b c) -> Alt f b -> Alt f c -> Alt f a # Apply f => Apply (Alt f) Instance detailsDefined in Data.Functor.Bind.Class Methods(<.>) :: Alt f (a -> b) -> Alt f a -> Alt f b #(.>) :: Alt f a -> Alt f b -> Alt f b #(<.) :: Alt f a -> Alt f b -> Alt f a #liftF2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c # Traversable1 f => Traversable1 (Alt f) Instance detailsDefined in Data.Semigroup.Traversable.Class Methodstraverse1 :: Apply f0 => (a -> f0 b) -> Alt f a -> f0 (Alt f b) #sequence1 :: Apply f0 => Alt f (f0 b) -> f0 (Alt f b) # Foldable1 f => Foldable1 (Alt f) Instance detailsDefined in Data.Semigroup.Foldable.Class Methodsfold1 :: Semigroup m => Alt f m -> m #foldMap1 :: Semigroup m => (a -> m) -> Alt f a -> m #toNonEmpty :: Alt f a -> NonEmpty a # Bind f => Bind (Alt f) Instance detailsDefined in Data.Functor.Bind.Class Methods(>>-) :: Alt f a -> (a -> Alt f b) -> Alt f b #join :: Alt f (Alt f a) -> Alt f a # Extend f => Extend (Alt f) Instance detailsDefined in Data.Functor.Extend Methodsduplicated :: Alt f a -> Alt f (Alt f a) #extended :: (Alt f a -> b) -> Alt f a -> Alt f b # Enum (f a) => Enum (Alt f a) Instance detailsDefined in Data.Semigroup.Internal Methodssucc :: Alt f a -> Alt f a #pred :: Alt f a -> Alt f a #toEnum :: Int -> Alt f a #fromEnum :: Alt f a -> Int #enumFrom :: Alt f a -> [Alt f a] #enumFromThen :: Alt f a -> Alt f a -> [Alt f a] #enumFromTo :: Alt f a -> Alt f a -> [Alt f a] #enumFromThenTo :: Alt f a -> Alt f a -> Alt f a -> [Alt f a] # Eq (f a) => Eq (Alt f a) Instance detailsDefined in Data.Semigroup.Internal Methods(==) :: Alt f a -> Alt f a -> Bool #(/=) :: Alt f a -> Alt f a -> Bool # (Data (f a), Data a, Typeable f) => Data (Alt f a) Since: base-4.8.0.0 Instance detailsDefined in Data.Data Methodsgfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Alt f a -> c (Alt f a) #gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Alt f a) #toConstr :: Alt f a -> Constr #dataTypeOf :: Alt f a -> DataType #dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Alt f a)) #dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Alt f a)) #gmapT :: (forall b. Data b => b -> b) -> Alt f a -> Alt f a #gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Alt f a -> r #gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Alt f a -> r #gmapQ :: (forall d. Data d => d -> u) -> Alt f a -> [u] #gmapQi :: Int -> (forall d. Data d => d -> u) -> Alt f a -> u #gmapM :: Monad m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) #gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) #gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Alt f a -> m (Alt f a) # Num (f a) => Num (Alt f a) Instance detailsDefined in Data.Semigroup.Internal Methods(+) :: Alt f a -> Alt f a -> Alt f a #(-) :: Alt f a -> Alt f a -> Alt f a #(*) :: Alt f a -> Alt f a -> Alt f a #negate :: Alt f a -> Alt f a #abs :: Alt f a -> Alt f a #signum :: Alt f a -> Alt f a #fromInteger :: Integer -> Alt f a # Ord (f a) => Ord (Alt f a) Instance detailsDefined in Data.Semigroup.Internal Methodscompare :: Alt f a -> Alt f a -> Ordering #(<) :: Alt f a -> Alt f a -> Bool #(<=) :: Alt f a -> Alt f a -> Bool #(>) :: Alt f a -> Alt f a -> Bool #(>=) :: Alt f a -> Alt f a -> Bool #max :: Alt f a -> Alt f a -> Alt f a #min :: Alt f a -> Alt f a -> Alt f a # Read (f a) => Read (Alt f a) Instance detailsDefined in Data.Semigroup.Internal MethodsreadsPrec :: Int -> ReadS (Alt f a) #readList :: ReadS [Alt f a] #readPrec :: ReadPrec (Alt f a) #readListPrec :: ReadPrec [Alt f a] # Show (f a) => Show (Alt f a) Instance detailsDefined in Data.Semigroup.Internal MethodsshowsPrec :: Int -> Alt f a -> ShowS #show :: Alt f a -> String #showList :: [Alt f a] -> ShowS # Generic (Alt f a) Instance detailsDefined in Data.Semigroup.Internal Associated Typestype Rep (Alt f a) :: * -> * # Methodsfrom :: Alt f a -> Rep (Alt f a) x #to :: Rep (Alt f a) x -> Alt f a # Alternative f => Semigroup (Alt f a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(<>) :: Alt f a -> Alt f a -> Alt f a #sconcat :: NonEmpty (Alt f a) -> Alt f a #stimes :: Integral b => b -> Alt f a -> Alt f a # Alternative f => Monoid (Alt f a) Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodsmempty :: Alt f a #mappend :: Alt f a -> Alt f a -> Alt f a #mconcat :: [Alt f a] -> Alt f a # Wrapped (Alt f a) Instance detailsDefined in Control.Lens.Wrapped Associated Typestype Unwrapped (Alt f a) :: * # Methods_Wrapped' :: Iso' (Alt f a) (Unwrapped (Alt f a)) # Serialise (f a) => Serialise (Alt f a) Since: serialise-0.2.0.0 Instance detailsDefined in Codec.Serialise.Class Methodsencode :: Alt f a -> Encoding #decode :: Decoder s (Alt f a) #encodeList :: [Alt f a] -> Encoding #decodeList :: Decoder s [Alt f a] # t ~ Alt g b => Rewrapped (Alt f a) t Instance detailsDefined in Control.Lens.Wrapped type Rep1 (Alt f :: k -> *) Instance detailsDefined in Data.Semigroup.Internal type Rep1 (Alt f :: k -> *) = D1 (MetaData "Alt" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Alt" PrefixI True) (S1 (MetaSel (Just "getAlt") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec1 f))) type Rep (Alt f a) Instance detailsDefined in Data.Semigroup.Internal type Rep (Alt f a) = D1 (MetaData "Alt" "Data.Semigroup.Internal" "base" True) (C1 (MetaCons "Alt" PrefixI True) (S1 (MetaSel (Just "getAlt") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 (f a)))) type Unwrapped (Alt f a) Instance detailsDefined in Control.Lens.Wrapped type Unwrapped (Alt f a) = f a # Free applicative data Ap (f :: * -> *) a where # The free Applicative for a Functor f. Constructors  Pure :: Ap f a Ap :: Ap f a Instances  Functor (Ap f) Instance detailsDefined in Control.Applicative.Free Methodsfmap :: (a -> b) -> Ap f a -> Ap f b #(<$) :: a -> Ap f b -> Ap f a # Instance detailsDefined in Control.Applicative.Free Methodspure :: a -> Ap f a #(<*>) :: Ap f (a -> b) -> Ap f a -> Ap f b #liftA2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c #(*>) :: Ap f a -> Ap f b -> Ap f b #(<*) :: Ap f a -> Ap f b -> Ap f a # Comonad f => Comonad (Ap f) Instance detailsDefined in Control.Applicative.Free Methodsextract :: Ap f a -> a #duplicate :: Ap f a -> Ap f (Ap f a) #extend :: (Ap f a -> b) -> Ap f a -> Ap f b # Apply (Ap f) Instance detailsDefined in Control.Applicative.Free Methods(<.>) :: Ap f (a -> b) -> Ap f a -> Ap f b #(.>) :: Ap f a -> Ap f b -> Ap f b #(<.) :: Ap f a -> Ap f b -> Ap f a #liftF2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c #

runAp :: Applicative g => (forall x. f x -> g x) -> Ap f a -> g a #

Given a natural transformation from f to g, this gives a canonical monoidal natural transformation from Ap f to g.

runAp t == retractApp . hoistApp t

runAp_ :: Monoid m => (forall a. f a -> m) -> Ap f b -> m #

Perform a monoidal analysis over free applicative value.

Example:

count :: Ap f a -> Int
count = getSum . runAp_ (\_ -> Sum 1)


liftAp :: f a -> Ap f a #

A version of lift that can be used with just a Functor for f.

iterAp :: Functor g => (g a -> a) -> Ap g a -> a #

Tear down a free Applicative using iteration.

hoistAp :: (forall a. f a -> g a) -> Ap f b -> Ap g b #

Given a natural transformation from f to g this gives a monoidal natural transformation from Ap f to Ap g.

retractAp :: Applicative f => Ap f a -> f a #

Interprets the free applicative functor over f using the semantics for pure and <*> given by the Applicative instance for f.

retractApp == runAp id