ghc-8.4.4: The GHC API

Safe HaskellNone
LanguageHaskell2010

DsMonad

Contents

Synopsis

Documentation

mapM :: (Traversable t, Monad m) => (a -> m b) -> t a -> m (t b) Source #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.

mapAndUnzipM :: Applicative m => (a -> m (b, c)) -> [a] -> m ([b], [c]) Source #

The mapAndUnzipM function maps its first argument over a list, returning the result as a pair of lists. This function is mainly used with complicated data structures or a state-transforming monad.

initDs :: HscEnv -> TcGblEnv -> DsM a -> IO (Messages, Maybe a) Source #

Run a DsM action inside the IO monad.

initDsTc :: DsM a -> TcM a Source #

Run a DsM action inside the TcM monad.

initDsWithModGuts :: HscEnv -> ModGuts -> DsM a -> IO (Messages, Maybe a) Source #

Run a DsM action in the context of an existing ModGuts

fixDs :: (a -> DsM a) -> DsM a Source #

foldlM :: Monad m => (a -> b -> m a) -> a -> [b] -> m a Source #

Monadic version of foldl

foldrM :: Monad m => (b -> a -> m a) -> a -> [b] -> m a Source #

Monadic version of foldr

whenGOptM :: GeneralFlag -> TcRnIf gbl lcl () -> TcRnIf gbl lcl () Source #

unsetGOptM :: GeneralFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a Source #

unsetWOptM :: WarningFlag -> TcRnIf gbl lcl a -> TcRnIf gbl lcl a Source #

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

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:

As a consequence of these laws, the Functor instance for f will satisfy

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

(which implies that pure and <*> satisfy the applicative functor laws).

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a Source #

Lift a value.

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

Sequential application.

A few functors support an implementation of <*> that is more efficient than the default one.

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

Sequence actions, discarding the value of the first argument.

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

Sequence actions, discarding the value of the second argument.

Instances
Applicative []

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> [a] Source #

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

liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] Source #

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

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

Applicative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> Maybe a Source #

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

liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c Source #

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

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

Applicative IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> IO a Source #

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

liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c Source #

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

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

Applicative Par1

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> Par1 a Source #

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

liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c Source #

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

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

Applicative Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

pure :: a -> Q a Source #

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

liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c Source #

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

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

Applicative Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

pure :: a -> Complex a Source #

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

liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c Source #

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

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

Applicative Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Min a Source #

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

liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c Source #

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

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

Applicative Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Max a Source #

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

liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c Source #

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

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

Applicative First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> First a Source #

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

liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source #

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

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

Applicative Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Last a Source #

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

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source #

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

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

Applicative Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: a -> Option a Source #

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

liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c Source #

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

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

Applicative ZipList
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 details

Defined in Control.Applicative

Methods

pure :: a -> ZipList a Source #

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

liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source #

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

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

Applicative Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pure :: a -> Identity a Source #

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

liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source #

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

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

Applicative STM

Since: base-4.8.0.0

Instance details

Defined in GHC.Conc.Sync

Methods

pure :: a -> STM a Source #

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

liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c Source #

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

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

Applicative First 
Instance details

Defined in Data.Monoid

Methods

pure :: a -> First a Source #

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

liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source #

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

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

Applicative Last 
Instance details

Defined in Data.Monoid

Methods

pure :: a -> Last a Source #

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

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source #

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

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

Applicative Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Dual a Source #

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

liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c Source #

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

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

Applicative Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Sum a Source #

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

liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c Source #

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

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

Applicative Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Product a Source #

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

liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c Source #

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

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

Applicative Down

Since: base-4.11.0.0

Instance details

Defined in Data.Ord

Methods

pure :: a -> Down a Source #

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

liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c Source #

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

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

Applicative ReadPrec

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadPrec

Methods

pure :: a -> ReadPrec a Source #

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

liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c Source #

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

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

Applicative ReadP

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

pure :: a -> ReadP a Source #

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

liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c Source #

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

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

Applicative NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

pure :: a -> NonEmpty a Source #

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

liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c Source #

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

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

Applicative Put 
Instance details

Defined in Data.ByteString.Builder.Internal

Methods

pure :: a -> Put a Source #

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

liftA2 :: (a -> b -> c) -> Put a -> Put b -> Put c Source #

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

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

Applicative PutM 
Instance details

Defined in Data.Binary.Put

Methods

pure :: a -> PutM a Source #

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

liftA2 :: (a -> b -> c) -> PutM a -> PutM b -> PutM c Source #

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

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

Applicative Get 
Instance details

Defined in Data.Binary.Get.Internal

Methods

pure :: a -> Get a Source #

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

liftA2 :: (a -> b -> c) -> Get a -> Get b -> Get c Source #

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

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

Applicative Tree 
Instance details

Defined in Data.Tree

Methods

pure :: a -> Tree a Source #

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

liftA2 :: (a -> b -> c) -> Tree a -> Tree b -> Tree c Source #

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

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

Applicative Seq

Since: containers-0.5.4

Instance details

Defined in Data.Sequence.Internal

Methods

pure :: a -> Seq a Source #

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

liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c Source #

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

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

Applicative Capability 
Instance details

Defined in System.Console.Terminfo.Base

Applicative P

Since: base-4.5.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

pure :: a -> P a Source #

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

liftA2 :: (a -> b -> c) -> P a -> P b -> P c Source #

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

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

Applicative Pair # 
Instance details

Defined in Pair

Methods

pure :: a -> Pair a Source #

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

liftA2 :: (a -> b -> c) -> Pair a -> Pair b -> Pair c Source #

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

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

Applicative UniqSM # 
Instance details

Defined in UniqSupply

Methods

pure :: a -> UniqSM a Source #

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

liftA2 :: (a -> b -> c) -> UniqSM a -> UniqSM b -> UniqSM c Source #

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

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

Applicative P # 
Instance details

Defined in Lexer

Methods

pure :: a -> P a Source #

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

liftA2 :: (a -> b -> c) -> P a -> P b -> P c Source #

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

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

Applicative PD # 
Instance details

Defined in CmmMonad

Methods

pure :: a -> PD a Source #

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

liftA2 :: (a -> b -> c) -> PD a -> PD b -> PD c Source #

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

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

Applicative UnifyResultM # 
Instance details

Defined in Unify

Applicative LlvmM # 
Instance details

Defined in LlvmCodeGen.Base

Methods

pure :: a -> LlvmM a Source #

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

liftA2 :: (a -> b -> c) -> LlvmM a -> LlvmM b -> LlvmM c Source #

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

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

Applicative FCode # 
Instance details

Defined in StgCmmMonad

Methods

pure :: a -> FCode a Source #

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

liftA2 :: (a -> b -> c) -> FCode a -> FCode b -> FCode c Source #

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

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

Applicative CmmParse # 
Instance details

Defined in StgCmmExtCode

Methods

pure :: a -> CmmParse a Source #

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

liftA2 :: (a -> b -> c) -> CmmParse a -> CmmParse b -> CmmParse c Source #

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

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

Applicative Hsc # 
Instance details

Defined in HscTypes

Methods

pure :: a -> Hsc a Source #

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

liftA2 :: (a -> b -> c) -> Hsc a -> Hsc b -> Hsc c Source #

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

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

Applicative TcPluginM # 
Instance details

Defined in TcRnTypes

Methods

pure :: a -> TcPluginM a Source #

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

liftA2 :: (a -> b -> c) -> TcPluginM a -> TcPluginM b -> TcPluginM c Source #

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

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

Applicative CompPipeline # 
Instance details

Defined in PipelineMonad

Applicative Ghc # 
Instance details

Defined in GhcMonad

Methods

pure :: a -> Ghc a Source #

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

liftA2 :: (a -> b -> c) -> Ghc a -> Ghc b -> Ghc c Source #

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

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

Applicative CoreM # 
Instance details

Defined in CoreMonad

Methods

pure :: a -> CoreM a Source #

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

