clash-lib-1.0.1: CAES Language for Synchronous Hardware - As a Library
Copyright(C) 2012-2016 University of Twente
LicenseBSD2 (see the file LICENSE)
MaintainerChristiaan Baaij <christiaan.baaij@gmail.com>
Safe HaskellNone
LanguageHaskell2010

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

Methods

getUniqueM :: m Int Source #

Get a new unique

Instances

Instances details
MonadUnique (RewriteMonad extra) Source # 
Instance details

Defined in Clash.Rewrite.Types

Monad m => MonadUnique (StateT Int m) Source # 
Instance details

Defined in Clash.Util

pprPanic :: String -> Doc ann -> a Source #

warnPprTrace Source #

Arguments

:: HasCallStack 
=> Bool

Trigger warning?

-> String

File name

-> Int

Line number

-> Doc ann

Message

-> a

Pass value (like trace)

-> a 

pprTrace :: String -> Doc ann -> a -> a Source #

pprTraceDebug :: String -> Doc ann -> a -> a Source #

pprDebugAndThen :: (String -> a) -> Doc ann -> Doc ann -> a Source #

curLoc :: Q Exp Source #

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.

makeCached Source #

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

makeCachedU Source #

Arguments

:: (MonadState s m, Uniquable k) 
=> k

Key the action is associated with

-> Lens' s (UniqMap v)

Lens to the cache

-> m v

Action to cache

-> m v 

Cache the result of a monadic action using a UniqMap

liftState Source #

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

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

headMaybe :: [a] -> Maybe a Source #

Safe version of head

tailMaybe :: [a] -> Maybe [a] Source #

Safe version of tail

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

Split the second list at the length of the first list

countEq Source #

Arguments

:: Eq a 
=> a 
-> [a]

Haystack

-> Int

Times needle was found in haystack

Return number of occurrences of an item in a list

flogBase :: Integer -> Integer -> Maybe Int Source #

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

clogBase :: Integer -> Integer -> Maybe Int Source #

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

equalLength :: [a] -> [b] -> Bool Source #

Determine whether two lists are of equal length

neLength :: [a] -> [b] -> Bool Source #

Determine whether two lists are not of equal length

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

Zip two lists of equal length

NB Errors out for a 1 compiler when the two lists are not of equal length

debugIsOn :: Bool Source #

Is this a 1 compiler?

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

Short-circuiting monadic version of any

pkgIdFromTypeable :: Typeable a => a -> String Source #

Get the package id of the type of a value >>> pkgIdFromTypeable (undefined :: TopEntity) "clash-prelude-0.99.3-64904d90747cb49e17166bbc86fec8678918e4ead3847193a395b258e680373c"

uncurry3 :: (a -> b -> c -> d) -> (a, b, c) -> d Source #

Converts a curried function to a function on a triple

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

orElse :: Maybe a -> Maybe a -> Maybe a Source #

Left-biased choice on maybes

orElses :: [Maybe a] -> Maybe a Source #

Left-biased choice on maybes

class Functor f => Applicative (f :: Type -> Type) 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:

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 #

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

Instances details
Applicative []

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> [a] #

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

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

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

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

Applicative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: 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 #

Applicative IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: 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 #

Applicative Par1

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: 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 #

Applicative Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

pure :: 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 #

Applicative IResult 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

pure :: 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 Result 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

pure :: 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 Parser 
Instance details

Defined in Data.Aeson.Types.Internal

Methods

pure :: 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 Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

pure :: 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 #

Applicative Min

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: 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 #

Applicative Max

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: 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 #

Applicative First

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: 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 #

Applicative Last

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: 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 #

Applicative Option

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Methods

pure :: 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 #

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 #

(<*>) :: 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 #

Applicative Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pure :: 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 #

Applicative STM

Since: base-4.8.0.0

Instance details

Defined in GHC.Conc.Sync

Methods

pure :: 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 #

Applicative First

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: 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 #

Applicative Last

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: 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 #

Applicative Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: 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 #

Applicative Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: 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 #

Applicative Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: 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 #

Applicative Down

Since: base-4.11.0.0

Instance details

Defined in Data.Ord

Methods

pure :: 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 #

Applicative ReadPrec

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadPrec

Methods

pure :: 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 #

Applicative ReadP

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

pure :: 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 #

Applicative NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

pure :: 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 PutM 
Instance details

Defined in Data.Binary.Put

Methods

pure :: a -> PutM a #

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

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

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

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

Applicative Get 
Instance details

Defined in Data.Binary.Get.Internal

