clash-lib-0.99.2: CAES Language for Synchronous Hardware - As a Library

Clash.Util

Description

Assortment of utility function used in the Clash library

Synopsis

# Documentation

class MonadUnique m where Source #

A class that can generate unique numbers

Minimal complete definition

getUniqueM

Methods

Get a new unique

Instances
 MonadUnique (RewriteMonad extra) Source # Instance detailsDefined in Clash.Rewrite.Types Methods Monad m => MonadUnique (StateT Int m) Source # Instance detailsDefined in Clash.Util Methods

Create a TH expression that returns the a formatted string containing the name of the module curLoc is spliced into, and the line where it was spliced.

Arguments

 :: (MonadState s m, Hashable k, Eq k) => k The key the action is associated with -> Lens' s (HashMap k v) The Lens to the HashMap that is the cache -> m v The action to cache -> m v

Cache the result of a monadic action

Arguments

 :: (MonadTrans t2, MonadTrans t1, MonadTrans t, Eq k, Hashable k, MonadState s m, Monad (t2 m), Monad (t1 (t2 m)), Monad (t (t1 (t2 m)))) => k The key the action is associated with -> Lens' s (HashMap k v) The Lens to the HashMap that is the cache -> t (t1 (t2 m)) v The action to cache -> t (t1 (t2 m)) v

Cache the result of a monadic action in a State 3 transformer layers down

makeCachedT3S :: (MonadTrans t2, MonadTrans t1, MonadTrans t, Eq k, Hashable k, MonadState s m, Monad (t2 m), Monad (t1 (t2 m)), Monad (t (t1 (t2 m))), NFData v) => k -> Lens' s (HashMap k v) -> t (t1 (t2 m)) v -> t (t1 (t2 m)) v Source #

Spine-strict cache variant of mkCachedT3

Arguments

 :: MonadState s m => Lens' s s' Lens to the State in the higher-layer monad -> State s' a The State-action to perform -> m a

Run a State-action using the State that is stored in a higher-layer Monad

firstM :: Functor f => (a -> f c) -> (a, b) -> f (c, b) Source #

Functorial version of first

secondM :: Functor f => (b -> f c) -> (a, b) -> f (a, c) Source #

Functorial version of second

combineM :: Applicative f => (a -> f b) -> (c -> f d) -> (a, c) -> f (b, d) Source #

traceIf :: Bool -> String -> a -> a Source #

Performs trace when first argument evaluates to True

partitionM :: Monad m => (a -> m Bool) -> [a] -> m ([a], [a]) Source #

Monadic version of partition

mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y]) Source #

Monadic version of mapAccumL

dot :: (c -> d) -> (a -> b -> c) -> a -> b -> d Source #

Composition of a unary function with a binary function

ifThenElse :: (a -> Bool) -> (a -> b) -> (a -> b) -> a -> b Source #

if-then-else as a function on an argument

(<:>) :: Applicative f => f a -> f [a] -> f [a] infixr 5 Source #

Applicative version of 'GHC.Types.(:)'

indexMaybe :: [a] -> Int -> Maybe a Source #

Safe indexing, returns a Nothing if the index does not exist

indexNote :: String -> [a] -> Int -> a Source #

Unsafe indexing, return a custom error message when indexing fails

splitAtList :: [b] -> [a] -> ([a], [a]) Source #

Split the second list at the length of the first list

x y -> floor (logBase x y), x > 1 && y > 0

