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

Copyright (c) 2011-2015 diagrams-lib team (see LICENSE) BSD-style (see LICENSE) diagrams-discuss@googlegroups.com None Haskell2010

Diagrams.Prelude

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:

• at
• contains
• .>
• <.>
• index
• indices
• none
• coerce
• indexed
• inside
• levels
• ...
• children
• transform
• outside
• argument
• beside
• singular

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: • u *> v = pure (const id) <*> u <*> v • u <* v = pure const <*> u <*> v As a consequence of these laws, the Functor instance for f will satisfy • fmap f x = pure f <*> x If f is also a Monad, it should satisfy • pure = return • (<*>) = ap (which implies that pure and <*> satisfy the applicative functor laws). Minimal complete definition Instances  Methodspure :: a -> [a] #(<*>) :: [a -> b] -> [a] -> [b] #(*>) :: [a] -> [b] -> [b] #(<*) :: [a] -> [b] -> [a] # Methodspure :: a -> Maybe a #(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b #(*>) :: Maybe a -> Maybe b -> Maybe b #(<*) :: Maybe a -> Maybe b -> Maybe a # Methodspure :: a -> IO a #(<*>) :: IO (a -> b) -> IO a -> IO b #(*>) :: IO a -> IO b -> IO b #(<*) :: IO a -> IO b -> IO a # Methodspure :: a -> U1 a #(<*>) :: U1 (a -> b) -> U1 a -> U1 b #(*>) :: U1 a -> U1 b -> U1 b #(<*) :: U1 a -> U1 b -> U1 a # Methodspure :: a -> Par1 a #(<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b #(*>) :: Par1 a -> Par1 b -> Par1 b #(<*) :: Par1 a -> Par1 b -> Par1 a # Methodspure :: a -> Q a #(<*>) :: Q (a -> b) -> Q a -> Q b #(*>) :: Q a -> Q b -> Q b #(<*) :: Q a -> Q b -> Q a # Methodspure :: a -> Active a #(<*>) :: Active (a -> b) -> Active a -> Active b #(*>) :: Active a -> Active b -> Active b #(<*) :: Active a -> Active b -> Active a # Methodspure :: a -> Duration a #(<*>) :: Duration (a -> b) -> Duration a -> Duration b #(*>) :: Duration a -> Duration b -> Duration b #(<*) :: Duration a -> Duration b -> Duration a # Methodspure :: a -> Concurrently a #(<*>) :: Concurrently (a -> b) -> Concurrently a -> Concurrently b #(*>) :: Concurrently a -> Concurrently b -> Concurrently b #(<*) :: Concurrently a -> Concurrently b -> Concurrently a # Methodspure :: a -> Id a #(<*>) :: Id (a -> b) -> Id a -> Id b #(*>) :: Id a -> Id b -> Id b #(<*) :: Id a -> Id b -> Id a # Methodspure :: a -> P a #(<*>) :: P (a -> b) -> P a -> P b #(*>) :: P a -> P b -> P b #(<*) :: P a -> P b -> P a # Methodspure :: a -> Identity a #(<*>) :: Identity (a -> b) -> Identity a -> Identity b #(*>) :: Identity a -> Identity b -> Identity b #(<*) :: Identity a -> Identity b -> Identity a # Methodspure :: a -> Min a #(<*>) :: Min (a -> b) -> Min a -> Min b #(*>) :: Min a -> Min b -> Min b #(<*) :: Min a -> Min b -> Min a # Methodspure :: a -> Max a #(<*>) :: Max (a -> b) -> Max a -> Max b #(*>) :: Max a -> Max b -> Max b #(<*) :: Max a -> Max b -> Max a # Methodspure :: a -> First a #(<*>) :: First (a -> b) -> First a -> First b #(*>) :: First a -> First b -> First b #(<*) :: First a -> First b -> First a # Methodspure :: a -> Last a #(<*>) :: Last (a -> b) -> Last a -> Last b #(*>) :: Last a -> Last b -> Last b #(<*) :: Last a -> Last b -> Last a # Methodspure :: a -> Option a #(<*>) :: Option (a -> b) -> Option a -> Option b #(*>) :: Option a -> Option b -> Option b #(<*) :: Option a -> Option b -> Option a # Methodspure :: a -> NonEmpty a #(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a # Methodspure :: a -> Complex a #(<*>) :: Complex (a -> b) -> Complex a -> Complex b #(*>) :: Complex a -> Complex b -> Complex b #(<*) :: Complex a -> Complex b -> Complex a # Methodspure :: a -> ZipList a #(<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b #(*>) :: ZipList a -> ZipList b -> ZipList b #(<*) :: ZipList a -> ZipList b -> ZipList a # Methodspure :: a -> STM a #(<*>) :: STM (a -> b) -> STM a -> STM b #(*>) :: STM a -> STM b -> STM b #(<*) :: STM a -> STM b -> STM a # Methodspure :: a -> Dual a #(<*>) :: Dual (a -> b) -> Dual a -> Dual b #(*>) :: Dual a -> Dual b -> Dual b #(<*) :: Dual a -> Dual b -> Dual a # Methodspure :: a -> Sum a #(<*>) :: Sum (a -> b) -> Sum a -> Sum b #(*>) :: Sum a -> Sum b -> Sum b #(<*) :: Sum a -> Sum b -> Sum a # Methodspure :: a -> Product a #(<*>) :: Product (a -> b) -> Product a -> Product b #(*>) :: Product a -> Product b -> Product b #(<*) :: Product a -> Product b -> Product a # Methodspure :: a -> First a #(<*>) :: First (a -> b) -> First a -> First b #(*>) :: First a -> First b -> First b #(<*) :: First a -> First b -> First a # Methodspure :: a -> Last a #(<*>) :: Last (a -> b) -> Last a -> Last b #(*>) :: Last a -> Last b -> Last b #(<*) :: Last a -> Last b -> Last a # Methodspure :: a -> ReadPrec a #(<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b #(*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b #(<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a # Methodspure :: a -> ReadP a #(<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b #(*>) :: ReadP a -> ReadP b -> ReadP b #(<*) :: ReadP a -> ReadP b -> ReadP a # Methodspure :: a -> Id a #(<*>) :: Id (a -> b) -> Id a -> Id b #(*>) :: Id a -> Id b -> Id b #(<*) :: Id a -> Id b -> Id a # Methodspure :: a -> Get a #(<*>) :: Get (a -> b) -> Get a -> Get b #(*>) :: Get a -> Get b -> Get b #(<*) :: Get a -> Get b -> Get a # Applicative Put Methodspure :: a -> Put a #(<*>) :: Put (a -> b) -> Put a -> Put b #(*>) :: Put a -> Put b -> Put b #(<*) :: Put a -> Put b -> Put a # Methodspure :: a -> Get a #(<*>) :: Get (a -> b) -> Get a -> Get b #(*>) :: Get a -> Get b -> Get b #(<*) :: Get a -> Get b -> Get a # Methodspure :: a -> PutM a #(<*>) :: PutM (a -> b) -> PutM a -> PutM b #(*>) :: PutM a -> PutM b -> PutM b #(<*) :: PutM a -> PutM b -> PutM a # Methodspure :: a -> RGB a #(<*>) :: RGB (a -> b) -> RGB a -> RGB b #(*>) :: RGB a -> RGB b -> RGB b #(<*) :: RGB a -> RGB b -> RGB a # Methodspure :: a -> Tree a #(<*>) :: Tree (a -> b) -> Tree a -> Tree b #(*>) :: Tree a -> Tree b -> Tree b #(<*) :: Tree a -> Tree b -> Tree a # Methodspure :: a -> Seq a #(<*>) :: Seq (a -> b) -> Seq a -> Seq b #(*>) :: Seq a -> Seq b -> Seq b #(<*) :: Seq a -> Seq b -> Seq a # Methodspure :: a -> Interval a #(<*>) :: Interval (a -> b) -> Interval a -> Interval b #(*>) :: Interval a -> Interval b -> Interval b #(<*) :: Interval a -> Interval b -> Interval a # Methodspure :: a -> Vector a #(<*>) :: Vector (a -> b) -> Vector a -> Vector b #(*>) :: Vector a -> Vector b -> Vector b #(<*) :: Vector a -> Vector b -> Vector a # Methodspure :: a -> Quaternion a #(<*>) :: Quaternion (a -> b) -> Quaternion a -> Quaternion b #(*>) :: Quaternion a -> Quaternion b -> Quaternion b #(<*) :: Quaternion a -> Quaternion b -> Quaternion a # Methodspure :: a -> Plucker a #(<*>) :: Plucker (a -> b) -> Plucker a -> Plucker b #(*>) :: Plucker a -> Plucker b -> Plucker b #(<*) :: Plucker a -> Plucker b -> Plucker a # Methodspure :: a -> V4 a #(<*>) :: V4 (a -> b) -> V4 a -> V4 b #(*>) :: V4 a -> V4 b -> V4 b #(<*) :: V4 a -> V4 b -> V4 a # Methodspure :: a -> V3 a #(<*>) :: V3 (a -> b) -> V3 a -> V3 b #(*>) :: V3 a -> V3 b -> V3 b #(<*) :: V3 a -> V3 b -> V3 a # Methodspure :: a -> V2 a #(<*>) :: V2 (a -> b) -> V2 a -> V2 b #(*>) :: V2 a -> V2 b -> V2 b #(<*) :: V2 a -> V2 b -> V2 a # Methodspure :: a -> V1 a #(<*>) :: V1 (a -> b) -> V1 a -> V1 b #(*>) :: V1 a -> V1 b -> V1 b #(<*) :: V1 a -> V1 b -> V1 a # Methodspure :: a -> V0 a #(<*>) :: V0 (a -> b) -> V0 a -> V0 b #(*>) :: V0 a -> V0 b -> V0 b #(<*) :: V0 a -> V0 b -> V0 a # Applicative ComplResult Methodspure :: a -> ComplResult a #(<*>) :: ComplResult (a -> b) -> ComplResult a -> ComplResult b #(*>) :: ComplResult a -> ComplResult b -> ComplResult b #(<*) :: ComplResult a -> ComplResult b -> ComplResult a # Methodspure :: a -> P a #(<*>) :: P (a -> b) -> P a -> P b #(*>) :: P a -> P b -> P b #(<*) :: P a -> P b -> P a # Methodspure :: a -> Completion a #(<*>) :: Completion (a -> b) -> Completion a -> Completion b #(*>) :: Completion a -> Completion b -> Completion b #(<*) :: Completion a -> Completion b -> Completion a # Methodspure :: a -> ReadM a #(<*>) :: ReadM (a -> b) -> ReadM a -> ReadM b #(*>) :: ReadM a -> ReadM b -> ReadM b #(<*) :: ReadM a -> ReadM b -> ReadM a # Methodspure :: a -> Parser a #(<*>) :: Parser (a -> b) -> Parser a -> Parser b #(*>) :: Parser a -> Parser b -> Parser b #(<*) :: Parser a -> Parser b -> Parser a # Methodspure :: a -> ParserM a #(<*>) :: ParserM (a -> b) -> ParserM a -> ParserM b #(*>) :: ParserM a -> ParserM b -> ParserM b #(<*) :: ParserM a -> ParserM b -> ParserM a # Methodspure :: a -> ParserResult a #(<*>) :: ParserResult (a -> b) -> ParserResult a -> ParserResult b #(*>) :: ParserResult a -> ParserResult b -> ParserResult b #(<*) :: ParserResult a -> ParserResult b -> ParserResult a # Methodspure :: a -> Chunk a #(<*>) :: Chunk (a -> b) -> Chunk a -> Chunk b #(*>) :: Chunk a -> Chunk b -> Chunk b #(<*) :: Chunk a -> Chunk b -> Chunk a # Methodspure :: a -> Id a #(<*>) :: Id (a -> b) -> Id a -> Id b #(*>) :: Id a -> Id b -> Id b #(<*) :: Id a -> Id b -> Id a # Methodspure :: a -> Box a #(<*>) :: Box (a -> b) -> Box a -> Box b #(*>) :: Box a -> Box b -> Box b #(<*) :: Box a -> Box b -> Box a # Applicative Stream Methodspure :: a -> Stream a #(<*>) :: Stream (a -> b) -> Stream a -> Stream b #(*>) :: Stream a -> Stream b -> Stream b #(<*) :: Stream a -> Stream b -> Stream a # # Methodspure :: a -> Angle a #(<*>) :: Angle (a -> b) -> Angle a -> Angle b #(*>) :: Angle a -> Angle b -> Angle b #(<*) :: Angle a -> Angle b -> Angle a # Applicative ((->) a) Methodspure :: a -> a -> a #(<*>) :: (a -> a -> b) -> (a -> a) -> a -> b #(*>) :: (a -> a) -> (a -> b) -> a -> b #(<*) :: (a -> a) -> (a -> b) -> a -> a # Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Methodspure :: 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 # Methodspure :: 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 # Methodspure :: 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 # Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Methodspure :: a -> WrappedApplicative f a #(<*>) :: WrappedApplicative f (a -> b) -> WrappedApplicative f a -> WrappedApplicative f b #(*>) :: WrappedApplicative f a -> WrappedApplicative f b -> WrappedApplicative f b #(<*) :: WrappedApplicative f a -> WrappedApplicative f b -> WrappedApplicative f a # Apply f => Applicative (MaybeApply f) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Apply f-actions in the reverse order. Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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 # Derived instance. Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: 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) Methodspure :: a -> RWST r w s m a #(<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b #(*>) :: 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) Methodspure :: a -> RWST r w s m a #(<*>) :: RWST r w s m (a -> b) -> RWST r w s m a -> RWST r w s m b #(*>) :: 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) Methodspure :: a -> ReflectedApplicative k * f s a #(<*>) :: ReflectedApplicative k * f s (a -> b) -> ReflectedApplicative k * f s a -> ReflectedApplicative k * f s b #(*>) :: ReflectedApplicative k * f s a -> ReflectedApplicative k * f s b -> ReflectedApplicative k * f s b #(<*) :: ReflectedApplicative k * f s a -> ReflectedApplicative k * f s b -> ReflectedApplicative k * f s a # (*>) :: 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.