Methods

pure :: a -> Get a #

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

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

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

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

Applicative Put 
Instance details

Defined in Data.ByteString.Builder.Internal

Methods

pure :: 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 #

Applicative Tree 
Instance details

Defined in Data.Tree

Methods

pure :: 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 #

Applicative Seq

Since: containers-0.5.4

Instance details

Defined in Data.Sequence.Internal

Methods

pure :: 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 #

Applicative DList 
Instance details

Defined in Data.DList

Methods

pure :: 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 Vector 
Instance details

Defined in Data.Vector

Methods

pure :: 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 SmallArray 
Instance details

Defined in Data.Primitive.SmallArray

Methods

pure :: 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 #

Applicative Array 
Instance details

Defined in Data.Primitive.Array

Methods

pure :: 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 #

Applicative Parser 
Instance details

Defined in Text.Trifecta.Parser

Methods

pure :: 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 details

Defined in Text.Trifecta.Result

Methods

pure :: 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 Id 
Instance details

Defined in Data.Vector.Fusion.Util

Methods

pure :: 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 details

Defined in Data.Vector.Fusion.Util

Methods

pure :: 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 P

Since: base-4.5.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

pure :: 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 NetlistMonad Source # 
Instance details

Defined in Clash.Netlist.Types

Applicative (Either e)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

pure :: 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 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: 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 details

Defined in GHC.Base

Methods

pure :: 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 (ST s)

Since: base-4.4.0.0

Instance details

Defined in GHC.ST

Methods

pure :: 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 #

Representable f => Applicative (Co f) 
Instance details

Defined in Data.Functor.Rep

Methods

pure :: 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 #

Applicative (Parser i) 
Instance details

Defined in Data.Attoparsec.Internal.Types

Methods

pure :: 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 #

Monad m => Applicative (WrappedMonad m)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: 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 details

Defined in Control.Arrow

Methods

pure :: 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 :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: 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 details

Defined in Control.Monad.Trans.Maybe

Methods

pure :: 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 #

Alternative f => Applicative (Cofree f) 
Instance details

Defined in Control.Comonad.Cofree

Methods

pure :: 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 details

Defined in Control.Monad.Free

Methods

pure :: 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 #

Monad m => Applicative (InterpreterT m) 
Instance details

Defined in Hint.InterpreterT

Methods

pure :: a -> InterpreterT m a #

(<*>) :: InterpreterT m (a -> b) -> InterpreterT m a -> InterpreterT m b #

liftA2 :: (a -> b -> c) -> InterpreterT m a -> InterpreterT m b -> InterpreterT m c #

(*>) :: InterpreterT m a -> InterpreterT m b -> InterpreterT m b #

(<*) :: InterpreterT m a -> InterpreterT m b -> InterpreterT m a #

Applicative f => Applicative (Yoneda f) 
Instance details

Defined in Data.Functor.Yoneda

Methods

pure :: 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 (ReifiedGetter s) 
Instance details

Defined in Control.Lens.Reified

Methods

pure :: 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 #

Applicative (ReifiedFold s) 
Instance details

Defined in Control.Lens.Reified

Methods

pure :: 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 f => Applicative (Indexing f) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

pure :: 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 details

Defined in Control.Lens.Internal.Indexed

Methods

pure :: 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 m => Applicative (ListT m) 
Instance details

Defined in Control.Monad.Trans.List

Methods

pure :: 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 m => Applicative (Unhighlighted m) 
Instance details

Defined in Text.Parser.Token

Methods

pure :: 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 (Unspaced m) 
Instance details

Defined in Text.Parser.Token

Methods

pure :: 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 m => Applicative (Unlined m) 
Instance details

Defined in Text.Parser.Token

Methods

pure :: 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 (Rep p), Representable p) => Applicative (Prep p) 
Instance details

Defined in Data.Profunctor.Rep

Methods

pure :: 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 f => Applicative (Mon f) 
Instance details

Defined in Data.Semigroup.Monad

Methods

pure :: 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 (It r) 
Instance details

Defined in Text.Trifecta.Util.It

Methods

pure :: 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 (SetM s) 
Instance details

Defined in Data.Graph

Methods

pure :: 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 (Signal dom) 
Instance details

Defined in Clash.Signal.Internal

Methods

pure :: a -> Signal dom a #

(<*>) :: Signal dom (a -> b) -> Signal dom a -> Signal dom b #

liftA2 :: (a -> b -> c) -> Signal dom a -> Signal dom b -> Signal dom c #