liftA2 :: (a -> b -> c) -> CoreM a -> CoreM b -> CoreM c Source #

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

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

Applicative SimplM # 
Instance details

Defined in SimplMonad

Methods

pure :: a -> SimplM a Source #

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

liftA2 :: (a -> b -> c) -> SimplM a -> SimplM b -> SimplM c Source #

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

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

Applicative CpsRn # 
Instance details

Defined in RnPat

Methods

pure :: a -> CpsRn a Source #

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

liftA2 :: (a -> b -> c) -> CpsRn a -> CpsRn b -> CpsRn c Source #

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

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

Applicative OccCheckResult # 
Instance details

Defined in TcUnify

Applicative TcS # 
Instance details

Defined in TcSMonad

Methods

pure :: a -> TcS a Source #

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

liftA2 :: (a -> b -> c) -> TcS a -> TcS b -> TcS c Source #

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

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

Applicative VM # 
Instance details

Defined in Vectorise.Monad.Base

Methods

pure :: a -> VM a Source #

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

liftA2 :: (a -> b -> c) -> VM a -> VM b -> VM c Source #

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

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

Applicative NatM # 
Instance details

Defined in NCGMonad

Methods

pure :: a -> NatM a Source #

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

liftA2 :: (a -> b -> c) -> NatM a -> NatM b -> NatM c Source #

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

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

Applicative (Either e)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

pure :: a -> Either e a Source #

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

liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c Source #

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

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

Applicative (U1 :: * -> *)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> U1 a Source #

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

liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c Source #

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

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

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 details

Defined in GHC.Base

Methods

pure :: a0 -> (a, a0) Source #

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

liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) Source #

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

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

Monad m => Applicative (WrappedMonad m)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> WrappedMonad m a Source #

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

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source #

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

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

Arrow a => Applicative (ArrowMonad a)

Since: base-4.6.0.0

Instance details

Defined in Control.Arrow

Methods

pure :: a0 -> ArrowMonad a a0 Source #

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

liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c Source #

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

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

Applicative (Proxy :: * -> *)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a Source #

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

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c Source #

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

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

Applicative (ST s)

Since: base-4.4.0.0

Instance details

Defined in GHC.ST

Methods

pure :: a -> ST s a Source #

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

liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c Source #

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

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

(Functor m, Monad m) => Applicative (MaybeT m) 
Instance details

Defined in Control.Monad.Trans.Maybe

Methods

pure :: a -> MaybeT m a Source #

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

liftA2 :: (a -> b -> c) -> MaybeT m a -> MaybeT m b -> MaybeT m c Source #

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

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

Applicative (ListT f) # 
Instance details

Defined in ListT

Methods

pure :: a -> ListT f a Source #

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

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

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

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

Applicative (State s) # 
Instance details

Defined in State

Methods

pure :: a -> State s a Source #

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

liftA2 :: (a -> b -> c) -> State s a -> State s b -> State s c Source #

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

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

Applicative (MaybeErr err) # 
Instance details

Defined in Maybes

Methods

pure :: a -> MaybeErr err a Source #

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

liftA2 :: (a -> b -> c) -> MaybeErr err a -> MaybeErr err b -> MaybeErr err c Source #

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

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

Applicative (SetM s) 
Instance details

Defined in Data.Graph

Methods

pure :: a -> SetM s a Source #

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

liftA2 :: (a -> b -> c) -> SetM s a -> SetM s b -> SetM s c Source #

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

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

Applicative (CmdLineP s) # 
Instance details

Defined in CmdLineParser

Methods

pure :: a -> CmdLineP s a Source #

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

liftA2 :: (a -> b -> c) -> CmdLineP s a -> CmdLineP s b -> CmdLineP s c Source #

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

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

Monad m => Applicative (EwM m) # 
Instance details

Defined in CmdLineParser

Methods

pure :: a -> EwM m a Source #

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

liftA2 :: (a -> b -> c) -> EwM m a -> EwM m b -> EwM m c Source #

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

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

Applicative (IOEnv m) # 
Instance details