x y -> ceiling (logBase x y), x > 1 && y > 0

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. 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 # 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 # 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 Parser Instance detailsDefined in Text.Trifecta.Parser 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 # Applicative Result Instance detailsDefined in Text.Trifecta.Result 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.Vector.Fusion.Util Methodspure :: a -> Id a #(<*>) :: Id (a -> b) -> Id a -> Id b #liftA2 :: (a -> b -> c) -> Id a -> Id b -> Id c #(*>) :: Id a -> Id b -> Id b #(<*) :: Id a -> Id b -> Id a # Applicative Box Instance detailsDefined in Data.Vector.Fusion.Util Methodspure :: a -> Box a #(<*>) :: Box (a -> b) -> Box a -> Box b #liftA2 :: (a -> b -> c) -> Box a -> Box b -> Box c #(*>) :: Box a -> Box b -> Box b #(<*) :: Box a -> Box b -> Box a # Applicative Result 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 # Applicative IResult 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 # Applicative Parser 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 # Applicative Vector 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 # Applicative DList 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 # Applicative Array 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 # # Instance detailsDefined in Clash.Netlist.Types Methodspure :: a -> NetlistMonad a #(<*>) :: NetlistMonad (a -> b) -> NetlistMonad a -> NetlistMonad b #liftA2 :: (a -> b -> c) -> NetlistMonad a -> NetlistMonad b -> NetlistMonad c #(*>) :: NetlistMonad a -> NetlistMonad b -> NetlistMonad b #(<*) :: NetlistMonad a -> NetlistMonad b -> NetlistMonad 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 # 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 # Applicative m => Applicative (ListT m) Instance detailsDefined in Control.Monad.Trans.List 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 # Applicative (Parser i) Instance detailsDefined in Data.Attoparsec.Internal.Types Methodspure :: a -> Parser i a #(<*>) :: Parser i (a -> b) -> Parser i a -> Parser i b #liftA2 :: (a -> b -> c) -> Parser i a -> Parser i b -> Parser i c #(*>) :: Parser i a -> Parser i b -> Parser i b #(<*) :: Parser i a -> Parser i b -> Parser i a # Applicative m => Applicative (Unhighlighted m) Instance detailsDefined in Text.Parser.Token Methodspure :: a -> Unhighlighted m a #(<*>) :: Unhighlighted m (a -> b) -> Unhighlighted m a -> Unhighlighted m b #liftA2 :: (a -> b -> c) -> Unhighlighted m a -> Unhighlighted m b -> Unhighlighted m c #(*>) :: Unhighlighted m a -> Unhighlighted m b -> Unhighlighted m b #(<*) :: Unhighlighted m a -> Unhighlighted m b -> Unhighlighted m a # Applicative m => Applicative (Unlined m) Instance detailsDefined in Text.Parser.Token Methodspure :: a -> Unlined m a #(<*>) :: Unlined m (a -> b) -> Unlined m a -> Unlined m b #liftA2 :: (a -> b -> c) -> Unlined m a -> Unlined m b -> Unlined m c #(*>) :: Unlined m a -> Unlined m b -> Unlined m b #(<*) :: Unlined m a -> Unlined m b -> Unlined m a # Applicative m => Applicative (Unspaced m) Instance detailsDefined in Text.Parser.Token Methodspure :: a -> Unspaced m a #(<*>) :: Unspaced m (a -> b) -> Unspaced m a -> Unspaced m b #liftA2 :: (a -> b -> c) -> Unspaced m a -> Unspaced m b -> Unspaced m c #(*>) :: Unspaced m a -> Unspaced m b -> Unspaced m b #(<*) :: Unspaced m a -> Unspaced m b -> Unspaced m a # Applicative (It r) Instance detailsDefined in Text.Trifecta.Util.It Methodspure :: a -> It r a #(<*>) :: It r (a -> b) -> It r a -> It r b #liftA2 :: (a -> b -> c) -> It r a -> It r b -> It r c #(*>) :: It r a -> It r b -> It r b #(<*) :: It r a -> It r b -> It r a # Applicative f => Applicative (Mon f) Instance detailsDefined in Data.Semigroup.Monad Methodspure :: a -> Mon f a #(<*>) :: Mon f (a -> b) -> Mon f a -> Mon f b #liftA2 :: (a -> b -> c) -> Mon f a -> Mon f b -> Mon f c #(*>) :: Mon f a -> Mon f b -> Mon f b #(<*) :: Mon f a -> Mon f b -> Mon 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 (FFM f) Instance detailsDefined in Unbound.Generics.LocallyNameless.Alpha Methodspure :: a -> FFM f a #(<*>) :: FFM f (a -> b) -> FFM f a -> FFM f b #liftA2 :: (a -> b -> c) -> FFM f a -> FFM f b -> FFM f c #(*>) :: FFM f a -> FFM f b -> FFM f b #(<*) :: FFM f a -> FFM f b -> FFM f a # Monad m => Applicative (FreshMT m) Instance detailsDefined in Unbound.Generics.LocallyNameless.Fresh Methodspure :: a -> FreshMT m a #(<*>) :: FreshMT m (a -> b) -> FreshMT m a -> FreshMT m b #liftA2 :: (a -> b -> c) -> FreshMT m a -> FreshMT m b -> FreshMT m c #(*>) :: FreshMT m a -> FreshMT m b -> FreshMT m b #(<*) :: FreshMT m a -> FreshMT m b -> FreshMT m a # Applicative m => Applicative (LFreshMT m) Instance detailsDefined in Unbound.Generics.LocallyNameless.LFresh Methodspure :: a -> LFreshMT m a #(<*>) :: LFreshMT m (a -> b) -> LFreshMT m a -> LFreshMT m b #liftA2 :: (a -> b -> c) -> LFreshMT m a -> LFreshMT m b -> LFreshMT m c #(*>) :: LFreshMT m a -> LFreshMT m b -> LFreshMT m b #(<*) :: LFreshMT m a -> LFreshMT m b -> LFreshMT m a # Applicative (ReifiedFold s) 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 # Applicative (ReifiedGetter s) 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 # 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 # 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 # 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 # Applicative f => Applicative (Indexing f) 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 # Applicative f => Applicative (Indexing64 f) 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 # (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 # Applicative (Signal domain) Instance detailsDefined in Clash.Signal.Internal Methodspure :: a -> Signal domain a #(<*>) :: Signal domain (a -> b) -> Signal domain a -> Signal domain b #liftA2 :: (a -> b -> c) -> Signal domain a -> Signal domain b -> Signal domain c #(*>) :: Signal domain a -> Signal domain b -> Signal domain b #(<*) :: Signal domain a -> Signal domain b -> Signal domain a # Applicative (RewriteMonad extra) # Instance detailsDefined in Clash.Rewrite.Types Methodspure :: a -> RewriteMonad extra a #(<*>) :: RewriteMonad extra (a -> b) -> RewriteMonad extra a -> RewriteMonad extra b #liftA2 :: (a -> b -> c) -> RewriteMonad extra a -> RewriteMonad extra b -> RewriteMonad extra c #(*>) :: RewriteMonad extra a -> RewriteMonad extra b -> RewriteMonad extra b #(<*) :: RewriteMonad extra a -> RewriteMonad extra b -> RewriteMonad extra a # 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 # 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 # (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 # 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 # (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 # (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 # (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 # (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 # (Monoid w, Applicative m) => Applicative (WriterT w m) Instance detailsDefined in Control.Monad.Trans.Writer.Lazy 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 w, Applicative m) => Applicative (WriterT w m) Instance detailsDefined in Control.Monad.Trans.Writer.Strict 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 # Derived instance. Instance detailsDefined in Data.Functor.Reverse Methodspure :: a -> Reverse f a #(<*>) :: Reverse f (a -> b) -> Reverse f a -> Reverse f b #liftA2 :: (a -> b -> c) -> Reverse f a -> Reverse f b -> Reverse f c #(*>) :: Reverse f a -> Reverse f b -> Reverse f b #(<*) :: Reverse f a -> Reverse f b -> Reverse f a # Monoid a => Applicative (Constant a :: * -> *) Instance detailsDefined in Data.Functor.Constant Methodspure :: a0 -> Constant a a0 #(<*>) :: Constant a (a0 -> b) -> Constant a a0 -> Constant a b #liftA2 :: (a0 -> b -> c) -> Constant a a0 -> Constant a b -> Constant a c #(*>) :: Constant a a0 -> Constant a b -> Constant a b #(<*) :: Constant a a0 -> Constant a b -> Constant a a0 # 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 (Tagged s) 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 # 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 # 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 # 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 # (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 # (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 # (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 # (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 (Flows i b) Instance detailsDefined in Control.Lens.Internal.Level Methodspure :: a -> Flows i b a #(<*>) :: Flows i b (a -> b0) -> Flows i b a -> Flows i b b0 #liftA2 :: (a -> b0 -> c) -> Flows i b a -> Flows i b b0 -> Flows i b c #(*>) :: Flows i b a -> Flows i b b0 -> Flows i b b0 #(<*) :: Flows i b a -> Flows i b b0 -> Flows i b 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 # 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 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 # (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 (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 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 # Applicative (ParsecT s u m) Instance detailsDefined in Text.Parsec.Prim Methodspure :: a -> ParsecT s u m a #(<*>) :: ParsecT s u m (a -> b) -> ParsecT s u m a -> ParsecT s u m b #liftA2 :: (a -> b -> c) -> ParsecT s u m a -> ParsecT s u m b -> ParsecT s u m c #(*>) :: ParsecT s u m a -> ParsecT s u m b -> ParsecT s u m b #(<*) :: ParsecT s u m a -> ParsecT s u m b -> ParsecT s u m a # 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 (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 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 # (Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) Instance detailsDefined in Control.Monad.Trans.RWS.Lazy Methodspure :: a -> RWST r w s m a #(<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b #liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c #(*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b #(<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a # (Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) Instance detailsDefined in Control.Monad.Trans.RWS.Strict Methodspure :: a -> RWST r w s m a #(<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b #liftA2 :: (a -> b -> c) -> RWST r w s m a -> RWST r w s m b -> RWST r w s m c #(*>) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m b #(<*) :: RWST r w s m a -> RWST r w s m b -> RWST r w s m a # Reifies s (ReifiedApplicative f) => Applicative (ReflectedApplicative f s) 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 # 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 # (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 1 # Right-to-left Kleisli composition of monads. (>=>), with the arguments flipped. Note how this operator resembles function composition (.): (.) :: (b -> c) -> (a -> b) -> a -> c (<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c (>=>) :: Monad m => (a -> m b) -> (b -> m c) -> a -> m c infixr 1 # Left-to-right Kleisli composition of monads. first :: Arrow a => a b c -> a (b, d) (c, d) # Send the first component of the input through the argument arrow, and copy the rest unchanged to the output. second :: Arrow a => a b c -> a (d, b) (d, c) # A mirror image of first. The default definition may be overridden with a more efficient version if desired. (***) :: Arrow a => a b c -> a b' c' -> a (b, b') (c, c') infixr 3 # Split the input between the two argument arrows and combine their output. Note that this is in general not a functor. The default definition may be overridden with a more efficient version if desired. on :: (b -> b -> c) -> (a -> b) -> a -> a -> c infixl 0 # (<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 #

An infix synonym for fmap.

The name of this operator is an allusion to $. Note the similarities between their types:  ($)  ::              (a -> b) ->   a ->   b
(<$>) :: Functor f => (a -> b) -> f a -> f b Whereas $ is function application, <$> is function application lifted over a Functor. #### Examples Expand Convert from a Maybe Int to a Maybe String using show: >>> show <$> Nothing
Nothing
>>> show <$> Just 3 Just "3"  Convert from an Either Int Int to an Either Int String using show: >>> show <$> Left 17
Left 17
>>> show <$> Right 17 Right "17"  Double each element of a list: >>> (*2) <$> [1,2,3]
[2,4,6]


Apply even to the second element of a pair:

>>> even <\$> (2,2)
(2,True)