(*>) :: Signal dom a -> Signal dom b -> Signal dom b #

(<*) :: Signal dom a -> Signal dom b -> Signal dom a #

Applicative (RewriteMonad extra) Source # 
Instance details

Defined in Clash.Rewrite.Types

Methods

pure :: 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 details

Defined in GHC.Generics

Methods

pure :: 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 details

Defined in Control.Applicative

Methods

pure :: 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 :: Type -> Type)

Since: base-2.0.1

Instance details

Defined in Data.Functor.Const

Methods

pure :: 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 (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: 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 #

Applicative f => Applicative (Alt f)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: 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 details

Defined in Data.Bifunctor.Join

Methods

pure :: 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 details

Defined in Data.Bifunctor.Fix

Methods

pure :: 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 #

Applicative m => Applicative (IdentityT m) 
Instance details

Defined in Control.Monad.Trans.Identity

Methods

pure :: 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 details

Defined in Data.IntMap.Internal

Methods

pure :: 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 details

Defined in Control.Monad.Trans.Except

Methods

pure :: 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 f, Monad m) => Applicative (FreeT f m) 
Instance details

Defined in Control.Monad.Trans.Free

Methods

pure :: 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 details

Defined in Control.Comonad.Trans.Cofree

Methods

pure :: 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 details

Defined in Data.Functor.Day

Methods

pure :: 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 details

Defined in Control.Monad.Trans.Error

Methods

pure :: 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 (StateT s m) 
Instance details

Defined in Control.Monad.Trans.State.Strict

Methods

pure :: 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 (Mafic a b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: 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 (Flows i b)

This is an illegal Applicative.

Instance details

Defined in Control.Lens.Internal.Level

Methods

pure :: 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 (Indexed i a) 
Instance details

Defined in Control.Lens.Internal.Indexed

Methods

pure :: 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 #

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

Defined in Control.Monad.Trans.Reader

Methods

pure :: 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 #

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

Defined in Control.Monad.Trans.State.Lazy

Methods

pure :: 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 details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

pure :: 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 details

Defined in Control.Monad.Trans.Writer.Strict

Methods

pure :: 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 #

(Profunctor p, Arrow p) => Applicative (Tambara p a) 
Instance details

Defined in Data.Profunctor.Strong

Methods

pure :: 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 (Tagged s) 
Instance details

Defined in Data.Tagged

Methods

pure :: 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 (Mag a b) 
Instance details

Defined in Data.Biapplicative

Methods

pure :: a0 -> Mag a b a0 #

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

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

(*>) :: Mag a b a0 -> Mag a b b0 -> Mag a b b0 #

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

Monoid m => Applicative (Holes t m) 
Instance details

Defined in Control.Lens.Traversal

Methods

pure :: 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 :: Type -> Type)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: 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 #

Monoid c => Applicative (K1 i c :: Type -> Type)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> K1 i c a #

(<*>) :: K1 i c (a -> b) -> K1 i c a -> K1 i c b #

liftA2 :: (a -> b -> c0) -> K1 i c a -> K1 i c b -> K1 i c c0 #

(*>) :: K1 i c a -> K1 i c b -> K1 i c b #

(<*) :: K1 i c a -> K1 i c b -> K1 i c a #

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

(<*>) :: (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 details

Defined in Data.Functor.Product

Methods

pure :: 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 details

Defined in Data.IntMap.Internal

Methods

pure :: 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 details

Defined in Data.Map.Internal

Methods

pure :: 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 details

Defined in Control.Lens.Internal.Magma

Methods

pure :: 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 details

Defined in Control.Lens.Internal.Bazaar

Methods

pure :: 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 (ContT r m) 
Instance details

Defined in Control.Monad.Trans.Cont

Methods

pure :: 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 (ParsecT s u m) 
Instance details

Defined in Text.Parsec.Prim

Methods

pure :: 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 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 #

(<*>) :: 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 details

Defined in GHC.Generics

Methods

pure :: 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 details

Defined in Data.Functor.Compose

Methods

pure :: 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 details

Defined in Data.Map.Internal

Methods

pure :: 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 details

Defined in Control.Monad.Trans.RWS.Strict

Methods

pure :: 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 #

Applicative (TakingWhile p f a b) 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

pure :: 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 details

Defined in Control.Lens.Internal.Bazaar

Methods

pure :: 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 #

(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m) 
Instance details

Defined in Control.Monad.Trans.RWS.Lazy

Methods

pure :: 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 details

Defined in Data.Reflection

(<$>) :: 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)