Defined in IOEnv

Methods

pure :: a -> IOEnv m a Source #

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

liftA2 :: (a -> b -> c) -> IOEnv m a -> IOEnv m b -> IOEnv m c Source #

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

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

Applicative (RegM freeRegs) # 
Instance details

Defined in RegAlloc.Linear.State

Methods

pure :: a -> RegM freeRegs a Source #

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

liftA2 :: (a -> b -> c) -> RegM freeRegs a -> RegM freeRegs b -> RegM freeRegs c Source #

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

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

Applicative m => Applicative (GhcT m) # 
Instance details

Defined in GhcMonad

Methods

pure :: a -> GhcT m a Source #

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

liftA2 :: (a -> b -> c) -> GhcT m a -> GhcT m b -> GhcT m c Source #

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

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

Applicative f => Applicative (Rec1 f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> Rec1 f a Source #

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

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

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

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

Arrow a => Applicative (WrappedArrow a b)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a0 -> WrappedArrow a b a0 Source #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #

Monoid m => Applicative (Const m :: * -> *)

Since: base-2.0.1

Instance details

Defined in Data.Functor.Const

Methods

pure :: a -> Const m a Source #

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

liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source #

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

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

Applicative f => Applicative (Alt f) 
Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Alt f a Source #

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

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

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

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

(Applicative f, Monad f) => Applicative (WhenMissing f x)

Equivalent to ReaderT k (ReaderT x (MaybeT f)).

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMissing f x a Source #

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

liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c Source #

(*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b Source #

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

(Monoid w, Applicative m) => Applicative (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

pure :: a -> WriterT w m a Source #

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

liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c Source #

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

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

(Functor m, Monad m) => Applicative (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

pure :: a -> StateT s m a Source #

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

liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c Source #

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

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

(Functor m, Monad m) => Applicative (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Lazy

Methods

pure :: a -> StateT s m a Source #

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

liftA2 :: (a -> b -> c) -> StateT s m a -> StateT s m b -> StateT s m c Source #

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

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

(Functor m, Monad m) => Applicative (ExceptT e m) 
Instance details

Defined in Control.Monad.Trans.Except

Methods

pure :: a -> ExceptT e m a Source #

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

liftA2 :: (a -> b -> c) -> ExceptT e m a -> ExceptT e m b -> ExceptT e m c Source #

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

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

Monad m => Applicative (Stream m a) # 
Instance details

Defined in Stream

Methods

pure :: a0 -> Stream m a a0 Source #

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

liftA2 :: (a0 -> b -> c) -> Stream m a a0 -> Stream m a b -> Stream m a c Source #

(*>) :: Stream m a a0 -> Stream m a b -> Stream m a b Source #

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

Applicative ((->) a :: * -> *)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a0 -> a -> a0 Source #

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

liftA2 :: (a0 -> b -> c) -> (a -> a0) -> (a -> b) -> a -> c Source #

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

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

(Applicative f, Applicative g) => Applicative (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

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

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

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

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

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

(Applicative f, Applicative g) => Applicative (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

pure :: a -> Product f g a Source #

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

liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c Source #

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

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

(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 details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMatched f x y a Source #

(<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b Source #

liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c Source #

(*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b Source #

(<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a Source #

(Applicative f, Monad f) => Applicative (WhenMissing f k x)

Equivalent to ReaderT k (ReaderT x (MaybeT f)) .

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMissing f k x a Source #

(<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b Source #

liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c Source #

(*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b Source #

(<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a Source #

Applicative m => Applicative (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

pure :: a -> ReaderT r m a Source #

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

liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c Source #

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

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

Applicative f => Applicative (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> M1 i c f a Source #

(<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b Source #

liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 Source #

(*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source #

(<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a Source #

(Applicative f, Applicative g) => Applicative (f :.: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

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

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

liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c Source #

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

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

(Applicative f, Applicative g) => Applicative (Compose f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

pure :: a -> Compose f g a Source #

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

liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c Source #

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

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

(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 details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMatched f k x y a Source #

(<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b Source #

liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c Source #

(*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b Source #

(<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a Source #

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 Source #

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)

data UniqSupply Source #

Unique Supply

A value of type UniqSupply is unique, and it can supply one distinct Unique. Also, from the supply, one can also manufacture an arbitrary number of further UniqueSupply values, which will be distinct from the first and from all others.

dsDPHBuiltin :: (PArrBuiltin -> a) -> DsM a Source #

Get a name from Data.Array.Parallel for the desugarer, from the ds_parr_bi component of the global desugerar environment.

data PArrBuiltin Source #

Constructors

PArrBuiltin 

Fields

dsLookupDPHRdrEnv :: OccName -> DsM Name Source #

Lookup a name exported by Prim or Prim. Panic if there isn't one, or if it is defined multiple times.

dsLookupDPHRdrEnv_maybe :: OccName -> DsM (Maybe Name) Source #

Lookup a name exported by Prim or Prim, returning Nothing if it's not defined. Panic if it's defined multiple times.

getDictsDs :: DsM (Bag EvVar) Source #

Get in-scope type constraints (pm check)

addDictsDs :: Bag EvVar -> DsM a -> DsM a Source #

Add in-scope type constraints (pm check)

getTmCsDs :: DsM (Bag SimpleEq) Source #

Get in-scope term constraints (pm check)

addTmCsDs :: Bag SimpleEq -> DsM a -> DsM a Source #

Add in-scope term constraints (pm check)

incrCheckPmIterDs :: DsM Int Source #

Increase the counter for elapsed pattern match check iterations. If the current counter is already over the limit, fail

resetPmIterDs :: DsM () Source #

Reset the counter for pattern match check iterations to zero

dsGetCompleteMatches :: TyCon -> DsM [CompleteMatch] Source #

The COMPLETE pragams provided by the user for a given TyCon.

warnDs :: WarnReason -> SDoc -> DsM () Source #

Emit a warning for the current source location NB: Warns whether or not -Wxyz is set

warnIfSetDs :: WarningFlag -> SDoc -> DsM () Source #

Emit a warning only if the correct WarnReason is set in the DynFlags

errDs :: SDoc -> DsM () Source #

errDsCoreExpr :: SDoc -> DsM CoreExpr Source #

Issue an error, but return the expression for (), so that we can continue reporting errors.

data EquationInfo Source #

Constructors

EqnInfo 
Instances
Outputable EquationInfo # 
Instance details

Defined in DsMonad

data CanItFail Source #

Constructors

CanFail 
CantFail 

dsNoLevPoly :: Type -> SDoc -> DsM () Source #

Fail with an error message if the type is levity polymorphic.

dsNoLevPolyExpr :: CoreExpr -> SDoc -> DsM () Source #

Check an expression for levity polymorphism, failing if it is levity polymorphic.

dsWhenNoErrs :: DsM a -> (a -> CoreExpr) -> DsM CoreExpr Source #

Runs the thing_inside. If there are no errors, then returns the expr given. Otherwise, returns unitExpr. This is useful for doing a bunch of levity polymorphism checks and then avoiding making a core App. (If we make a core App on a levity polymorphic argument, detecting how to handle the let/app invariant might call isUnliftedType, which panics on a levity polymorphic type.) See #12709 for an example of why this machinery is necessary.

pprRuntimeTrace Source #

Arguments

:: String

header

-> SDoc

information to output

-> CoreExpr

expression

-> DsM CoreExpr 

Inject a trace message into the compiled program. Whereas pprTrace prints out information *while compiling*, pprRuntimeTrace captures that information and causes it to be printed *at runtime* using Debug.Trace.trace.

pprRuntimeTrace hdr doc expr

will produce an expression that looks like

trace (hdr + doc) expr

When using this to debug a module that Debug.Trace depends on, it is necessary to import {--} Debug.Trace () in that module. We could avoid this inconvenience by wiring in Debug.Trace.trace, but that doesn't seem worth the effort and maintenance cost.

Orphan instances