diagrams-lib-1.4.0.1: Embedded domain-specific language for declarative graphics

Copyright(c) 2011-2015 diagrams-lib team (see LICENSE)
LicenseBSD-style (see LICENSE)
Maintainerdiagrams-discuss@googlegroups.com
Safe HaskellNone
LanguageHaskell2010

Diagrams.Prelude

Contents

Description

A module to re-export most of the functionality of the diagrams core and standard library.

Synopsis

Diagrams library

Exports from this library for working with diagrams.

module Diagrams

Convenience re-exports from other packages

For working with default values. Diagrams also exports with, an alias for def.

For representing and operating on colors.

A large list of color names.

Specify your own colours.

Semigroups and monoids show up all over the place, so things from Data.Semigroup and Data.Monoid often come in handy.

For computing with vectors.

For computing with points and vectors.

For computing with dot products and norm.

For working with Active (i.e. animated) things.

Most of the lens package. The following functions are not exported from lens because they either conflict with diagrams or may conflict with other libraries:

class Functor f => Applicative f where #

A functor with application, providing operations to

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

A minimal complete definition must include implementations of these functions satisfying the following laws:

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

If f is also a Monad, it should satisfy

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

Minimal complete definition

pure, (<*>)

Instances

Applicative [] 

Methods

pure :: a -> [a] #

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

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

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

Applicative Maybe 

Methods

pure :: a -> Maybe a #

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

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

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

Applicative IO 

Methods

pure :: a -> IO a #

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

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

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

Applicative U1 

Methods

pure :: a -> U1 a #

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

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

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

Applicative Par1 

Methods

pure :: a -> Par1 a #

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

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

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

Applicative Q 

Methods

pure :: a -> Q a #

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

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

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

Applicative Active 

Methods

pure :: a -> Active a #

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

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

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

Applicative Duration 

Methods

pure :: a -> Duration a #

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

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

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

Applicative Id 

Methods

pure :: a -> Id a #

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

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

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

Applicative P 

Methods

pure :: a -> P a #

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

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

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

Applicative Identity 

Methods

pure :: a -> Identity a #

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

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

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

Applicative Min 

Methods

pure :: a -> Min a #

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

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

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

Applicative Max 

Methods

pure :: a -> Max a #

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

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

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

Applicative First 

Methods

pure :: a -> First a #

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

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

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

Applicative Last 

Methods

pure :: a -> Last a #

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

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

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

Applicative Option 

Methods

pure :: a -> Option a #

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

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

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

Applicative NonEmpty 

Methods

pure :: a -> NonEmpty a #

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

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

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

Applicative Complex 

Methods

pure :: a -> Complex a #

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

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

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

Applicative ZipList 

Methods

pure :: a -> ZipList a #

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

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

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

Applicative STM 

Methods

pure :: a -> STM a #

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

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

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

Applicative Dual 

Methods

pure :: a -> Dual a #

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

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

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

Applicative Sum 

Methods

pure :: a -> Sum a #

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

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

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

Applicative Product 

Methods

pure :: a -> Product a #

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

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

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

Applicative First 

Methods

pure :: a -> First a #

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

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

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

Applicative Last 

Methods

pure :: a -> Last a #

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

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

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

Applicative ReadPrec 

Methods

pure :: a -> ReadPrec a #

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

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

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

Applicative ReadP 

Methods

pure :: a -> ReadP a #

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

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

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

Applicative Id 

Methods

pure :: a -> Id a #

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

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

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

Applicative Get 

Methods

pure :: a -> Get a #

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

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

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

Applicative Put 

Methods

pure :: a -> Put a #

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

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

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

Applicative Get 

Methods

pure :: a -> Get a #

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

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

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

Applicative PutM 

Methods

pure :: a -> PutM a #

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

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

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

Applicative RGB 

Methods

pure :: a -> RGB a #

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

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

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

Applicative Tree 

Methods

pure :: a -> Tree a #

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

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

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

Applicative Seq 

Methods

pure :: a -> Seq a #

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

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

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

Applicative Interval 

Methods

pure :: a -> Interval a #

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

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

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

Applicative Vector 

Methods

pure :: a -> Vector a #

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

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

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

Applicative Quaternion 

Methods

pure :: a -> Quaternion a #

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

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

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

Applicative Plucker 

Methods

pure :: a -> Plucker a #

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

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

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

Applicative V4 