(<=<) :: Monad m => (b -> m c) -> (a -> m b) -> a -> m c infixr 1 #

Right-to-left composition of Kleisli arrows. (>=>), 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 composition of Kleisli arrows.

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.

(***) :: 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.

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 (c, c') infixr 3 #

Fanout: send the input to both argument arrows and combine their output.

The default definition may be overridden with a more efficient version if desired.

on :: (b -> b -> c) -> (a -> b) -> a -> a -> c infixl 0 #

on b u x y runs the binary function b on the results of applying unary function u to two arguments x and y. From the opposite perspective, it transforms two inputs and combines the outputs.

((+) `on` f) x y = f x + f y

Typical usage: sortBy (compare `on` fst).

Algebraic properties:

  • (*) `on` id = (*) -- (if (*) ∉ {⊥, const ⊥})
  • ((*) `on` f) `on` g = (*) `on` (f . g)
  • flip on f . flip on g = flip on (g . f)

makeLenses :: Name -> DecsQ #

Build lenses (and traversals) with a sensible default configuration.

e.g.

data FooBar
  = Foo { _x, _y :: Int }
  | Bar { _x :: Int }
makeLenses ''FooBar

will create

x :: Lens' FooBar Int
x f (Foo a b) = (\a' -> Foo a' b) <$> f a
x f (Bar a)   = Bar <$> f a
y :: Traversal' FooBar Int
y f (Foo a b) = (\b' -> Foo a  b') <$> f b
y _ c@(Bar _) = pure c
makeLenses = makeLensesWith lensRules

data SrcSpan #

Source Span

A SrcSpan identifies either a specific portion of a text file or a human-readable description of a location.

Instances

Instances details
Eq SrcSpan 
Instance details

Defined in SrcLoc

Methods

(==) :: SrcSpan -> SrcSpan -> Bool #

(/=) :: SrcSpan -> SrcSpan -> Bool #

Data SrcSpan 
Instance details

Defined in SrcLoc

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SrcSpan -> c SrcSpan #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SrcSpan #

toConstr :: SrcSpan -> Constr #

dataTypeOf :: SrcSpan -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SrcSpan) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SrcSpan) #

gmapT :: (forall b. Data b => b -> b) -> SrcSpan -> SrcSpan #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SrcSpan -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SrcSpan -> r #

gmapQ :: (forall d. Data d => d -> u) -> SrcSpan -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> SrcSpan -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SrcSpan -> m SrcSpan #

Ord SrcSpan 
Instance details

Defined in SrcLoc

Show SrcSpan 
Instance details

Defined in SrcLoc

Generic SrcSpan Source # 
Instance details

Defined in GHC.SrcLoc.Extra

Associated Types

type Rep SrcSpan :: Type -> Type #

Methods

from :: SrcSpan -> Rep SrcSpan x #

to :: Rep SrcSpan x -> SrcSpan #

Hashable SrcSpan Source # 
Instance details

Defined in GHC.SrcLoc.Extra

Methods

hashWithSalt :: Int -> SrcSpan -> Int #

hash :: SrcSpan -> Int #

Binary SrcSpan Source # 
Instance details

Defined in GHC.SrcLoc.Extra

Methods

put :: SrcSpan -> Put #

get :: Get SrcSpan #

putList :: [SrcSpan] -> Put #

NFData SrcSpan 
Instance details

Defined in SrcLoc

Methods

rnf :: SrcSpan -> () #

ToJson SrcSpan 
Instance details

Defined in SrcLoc

Methods

json :: SrcSpan -> JsonDoc #

Outputable SrcSpan 
Instance details

Defined in SrcLoc

Methods

ppr :: SrcSpan -> SDoc #

pprPrec :: Rational -> SrcSpan -> SDoc #

PrettyPrec SrcSpan Source # 
Instance details

Defined in Clash.Core.Pretty

NamedThing e => NamedThing (Located e) 
Instance details

Defined in Name

HasSrcSpan (Located a) 
Instance details

Defined in SrcLoc

type Rep SrcSpan Source # 
Instance details

Defined in GHC.SrcLoc.Extra

noSrcSpan :: SrcSpan #

Built-in "bad" SrcSpans for common sources of location uncertainty

type HasCallStack = ?callStack :: CallStack #

Request a CallStack.

NOTE: The implicit parameter ?callStack :: CallStack is an implementation detail and should not be considered part of the CallStack API, we may decide to change the implementation in the future.

Since: base-4.9.0.0