Methods

pure :: a -> V4 a #

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

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

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

Applicative V3 

Methods

pure :: a -> V3 a #

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

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

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

Applicative V2 

Methods

pure :: a -> V2 a #

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

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

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

Applicative V1 

Methods

pure :: a -> V1 a #

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

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

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

Applicative V0 

Methods

pure :: a -> V0 a #

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

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

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

Applicative ComplResult 

Methods

pure :: a -> ComplResult a #

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

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

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

Applicative P 

Methods

pure :: a -> P a #

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

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

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

Applicative Completion 

Methods

pure :: a -> Completion a #

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

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

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

Applicative ReadM 

Methods

pure :: a -> ReadM a #

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

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

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

Applicative Parser 

Methods

pure :: a -> Parser a #

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

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

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

Applicative ParserM 

Methods

pure :: a -> ParserM a #

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

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

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

Applicative ParserResult 
Applicative Chunk 

Methods

pure :: a -> Chunk a #

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

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

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

Applicative Id 

Methods

pure :: a -> Id a #

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

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

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

Applicative Box 

Methods

pure :: a -> Box a #

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

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

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

Applicative Stream 

Methods

pure :: a -> Stream a #

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

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

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

Applicative Angle # 

Methods

pure :: a -> Angle a #

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

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

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

Applicative ((->) a) 

Methods

pure :: a -> a -> a #

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

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

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

Applicative (Either e) 

Methods

pure :: a -> Either e a #

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

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

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

Applicative f => Applicative (Rec1 f) 

Methods

pure :: a -> Rec1 f a #

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

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

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

Monoid a => Applicative ((,) a) 

Methods

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

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

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

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

Representable f => Applicative (Co f) 

Methods

pure :: a -> Co f a #

(<*>) :: Co f (a -> b) -> Co f a -> Co f b #

(*>) :: Co f a -> Co f b -> Co f b #

(<*) :: Co f a -> Co f b -> Co f a #

Applicative (ST s) 

Methods

pure :: a -> ST s a #

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

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

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

Applicative (StateL s) 

Methods

pure :: a -> StateL s a #

(<*>) :: StateL s (a -> b) -> StateL s a -> StateL s b #

(*>) :: StateL s a -> StateL s b -> StateL s b #

(<*) :: StateL s a -> StateL s b -> StateL s a #

Applicative (StateR s) 

Methods

pure :: a -> StateR s a #

(<*>) :: StateR s (a -> b) -> StateR s a -> StateR s b #

(*>) :: StateR s a -> StateR s b -> StateR s b #

(<*) :: StateR s a -> StateR s b -> StateR s a #

Applicative (ST s) 

Methods

pure :: a -> ST s a #

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

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

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

Monad m => Applicative (WrappedMonad m) 

Methods

pure :: a -> WrappedMonad m a #

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

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

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

Arrow a => Applicative (ArrowMonad a) 

Methods

pure :: a -> ArrowMonad a a #

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

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

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

Applicative (Proxy *) 

Methods

pure :: a -> Proxy * a #

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

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

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

Applicative (StateL s) 

Methods

pure :: a -> StateL s a #

(<*>) :: StateL s (a -> b) -> StateL s a -> StateL s b #

(*>) :: StateL s a -> StateL s b -> StateL s b #

(<*) :: StateL s a -> StateL s b -> StateL s a #

Applicative (StateR s) 

Methods

pure :: a -> StateR s a #

(<*>) :: StateR s (a -> b) -> StateR s a -> StateR s b #

(*>) :: StateR s a -> StateR s b -> StateR s b #

(<*) :: StateR s a -> StateR s b -> StateR s a #

Applicative (State s) 

Methods

pure :: a -> State s a #

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

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

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

Applicative (Measured n) 

Methods

pure :: a -> Measured n a #

(<*>) :: Measured n (a -> b) -> Measured n a -> Measured n b #

(*>) :: Measured n a -> Measured n b -> Measured n b #

(<*) :: Measured n a -> Measured n b -> Measured n a #

Applicative f => Applicative (Point f) 

Methods

pure :: a -> Point f a #

(<*>) :: Point f (a -> b) -> Point f a -> Point f b #

(*>) :: Point f a -> Point f b -> Point f b #

(<*) :: Point f a -> Point f b -> Point f a #

Alternative f => Applicative (Cofree f) 

Methods

pure :: a -> Cofree f a #

(<*>) :: Cofree f (a -> b) -> Cofree f a -> Cofree f b #

(*>) :: Cofree f a -> Cofree f b -> Cofree f b #

(<*) :: Cofree f a -> Cofree f b -> Cofree f a #

Applicative f => Applicative (Yoneda f) 

Methods

pure :: a -> Yoneda f a #

(<*>) :: Yoneda f (a -> b) -> Yoneda f a -> Yoneda f b #

(*>) :: Yoneda f a -> Yoneda f b -> Yoneda f b #

(<*) :: Yoneda f a -> Yoneda f b -> Yoneda f a #

Applicative (ReifiedGetter s) 

Methods

pure :: a -> ReifiedGetter s a #

(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Applicative (ReifiedFold s) 

Methods

pure :: a -> ReifiedFold s a #

(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

Applicative f => Applicative (Indexing f) 

Methods

pure :: a -> Indexing f a #

(<*>) :: Indexing f (a -> b) -> Indexing f a -> Indexing f b #

(*>) :: Indexing f a -> Indexing f b -> Indexing f b #

(<*) :: Indexing f a -> Indexing f b -> Indexing f a #

Applicative f => Applicative (Indexing64 f) 

Methods

pure :: a -> Indexing64 f a #

(<*>) :: Indexing64 f (a -> b) -> Indexing64 f a -> Indexing64 f b #

(*>) :: Indexing64 f a -> Indexing64 f b -> Indexing64 f b #

(<*) :: Indexing64 f a -> Indexing64 f b -> Indexing64 f a #

Applicative m => Applicative (ListT m) 

Methods

pure :: a -> ListT m a #

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

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

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

Monad m => Applicative (ListT m) 

Methods

pure :: a -> ListT m a #

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

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

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

Monad m => Applicative (NondetT m) 

Methods

pure :: a -> NondetT m a #

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

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

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

(Applicative (Rep p), Representable p) => Applicative (Prep p) 

Methods

pure :: a -> Prep p a #

(<*>) :: Prep p (a -> b) -> Prep p a -> Prep p b #

(*>) :: Prep p a -> Prep p b -> Prep p b #

(<*) :: Prep p a -> Prep p b -> Prep p a #

Applicative f => Applicative (WrappedApplicative f) 
Apply f => Applicative (MaybeApply f) 

Methods

pure :: a -> MaybeApply f a #

(<*>) :: MaybeApply f (a -> b) -> MaybeApply f a -> MaybeApply f b #

(*>) :: MaybeApply f a -> MaybeApply f b -> MaybeApply f b #

(<*) :: MaybeApply f a -> MaybeApply f b -> MaybeApply f a #

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

Methods

pure :: a -> MaybeT m a #

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

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

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

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

Methods

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

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

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

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

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

Methods

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

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

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

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

Arrow a => Applicative (WrappedArrow a b) 

Methods

pure :: a -> WrappedArrow a b a #

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

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

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

Monoid m => Applicative (Const * m) 

Methods

pure :: a -> Const * m a #

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

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

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

Applicative f => Applicative (Alt * f) 

Methods

pure :: a -> Alt * f a #

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

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

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

Biapplicative p => Applicative (Join * p) 

Methods

pure :: a -> Join * p a #

(<*>) :: Join * p (a -> b) -> Join * p a -> Join * p b #

(*>) :: Join * p a -> Join * p b -> Join * p b #

(<*) :: Join * p a -> Join * p b -> Join * p a #

Applicative w => Applicative (TracedT m w) 

Methods

pure :: a -> TracedT m w a #

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

(*>) :: TracedT m w a -> TracedT m w b -> TracedT m w b #

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

Applicative (Cokleisli w a) 

Methods

pure :: a -> Cokleisli w a a #

(<*>) :: Cokleisli w a (a -> b) -> Cokleisli w a a -> Cokleisli w a b #

(*>) :: Cokleisli w a a -> Cokleisli w a b -> Cokleisli w a b #

(<*) :: Cokleisli w a a -> Cokleisli w a b -> Cokleisli w a a #

Applicative m => Applicative (IdentityT * m) 

Methods

pure :: a -> IdentityT * m a #

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

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

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

Applicative (Query v n) 

Methods

pure :: a -> Query v n a #

(<*>) :: Query v n (a -> b) -> Query v n a -> Query v n b #

(*>) :: Query v n a -> Query v n b -> Query v n b #

(<*) :: Query v n a -> Query v n b -> Query v n a #

(Functor f, Monad m) => Applicative (FreeT f m) 

Methods

pure :: a -> FreeT f m a #

(<*>) :: FreeT f m (a -> b) -> FreeT f m a -> FreeT f m b #

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

Methods

pure :: a -> Day f g a #

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

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

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

Applicative f => Applicative (Backwards * f)

Apply f-actions in the reverse order.

Methods

pure :: a -> Backwards * f a #

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

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

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

(Functor m, Monad m) => Applicative (ErrorT e m) 

Methods

pure :: a -> ErrorT e m a #

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

(*>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b #

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

Applicative (Indexed i a) 

Methods

pure :: a -> Indexed i a a #

(<*>) :: Indexed i a (a -> b) -> Indexed i a a -> Indexed i a b #

(*>) :: Indexed i a a -> Indexed i a b -> Indexed i a b #

(<*) :: Indexed i a a -> Indexed i a b -> Indexed i a a #

(Monad m, Monoid s) => Applicative (Focusing m s) 

Methods

pure :: a -> Focusing m s a #

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

(*>) :: Focusing m s a -> Focusing m s b -> Focusing m s b #

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

Applicative (k (May s)) => Applicative (FocusingMay k s) 

Methods

pure :: a -> FocusingMay k s a #

(<*>) :: FocusingMay k s (a -> b) -> FocusingMay k s a -> FocusingMay k s b #

(*>) :: FocusingMay k s a -> FocusingMay k s b -> FocusingMay k s b #

(<*) :: FocusingMay k s a -> FocusingMay k s b -> FocusingMay k s a #

(Monad m, Monoid r) => Applicative (Effect m r) 

Methods

pure :: a -> Effect m r a #

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

(*>) :: Effect m r a -> Effect m r b -> Effect m r b #

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

Dim k n => Applicative (V k n) 

Methods

pure :: a -> V k n a #

(<*>) :: V k n (a -> b) -> V k n a -> V k n b #

(*>) :: V k n a -> V k n b -> V k n b #

(<*) :: V k n a -> V k n b -> V k n a #

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

Methods

pure :: a -> ExceptT e m a #

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

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

Methods

pure :: a -> StateT s m a #

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

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

Methods

pure :: a -> StateT s m a #

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

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

Methods

pure :: a -> WriterT w m a #

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

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

Methods

pure :: a -> WriterT w m a #

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

(*>) :: 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 (Closure p a) 

Methods

pure :: a -> Closure p a a #

(<*>) :: Closure p a (a -> b) -> Closure p a a -> Closure p a b #

(*>) :: Closure p a a -> Closure p a b -> Closure p a b #

(<*) :: Closure p a a -> Closure p a b -> Closure p a a #

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

Methods

pure :: a -> Tambara p a a #

(<*>) :: Tambara p a (a -> b) -> Tambara p a a -> Tambara p a b #

(*>) :: Tambara p a a -> Tambara p a b -> Tambara p a b #

(<*) :: Tambara p a a -> Tambara p a b -> Tambara p a a #

Applicative f => Applicative (Star f a) 

Methods

pure :: a -> Star f a a #

(<*>) :: Star f a (a -> b) -> Star f a a -> Star f a b #

(*>) :: Star f a a -> Star f a b -> Star f a b #

(<*) :: Star f a a -> Star f a b -> Star f a a #

Applicative (Costar f a) 

Methods

pure :: a -> Costar f a a #

(<*>) :: Costar f a (a -> b) -> Costar f a a -> Costar f a b #

(*>) :: Costar f a a -> Costar f a b -> Costar f a b #

(<*) :: Costar f a a -> Costar f a b -> Costar f a a #

Applicative (Tagged k s) 

Methods

pure :: a -> Tagged k s a #

(<*>) :: Tagged k s (a -> b) -> Tagged k s a -> Tagged k s b #

(*>) :: Tagged k s a -> Tagged k s b -> Tagged k s b #

(<*) :: Tagged k s a -> Tagged k s b -> Tagged k s a #

Applicative f => Applicative (Reverse * f)

Derived instance.

Methods

pure :: a -> Reverse * f a #

(<*>) :: Reverse * f (a -> b) -> Reverse * f a -> Reverse * f b #

(*>) :: Reverse * f a -> Reverse * f b -> Reverse * f b #

(<*) :: Reverse * f a -> Reverse * f b -> Reverse * f a #

Monoid a => Applicative (Constant * a) 

Methods

pure :: a -> Constant * a a #

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

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

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

Applicative f => Applicative (M1 i c f) 

Methods

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

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

(*>) :: 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 (Product * f g) 

Methods

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

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

(*>) :: 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 m, Monoid s, Monoid w) => Applicative (FocusingWith w m s) 

Methods

pure :: a -> FocusingWith w m s a #

(<*>) :: FocusingWith w m s (a -> b) -> FocusingWith w m s a -> FocusingWith w m s b #

(*>) :: FocusingWith w m s a -> FocusingWith w m s b -> FocusingWith w m s b #

(<*) :: FocusingWith w m s a -> FocusingWith w m s b -> FocusingWith w m s a #

Applicative (k (s, w)) => Applicative (FocusingPlus w k s) 

Methods

pure :: a -> FocusingPlus w k s a #

(<*>) :: FocusingPlus w k s (a -> b) -> FocusingPlus w k s a -> FocusingPlus w k s b #

(*>) :: FocusingPlus w k s a -> FocusingPlus w k s b -> FocusingPlus w k s b #

(<*) :: FocusingPlus w k s a -> FocusingPlus w k s b -> FocusingPlus w k s a #

Applicative (k (f s)) => Applicative (FocusingOn f k s) 

Methods

pure :: a -> FocusingOn f k s a #

(<*>) :: FocusingOn f k s (a -> b) -> FocusingOn f k s a -> FocusingOn f k s b #

(*>) :: FocusingOn f k s a -> FocusingOn f k s b -> FocusingOn f k s b #

(<*) :: FocusingOn f k s a -> FocusingOn f k s b -> FocusingOn f k s a #

Applicative (k (Err e s)) => Applicative (FocusingErr e k s) 

Methods

pure :: a -> FocusingErr e k s a #

(<*>) :: FocusingErr e k s (a -> b) -> FocusingErr e k s a -> FocusingErr e k s b #

(*>) :: FocusingErr e k s a -> FocusingErr e k s b -> FocusingErr e k s b #

(<*) :: FocusingErr e k s a -> FocusingErr e k s b -> FocusingErr e k s a #

Applicative (ContT k r m) 

Methods

pure :: a -> ContT k r m a #

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

(*>) :: ContT k r m a -> ContT k r m b -> ContT k r m b #

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

Applicative m => Applicative (ReaderT * r m) 

Methods

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

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

(*>) :: 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 f, Applicative g) => Applicative (Compose * * f g) 

Methods

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

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

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

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

Applicative (k (Freed f m s)) => Applicative (FocusingFree f m k s) 

Methods

pure :: a -> FocusingFree f m k s a #

(<*>) :: FocusingFree f m k s (a -> b) -> FocusingFree f m k s a -> FocusingFree f m k s b #

(*>) :: FocusingFree f m k s a -> FocusingFree f m k s b -> FocusingFree f m k s b #

(<*) :: FocusingFree f m k s a -> FocusingFree f m k s b -> FocusingFree f m k s a #

(Monoid s, Monoid w, Monad m) => Applicative (EffectRWS w st m s) 

Methods

pure :: a -> EffectRWS w st m s a #

(<*>) :: EffectRWS w st m s (a -> b) -> EffectRWS w st m s a -> EffectRWS w st m s b #

(*>) :: EffectRWS w st m s a -> EffectRWS w st m s b -> EffectRWS w st m s b #

(<*) :: EffectRWS w st m s a -> EffectRWS w st m s b -> EffectRWS w st m s a #

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

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 #

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

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 #

(*>) :: 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 k s (ReifiedApplicative f) => Applicative (ReflectedApplicative k * f s) 

(*>) :: Applicative f => forall a b. f a -> f b -> f b #

Sequence actions, discarding the value of the first argument.

(<*) :: Applicative f => forall a b. f a -> f b -> f a #

Sequence actions, discarding the value of the second argument.

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

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)

(<$) :: Functor f => forall a b. a -> f b -> f a #

Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.

liftA :: Applicative f => (a -> b) -> f a -> f b #

Lift a function to actions. This function may be used as a value for fmap in a Functor instance.

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

Lift a binary function to actions.

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

Lift a ternary function to actions.