incipit-base-0.5.1.0: A Prelude for Polysemy – Base Reexports

Incipit.Base

Description

Reexports from base.

Synopsis

# Documentation

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

A functor with application, providing operations to

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

A minimal complete definition must include implementations of pure and of either <*> or liftA2. If it defines both, then they must behave the same as their default definitions:

(<*>) = liftA2 id
liftA2 f x y = f <$> x <*> y Further, any definition must satisfy the following: Identity pure id <*> v = v Composition pure (.) <*> u <*> v <*> w = u <*> (v <*> w) Homomorphism pure f <*> pure x = pure (f x) Interchange u <*> pure y = pure ($ y) <*> u

The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:

• u *> v = (id <$ u) <*> v • u <* v = liftA2 const u v As a consequence of these laws, the Functor instance for f will satisfy • fmap f x = pure f <*> x It may be useful to note that supposing forall x y. p (q x y) = f x . g y it follows from the above that liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v If f is also a Monad, it should satisfy • pure = return • m1 <*> m2 = m1 >>= (\x1 -> m2 >>= (\x2 -> return (x1 x2))) • (*>) = (>>) (which implies that pure and <*> satisfy the applicative functor laws). Minimal complete definition pure, ((<*>) | liftA2) Methods pure :: a -> f a Source # Lift a value. (<*>) :: f (a -> b) -> f a -> f b infixl 4 Source # Sequential application. A few functors support an implementation of <*> that is more efficient than the default one. #### Example Expand Used in combination with (<$>), (<*>) can be used to build a record.

>>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}

>>> produceFoo :: Applicative f => f Foo

>>> produceBar :: Applicative f => f Bar
>>> produceBaz :: Applicative f => f Baz

>>> mkState :: Applicative f => f MyState
>>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz  liftA2 :: (a -> b -> c) -> f a -> f b -> f c Source # Lift a binary function to actions. Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>. This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap. #### Example Expand >>> liftA2 (,) (Just 3) (Just 5) Just (3,5)  (*>) :: f a -> f b -> f b infixl 4 Source # Sequence actions, discarding the value of the first argument. #### Examples Expand If used in conjunction with the Applicative instance for Maybe, you can chain Maybe computations, with a possible "early return" in case of Nothing. >>> Just 2 *> Just 3 Just 3  >>> Nothing *> Just 3 Nothing  Of course a more interesting use case would be to have effectful computations instead of just returning pure values. >>> import Data.Char >>> import Text.ParserCombinators.ReadP >>> let p = string "my name is " *> munch1 isAlpha <* eof >>> readP_to_S p "my name is Simon" [("Simon","")]  (<*) :: f a -> f b -> f a infixl 4 Source # Sequence actions, discarding the value of the second argument. #### Instances Instances details  f <$> ZipList xs1 <*> ... <*> ZipList xsN = ZipList (zipWithN f xs1 ... xsN)where zipWithN refers to the zipWith function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example:(\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..] = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..]) = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}Since: base-2.1 Instance detailsDefined in Control.Applicative Methodspure :: a -> ZipList a Source #(<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b Source #liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source #(*>) :: ZipList a -> ZipList b -> ZipList b Source #(<*) :: ZipList a -> ZipList b -> ZipList a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Complex Methodspure :: a -> Complex a Source #(<*>) :: Complex (a -> b) -> Complex a -> Complex b Source #liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c Source #(*>) :: Complex a -> Complex b -> Complex b Source #(<*) :: Complex a -> Complex b -> Complex a Source # Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methodspure :: a -> Identity a Source #(<*>) :: Identity (a -> b) -> Identity a -> Identity b Source #liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source #(*>) :: Identity a -> Identity b -> Identity b Source #(<*) :: Identity a -> Identity b -> Identity a Source # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methodspure :: a -> First a Source #(<*>) :: First (a -> b) -> First a -> First b Source #liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source #(*>) :: First a -> First b -> First b Source #(<*) :: First a -> First b -> First a Source # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methodspure :: a -> Last a Source #(<*>) :: Last (a -> b) -> Last a -> Last b Source #liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source #(*>) :: Last a -> Last b -> Last b Source #(<*) :: Last a -> Last b -> Last a Source # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methodspure :: a -> Down a Source #(<*>) :: Down (a -> b) -> Down a -> Down b Source #liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c Source #(*>) :: Down a -> Down b -> Down b Source #(<*) :: Down a -> Down b -> Down a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> First a Source #(<*>) :: First (a -> b) -> First a -> First b Source #liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source #(*>) :: First a -> First b -> First b Source #(<*) :: First a -> First b -> First a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Last a Source #(<*>) :: Last (a -> b) -> Last a -> Last b Source #liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source #(*>) :: Last a -> Last b -> Last b Source #(<*) :: Last a -> Last b -> Last a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Max a Source #(<*>) :: Max (a -> b) -> Max a -> Max b Source #liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c Source #(*>) :: Max a -> Max b -> Max b Source #(<*) :: Max a -> Max b -> Max a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodspure :: a -> Min a Source #(<*>) :: Min (a -> b) -> Min a -> Min b Source #liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c Source #(*>) :: Min a -> Min b -> Min b Source #(<*) :: Min a -> Min b -> Min a Source # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> Par1 a Source #(<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b Source #liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c Source #(*>) :: Par1 a -> Par1 b -> Par1 b Source #(<*) :: Par1 a -> Par1 b -> Par1 a Source # Since: base-4.5.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methodspure :: a -> P a Source #(<*>) :: P (a -> b) -> P a -> P b Source #liftA2 :: (a -> b -> c) -> P a -> P b -> P c Source #(*>) :: P a -> P b -> P b Source #(<*) :: P a -> P b -> P a Source # Since: base-4.6.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methodspure :: a -> ReadP a Source #(<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b Source #liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c Source #(*>) :: ReadP a -> ReadP b -> ReadP b Source #(<*) :: ReadP a -> ReadP b -> ReadP a Source # Since: containers-0.5.4 Instance detailsDefined in Data.Sequence.Internal Methodspure :: a -> Seq a Source #(<*>) :: Seq (a -> b) -> Seq a -> Seq b Source #liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c Source #(*>) :: Seq a -> Seq b -> Seq b Source #(<*) :: Seq a -> Seq b -> Seq a Source # Instance detailsDefined in Data.DList.Internal Methodspure :: a -> DList a Source #(<*>) :: DList (a -> b) -> DList a -> DList b Source #liftA2 :: (a -> b -> c) -> DList a -> DList b -> DList c Source #(*>) :: DList a -> DList b -> DList b Source #(<*) :: DList a -> DList b -> DList a Source # Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a -> IO a Source #(<*>) :: IO (a -> b) -> IO a -> IO b Source #liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c Source #(*>) :: IO a -> IO b -> IO b Source #(<*) :: IO a -> IO b -> IO a Source # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodspure :: a -> NonEmpty a Source #(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b Source #liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c Source #(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b Source #(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a Source # Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a -> Maybe a Source #(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b Source #liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c Source #(*>) :: Maybe a -> Maybe b -> Maybe b Source #(<*) :: Maybe a -> Maybe b -> Maybe a Source # Since: base-4.15 Instance detailsDefined in GHC.Base Methodspure :: a -> Solo a Source #(<*>) :: Solo (a -> b) -> Solo a -> Solo b Source #liftA2 :: (a -> b -> c) -> Solo a -> Solo b -> Solo c Source #(*>) :: Solo a -> Solo b -> Solo b Source #(<*) :: Solo a -> Solo b -> Solo a Source # Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a -> [a] Source #(<*>) :: [a -> b] -> [a] -> [b] Source #liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] Source #(*>) :: [a] -> [b] -> [b] Source #(<*) :: [a] -> [b] -> [a] Source # Monad m => Applicative (WrappedMonad m) Since: base-2.1 Instance detailsDefined in Control.Applicative Methodspure :: a -> WrappedMonad m a Source #(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source #liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source #(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source #(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a Source # Arrow a => Applicative (ArrowMonad a) Since: base-4.6.0.0 Instance detailsDefined in Control.Arrow Methodspure :: a0 -> ArrowMonad a a0 Source #(<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b Source #liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c Source #(*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source #(<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 Source # Since: base-3.0 Instance detailsDefined in Data.Either Methodspure :: a -> Either e a Source #(<*>) :: Either e (a -> b) -> Either e a -> Either e b Source #liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c Source #(*>) :: Either e a -> Either e b -> Either e b Source #(<*) :: Either e a -> Either e b -> Either e a Source # Applicative (Proxy :: Type -> Type) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methodspure :: a -> Proxy a Source #(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b Source #liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c Source #(*>) :: Proxy a -> Proxy b -> Proxy b Source #(<*) :: Proxy a -> Proxy b -> Proxy a Source # Applicative (U1 :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> U1 a Source #(<*>) :: U1 (a -> b) -> U1 a -> U1 b Source #liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c Source #(*>) :: U1 a -> U1 b -> U1 b Source #(<*) :: U1 a -> U1 b -> U1 a Source # Monoid a => Applicative ((,) a) For tuples, the Monoid constraint on a determines how the first values merge. For example, Strings concatenate:("hello ", (+15)) <*> ("world!", 2002) ("hello world!",2017)Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a0 -> (a, a0) Source #(<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) Source #liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) Source #(*>) :: (a, a0) -> (a, b) -> (a, b) Source #(<*) :: (a, a0) -> (a, b) -> (a, a0) Source # Arrow a => Applicative (WrappedArrow a b) Since: base-2.1 Instance detailsDefined in Control.Applicative Methodspure :: a0 -> WrappedArrow a b a0 Source #(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source #(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source #(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source # Applicative m => Applicative (Kleisli m a) Since: base-4.14.0.0 Instance detailsDefined in Control.Arrow Methodspure :: a0 -> Kleisli m a a0 Source #(<*>) :: Kleisli m a (a0 -> b) -> Kleisli m a a0 -> Kleisli m a b Source #liftA2 :: (a0 -> b -> c) -> Kleisli m a a0 -> Kleisli m a b -> Kleisli m a c Source #(*>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b Source #(<*) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a a0 Source # Monoid m => Applicative (Const m :: Type -> Type) Since: base-2.0.1 Instance detailsDefined in Data.Functor.Const Methodspure :: a -> Const m a Source #(<*>) :: Const m (a -> b) -> Const m a -> Const m b Source #liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source #(*>) :: Const m a -> Const m b -> Const m b Source #(<*) :: Const m a -> Const m b -> Const m a Source # Applicative f => Applicative (Ap f) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methodspure :: a -> Ap f a Source #(<*>) :: Ap f (a -> b) -> Ap f a -> Ap f b Source #liftA2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c Source #(*>) :: Ap f a -> Ap f b -> Ap f b Source #(<*) :: Ap f a -> Ap f b -> Ap f a Source # (Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f) Since: base-4.17.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> Generically1 f a Source #(<*>) :: Generically1 f (a -> b) -> Generically1 f a -> Generically1 f b Source #liftA2 :: (a -> b -> c) -> Generically1 f a -> Generically1 f b -> Generically1 f c Source #(*>) :: Generically1 f a -> Generically1 f b -> Generically1 f b Source #(<*) :: Generically1 f a -> Generically1 f b -> Generically1 f a Source # Applicative f => Applicative (Rec1 f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> Rec1 f a Source #(<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b Source #liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c Source #(*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b Source #(<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a Source # (Applicative f, Monad f) => Applicative (WhenMissing f x) Equivalent to ReaderT k (ReaderT x (MaybeT f)).Since: containers-0.5.9 Instance detailsDefined in Data.IntMap.Internal Methodspure :: a -> WhenMissing f x a Source #(<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b Source #liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c Source #(*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b Source #(<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a Source # (Monoid a, Monoid b) => Applicative ((,,) a b) Since: base-4.14.0.0 Instance detailsDefined in GHC.Base Methodspure :: a0 -> (a, b, a0) Source #(<*>) :: (a, b, a0 -> b0) -> (a, b, a0) -> (a, b, b0) Source #liftA2 :: (a0 -> b0 -> c) -> (a, b, a0) -> (a, b, b0) -> (a, b, c) Source #(*>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) Source #(<*) :: (a, b, a0) -> (a, b, b0) -> (a, b, a0) Source # (Applicative f, Applicative g) => Applicative (Product f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methodspure :: a -> Product f g a Source #(<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b Source #liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c Source #(*>) :: Product f g a -> Product f g b -> Product f g b Source #(<*) :: Product f g a -> Product f g b -> Product f g a Source # (Applicative f, Applicative g) => Applicative (f :*: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> (f :*: g) a Source #(<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b Source #liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c Source #(*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b Source #(<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a Source # Monoid c => Applicative (K1 i c :: Type -> Type) Since: base-4.12.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> K1 i c a Source #(<*>) :: K1 i c (a -> b) -> K1 i c a -> K1 i c b Source #liftA2 :: (a -> b -> c0) -> K1 i c a -> K1 i c b -> K1 i c c0 Source #(*>) :: K1 i c a -> K1 i c b -> K1 i c b Source #(<*) :: K1 i c a -> K1 i c b -> K1 i c a Source # (Monad f, Applicative f) => Applicative (WhenMatched f x y) Equivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))Since: containers-0.5.9 Instance detailsDefined in Data.IntMap.Internal Methodspure :: a -> WhenMatched f x y a Source #(<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b Source #liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c Source #(*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b Source #(<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a Source # (Applicative f, Monad f) => Applicative (WhenMissing f k x) Equivalent to  ReaderT k (ReaderT x (MaybeT f)) .Since: containers-0.5.9 Instance detailsDefined in Data.Map.Internal Methodspure :: a -> WhenMissing f k x a Source #(<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b Source #liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c Source #(*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b Source #(<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a Source # (Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c) Since: base-4.14.0.0 Instance detailsDefined in GHC.Base Methodspure :: a0 -> (a, b, c, a0) Source #(<*>) :: (a, b, c, a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) Source #liftA2 :: (a0 -> b0 -> c0) -> (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, c0) Source #(*>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) Source #(<*) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, a0) Source # Applicative ((->) r) Since: base-2.1 Instance detailsDefined in GHC.Base Methodspure :: a -> r -> a Source #(<*>) :: (r -> (a -> b)) -> (r -> a) -> r -> b Source #liftA2 :: (a -> b -> c) -> (r -> a) -> (r -> b) -> r -> c Source #(*>) :: (r -> a) -> (r -> b) -> r -> b Source #(<*) :: (r -> a) -> (r -> b) -> r -> a Source # (Applicative f, Applicative g) => Applicative (Compose f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Compose Methodspure :: a -> Compose f g a Source #(<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b Source #liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c Source #(*>) :: Compose f g a -> Compose f g b -> Compose f g b Source #(<*) :: Compose f g a -> Compose f g b -> Compose f g a Source # (Applicative f, Applicative g) => Applicative (f :.: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> (f :.: g) a Source #(<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b Source #liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c Source #(*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b Source #(<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a Source # Applicative f => Applicative (M1 i c f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodspure :: a -> M1 i c f a Source #(<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b Source #liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 Source #(*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source #(<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a Source # (Monad f, Applicative f) => Applicative (WhenMatched f k x y) Equivalent to  ReaderT k (ReaderT x (ReaderT y (MaybeT f))) Since: containers-0.5.9 Instance detailsDefined in Data.Map.Internal Methodspure :: a -> WhenMatched f k x y a Source #(<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b Source #liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c Source #(*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b Source #(<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a Source # class Applicative f => Alternative (f :: Type -> Type) where Source # A monoid on applicative functors. If defined, some and many should be the least solutions of the equations: • some v = (:) <$> v <*> many v
• many v = some v <|> pure []

Minimal complete definition

Methods

empty :: f a Source #

The identity of <|>

(<|>) :: f a -> f a -> f a infixl 3 Source #

An associative binary operation

some :: f a -> f [a] Source #

One or more.

many :: f a -> f [a] Source #

Zero or more.

#### Instances

Instances details

newtype Const a (b :: k) Source #

The Const functor.

Constructors

 Const FieldsgetConst :: a

#### Instances

Instances details
 Generic1 (Const a :: k -> Type) Instance detailsDefined in Data.Functor.Const Associated Typestype Rep1 (Const a) :: k -> Type Source # Methodsfrom1 :: forall (a0 :: k0). Const a a0 -> Rep1 (Const a) a0 Source #to1 :: forall (a0 :: k0). Rep1 (Const a) a0 -> Const a a0 Source # Bifunctor (Const :: Type -> Type -> Type) Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d Source #first :: (a -> b) -> Const a c -> Const b c Source #second :: (b -> c) -> Const a b -> Const a c Source # Foldable (Const m :: Type -> Type) Since: base-4.7.0.0 Instance detailsDefined in Data.Functor.Const Methodsfold :: Monoid m0 => Const m m0 -> m0 Source #foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #foldMap' :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #foldr :: (a -> b -> b) -> b -> Const m a -> b Source #foldr' :: (a -> b -> b) -> b -> Const m a -> b Source #foldl :: (b -> a -> b) -> b -> Const m a -> b Source #foldl' :: (b -> a -> b) -> b -> Const m a -> b Source #foldr1 :: (a -> a -> a) -> Const m a -> a Source #foldl1 :: (a -> a -> a) -> Const m a -> a Source #toList :: Const m a -> [a] Source #null :: Const m a -> Bool Source #length :: Const m a -> Int Source #elem :: Eq a => a -> Const m a -> Bool Source #maximum :: Ord a => Const m a -> a Source #minimum :: Ord a => Const m a -> a Source #sum :: Num a => Const m a -> a Source #product :: Num a => Const m a -> a Source # Contravariant (Const a :: Type -> Type) Instance detailsDefined in Data.Functor.Contravariant Methodscontramap :: (a' -> a0) -> Const a a0 -> Const a a' Source #(>$) :: b -> Const a b -> Const a a0 Source # Traversable (Const m :: Type -> Type) Since: base-4.7.0.0 Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) Source #sequenceA :: Applicative f => Const m (f a) -> f (Const m a) Source #mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) Source #sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) Source # Monoid m => Applicative (Const m :: Type -> Type) Since: base-2.0.1 Instance detailsDefined in Data.Functor.Const Methodspure :: a -> Const m a Source #(<*>) :: Const m (a -> b) -> Const m a -> Const m b Source #liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source #(*>) :: Const m a -> Const m b -> Const m b Source #(<*) :: Const m a -> Const m b -> Const m a Source # Functor (Const m :: Type -> Type) Since: base-2.1 Instance detailsDefined in Data.Functor.Const Methodsfmap :: (a -> b) -> Const m a -> Const m b Source #(<$) :: a -> Const m b -> Const m a Source # IsString a => IsString (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.String MethodsfromString :: String -> Const a b Source # Storable a => Storable (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const MethodssizeOf :: Const a b -> Int Source #alignment :: Const a b -> Int Source #peekElemOff :: Ptr (Const a b) -> Int -> IO (Const a b) Source #pokeElemOff :: Ptr (Const a b) -> Int -> Const a b -> IO () Source #peekByteOff :: Ptr b0 -> Int -> IO (Const a b) Source #pokeByteOff :: Ptr b0 -> Int -> Const a b -> IO () Source #peek :: Ptr (Const a b) -> IO (Const a b) Source #poke :: Ptr (Const a b) -> Const a b -> IO () Source # Monoid a => Monoid (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodsmempty :: Const a b Source #mappend :: Const a b -> Const a b -> Const a b Source #mconcat :: [Const a b] -> Const a b Source # Semigroup a => Semigroup (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(<>) :: Const a b -> Const a b -> Const a b Source #sconcat :: NonEmpty (Const a b) -> Const a b Source #stimes :: Integral b0 => b0 -> Const a b -> Const a b Source # Bits a => Bits (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(.&.) :: Const a b -> Const a b -> Const a b Source #(.|.) :: Const a b -> Const a b -> Const a b Source #xor :: Const a b -> Const a b -> Const a b Source #complement :: Const a b -> Const a b Source #shift :: Const a b -> Int -> Const a b Source #rotate :: Const a b -> Int -> Const a b Source #zeroBits :: Const a b Source #bit :: Int -> Const a b Source #setBit :: Const a b -> Int -> Const a b Source #clearBit :: Const a b -> Int -> Const a b Source #complementBit :: Const a b -> Int -> Const a b Source #testBit :: Const a b -> Int -> Bool Source #bitSizeMaybe :: Const a b -> Maybe Int Source #bitSize :: Const a b -> Int Source #isSigned :: Const a b -> Bool Source #shiftL :: Const a b -> Int -> Const a b Source #unsafeShiftL :: Const a b -> Int -> Const a b Source #shiftR :: Const a b -> Int -> Const a b Source #unsafeShiftR :: Const a b -> Int -> Const a b Source #rotateL :: Const a b -> Int -> Const a b Source #rotateR :: Const a b -> Int -> Const a b Source #popCount :: Const a b -> Int Source # FiniteBits a => FiniteBits (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const MethodsfiniteBitSize :: Const a b -> Int Source #countLeadingZeros :: Const a b -> Int Source # Bounded a => Bounded (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const MethodsminBound :: Const a b Source #maxBound :: Const a b Source # Enum a => Enum (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodssucc :: Const a b -> Const a b Source #pred :: Const a b -> Const a b Source #toEnum :: Int -> Const a b Source #fromEnum :: Const a b -> Int Source #enumFrom :: Const a b -> [Const a b] Source #enumFromThen :: Const a b -> Const a b -> [Const a b] Source #enumFromTo :: Const a b -> Const a b -> [Const a b] Source #enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] Source # Floating a => Floating (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodspi :: Const a b Source #exp :: Const a b -> Const a b Source #log :: Const a b -> Const a b Source #sqrt :: Const a b -> Const a b Source #(**) :: Const a b -> Const a b -> Const a b Source #logBase :: Const a b -> Const a b -> Const a b Source #sin :: Const a b -> Const a b Source #cos :: Const a b -> Const a b Source #tan :: Const a b -> Const a b Source #asin :: Const a b -> Const a b Source #acos :: Const a b -> Const a b Source #atan :: Const a b -> Const a b Source #sinh :: Const a b -> Const a b Source #cosh :: Const a b -> Const a b Source #tanh :: Const a b -> Const a b Source #asinh :: Const a b -> Const a b Source #acosh :: Const a b -> Const a b Source #atanh :: Const a b -> Const a b Source #log1p :: Const a b -> Const a b Source #expm1 :: Const a b -> Const a b Source #log1pexp :: Const a b -> Const a b Source #log1mexp :: Const a b -> Const a b Source # RealFloat a => RealFloat (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const MethodsfloatRadix :: Const a b -> Integer Source #floatDigits :: Const a b -> Int Source #floatRange :: Const a b -> (Int, Int) Source #decodeFloat :: Const a b -> (Integer, Int) Source #encodeFloat :: Integer -> Int -> Const a b Source #exponent :: Const a b -> Int Source #significand :: Const a b -> Const a b Source #scaleFloat :: Int -> Const a b -> Const a b Source #isNaN :: Const a b -> Bool Source #isInfinite :: Const a b -> Bool Source #isDenormalized :: Const a b -> Bool Source #isNegativeZero :: Const a b -> Bool Source #isIEEE :: Const a b -> Bool Source #atan2 :: Const a b -> Const a b -> Const a b Source # Generic (Const a b) Instance detailsDefined in Data.Functor.Const Associated Typestype Rep (Const a b) :: Type -> Type Source # Methodsfrom :: Const a b -> Rep (Const a b) x Source #to :: Rep (Const a b) x -> Const a b Source # Ix a => Ix (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodsrange :: (Const a b, Const a b) -> [Const a b] Source #index :: (Const a b, Const a b) -> Const a b -> Int Source #unsafeIndex :: (Const a b, Const a b) -> Const a b -> Int Source #inRange :: (Const a b, Const a b) -> Const a b -> Bool Source #rangeSize :: (Const a b, Const a b) -> Int Source #unsafeRangeSize :: (Const a b, Const a b) -> Int Source # Num a => Num (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(+) :: Const a b -> Const a b -> Const a b Source #(-) :: Const a b -> Const a b -> Const a b Source #(*) :: Const a b -> Const a b -> Const a b Source #negate :: Const a b -> Const a b Source #abs :: Const a b -> Const a b Source #signum :: Const a b -> Const a b Source # Read a => Read (Const a b) This instance would be equivalent to the derived instances of the Const newtype if the getConst field were removedSince: base-4.8.0.0 Instance detailsDefined in Data.Functor.Const MethodsreadsPrec :: Int -> ReadS (Const a b) Source #readList :: ReadS [Const a b] Source #readPrec :: ReadPrec (Const a b) Source # Fractional a => Fractional (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(/) :: Const a b -> Const a b -> Const a b Source #recip :: Const a b -> Const a b Source # Integral a => Integral (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodsquot :: Const a b -> Const a b -> Const a b Source #rem :: Const a b -> Const a b -> Const a b Source #div :: Const a b -> Const a b -> Const a b Source #mod :: Const a b -> Const a b -> Const a b Source #quotRem :: Const a b -> Const a b -> (Const a b, Const a b) Source #divMod :: Const a b -> Const a b -> (Const a b, Const a b) Source #toInteger :: Const a b -> Integer Source # Real a => Real (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const MethodstoRational :: Const a b -> Rational Source # RealFrac a => RealFrac (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const MethodsproperFraction :: Integral b0 => Const a b -> (b0, Const a b) Source #truncate :: Integral b0 => Const a b -> b0 Source #round :: Integral b0 => Const a b -> b0 Source #ceiling :: Integral b0 => Const a b -> b0 Source #floor :: Integral b0 => Const a b -> b0 Source # Show a => Show (Const a b) This instance would be equivalent to the derived instances of the Const newtype if the getConst field were removedSince: base-4.8.0.0 Instance detailsDefined in Data.Functor.Const MethodsshowsPrec :: Int -> Const a b -> ShowS Source #show :: Const a b -> String Source #showList :: [Const a b] -> ShowS Source # Eq a => Eq (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(==) :: Const a b -> Const a b -> Bool Source #(/=) :: Const a b -> Const a b -> Bool Source # Ord a => Ord (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methodscompare :: Const a b -> Const a b -> Ordering Source #(<) :: Const a b -> Const a b -> Bool Source #(<=) :: Const a b -> Const a b -> Bool Source #(>) :: Const a b -> Const a b -> Bool Source #(>=) :: Const a b -> Const a b -> Bool Source #max :: Const a b -> Const a b -> Const a b Source #min :: Const a b -> Const a b -> Const a b Source # type Rep1 (Const a :: k -> Type) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const type Rep1 (Const a :: k -> Type) = D1 ('MetaData "Const" "Data.Functor.Const" "base" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) type Rep (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const type Rep (Const a b) = D1 ('MetaData "Const" "Data.Functor.Const" "base" 'True) (C1 ('MetaCons "Const" 'PrefixI 'True) (S1 ('MetaSel ('Just "getConst") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

newtype ZipList a Source #

Lists, but with an Applicative functor based on zipping.

Constructors

 ZipList FieldsgetZipList :: [a]

#### Instances

Instances details
 Since: base-4.9.0.0 Instance detailsDefined in Control.Applicative Methodsfold :: Monoid m => ZipList m -> m Source #foldMap :: Monoid m => (a -> m) -> ZipList a -> m Source #foldMap' :: Monoid m => (a -> m) -> ZipList a -> m Source #foldr :: (a -> b -> b) -> b -> ZipList a -> b Source #foldr' :: (a -> b -> b) -> b -> ZipList a -> b Source #foldl :: (b -> a -> b) -> b -> ZipList a -> b Source #foldl' :: (b -> a -> b) -> b -> ZipList a -> b Source #foldr1 :: (a -> a -> a) -> ZipList a -> a Source #foldl1 :: (a -> a -> a) -> ZipList a -> a Source #toList :: ZipList a -> [a] Source #null :: ZipList a -> Bool Source #length :: ZipList a -> Int Source #elem :: Eq a => a -> ZipList a -> Bool Source #maximum :: Ord a => ZipList a -> a Source #minimum :: Ord a => ZipList a -> a Source #sum :: Num a => ZipList a -> a Source #product :: Num a => ZipList a -> a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) Source #sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) Source #mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) Source #sequence :: Monad m => ZipList (m a) -> m (ZipList a) Source # Since: base-4.11.0.0 Instance detailsDefined in Control.Applicative Methods(<|>) :: ZipList a -> ZipList a -> ZipList a Source #some :: ZipList a -> ZipList [a] Source #many :: ZipList a -> ZipList [a] Source # f <$> ZipList xs1 <*> ... <*> ZipList xsN = ZipList (zipWithN f xs1 ... xsN)where zipWithN refers to the zipWith function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example:(\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..] = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..]) = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}Since: base-2.1 Instance detailsDefined in Control.Applicative Methodspure :: a -> ZipList a Source #(<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b Source #liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source #(*>) :: ZipList a -> ZipList b -> ZipList b Source #(<*) :: ZipList a -> ZipList b -> ZipList a Source # Since: base-2.1 Instance detailsDefined in Control.Applicative Methodsfmap :: (a -> b) -> ZipList a -> ZipList b Source #(<$) :: a -> ZipList b -> ZipList a Source # Instance detailsDefined in Control.Applicative Associated Typestype Rep1 ZipList :: k -> Type Source # Methodsfrom1 :: forall (a :: k). ZipList a -> Rep1 ZipList a Source #to1 :: forall (a :: k). Rep1 ZipList a -> ZipList a Source # Instance detailsDefined in Control.Applicative Associated Typestype Rep (ZipList a) :: Type -> Type Source # Methodsfrom :: ZipList a -> Rep (ZipList a) x Source #to :: Rep (ZipList a) x -> ZipList a Source # Since: base-4.15.0.0 Instance detailsDefined in GHC.IsList Associated Typestype Item (ZipList a) Source # MethodsfromList :: [Item (ZipList a)] -> ZipList a Source #fromListN :: Int -> [Item (ZipList a)] -> ZipList a Source #toList :: ZipList a -> [Item (ZipList a)] Source # Read a => Read (ZipList a) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative Methods Show a => Show (ZipList a) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative MethodsshowsPrec :: Int -> ZipList a -> ShowS Source #show :: ZipList a -> String Source #showList :: [ZipList a] -> ShowS Source # Eq a => Eq (ZipList a) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative Methods(==) :: ZipList a -> ZipList a -> Bool Source #(/=) :: ZipList a -> ZipList a -> Bool Source # Ord a => Ord (ZipList a) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative Methodscompare :: ZipList a -> ZipList a -> Ordering Source #(<) :: ZipList a -> ZipList a -> Bool Source #(<=) :: ZipList a -> ZipList a -> Bool Source #(>) :: ZipList a -> ZipList a -> Bool Source #(>=) :: ZipList a -> ZipList a -> Bool Source #max :: ZipList a -> ZipList a -> ZipList a Source #min :: ZipList a -> ZipList a -> ZipList a Source # type Rep1 ZipList Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative type Rep1 ZipList = D1 ('MetaData "ZipList" "Control.Applicative" "base" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 []))) type Rep (ZipList a) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative type Rep (ZipList a) = D1 ('MetaData "ZipList" "Control.Applicative" "base" 'True) (C1 ('MetaCons "ZipList" 'PrefixI 'True) (S1 ('MetaSel ('Just "getZipList") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a]))) type Item (ZipList a) Instance detailsDefined in GHC.IsList type Item (ZipList a) = a (<**>) :: Applicative f => f a -> f (a -> b) -> f b infixl 4 Source # A variant of <*> with the arguments reversed. liftA3 :: Applicative f => (a -> b -> c -> d) -> f a -> f b -> f c -> f d Source # Lift a ternary function to actions. optional :: Alternative f => f a -> f (Maybe a) Source # One or none. It is useful for modelling any computation that is allowed to fail. #### Examples Expand Using the Alternative instance of Control.Monad.Except, the following functions: >>> import Control.Monad.Except  >>> canFail = throwError "it failed" :: Except String Int >>> final = return 42 :: Except String Int  Can be combined by allowing the first function to fail: >>> runExcept$ canFail *> final
Left "it failed"
>>> runExcept $optional canFail *> final Right 42  (&&&) :: Arrow a => a b c -> a b c' -> a b (c, c') infixr 3 Source # 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. (>>>) :: forall {k} cat (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c infixr 1 Source # Left-to-right composition (<<<) :: forall {k} cat (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c infixr 1 Source # Right-to-left composition class (Typeable e, Show e) => Exception e Source # Any type that you wish to throw or catch as an exception must be an instance of the Exception class. The simplest case is a new exception type directly below the root: data MyException = ThisException | ThatException deriving Show instance Exception MyException The default method definitions in the Exception class do what we need in this case. You can now throw and catch ThisException and ThatException as exceptions: *Main> throw ThisException catch \e -> putStrLn ("Caught " ++ show (e :: MyException)) Caught ThisException  In more complicated examples, you may wish to define a whole hierarchy of exceptions: --------------------------------------------------------------------- -- Make the root exception type for all the exceptions in a compiler data SomeCompilerException = forall e . Exception e => SomeCompilerException e instance Show SomeCompilerException where show (SomeCompilerException e) = show e instance Exception SomeCompilerException compilerExceptionToException :: Exception e => e -> SomeException compilerExceptionToException = toException . SomeCompilerException compilerExceptionFromException :: Exception e => SomeException -> Maybe e compilerExceptionFromException x = do SomeCompilerException a <- fromException x cast a --------------------------------------------------------------------- -- Make a subhierarchy for exceptions in the frontend of the compiler data SomeFrontendException = forall e . Exception e => SomeFrontendException e instance Show SomeFrontendException where show (SomeFrontendException e) = show e instance Exception SomeFrontendException where toException = compilerExceptionToException fromException = compilerExceptionFromException frontendExceptionToException :: Exception e => e -> SomeException frontendExceptionToException = toException . SomeFrontendException frontendExceptionFromException :: Exception e => SomeException -> Maybe e frontendExceptionFromException x = do SomeFrontendException a <- fromException x cast a --------------------------------------------------------------------- -- Make an exception type for a particular frontend compiler exception data MismatchedParentheses = MismatchedParentheses deriving Show instance Exception MismatchedParentheses where toException = frontendExceptionToException fromException = frontendExceptionFromException We can now catch a MismatchedParentheses exception as MismatchedParentheses, SomeFrontendException or SomeCompilerException, but not other types, e.g. IOException: *Main> throw MismatchedParentheses catch \e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses)) Caught MismatchedParentheses *Main> throw MismatchedParentheses catch \e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException)) Caught MismatchedParentheses *Main> throw MismatchedParentheses catch \e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException)) Caught MismatchedParentheses *Main> throw MismatchedParentheses catch \e -> putStrLn ("Caught " ++ show (e :: IOException)) *** Exception: MismatchedParentheses  #### Instances Instances details  Since: base-4.8.0.0 Instance detailsDefined in Data.Void Methods Since: base-4.0.0.0 Instance detailsDefined in GHC.Exception.Type Methods Since: base-3.0 Instance detailsDefined in GHC.Exception.Type Methods Instance detailsDefined in Data.Text.Encoding.Error Methods The SomeException type is the root of the exception type hierarchy. When an exception of type e is thrown, behind the scenes it is encapsulated in a SomeException. Constructors  Exception e => SomeException e #### Instances Instances details  Since: base-3.0 Instance detailsDefined in GHC.Exception.Type Methods Since: base-3.0 Instance detailsDefined in GHC.Exception.Type Methods class (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where Source # Monads that also support choice and failure. Minimal complete definition Nothing Methods mzero :: m a Source # The identity of mplus. It should also satisfy the equations mzero >>= f = mzero v >> mzero = mzero The default definition is mzero = empty  mplus :: m a -> m a -> m a Source # An associative operation. The default definition is mplus = (<|>)  #### Instances Instances details  Since: base-2.1 Instance detailsDefined in Text.ParserCombinators.ReadP Methodsmzero :: P a Source #mplus :: P a -> P a -> P a Source # Since: base-2.1 Instance detailsDefined in Text.ParserCombinators.ReadP Methodsmplus :: ReadP a -> ReadP a -> ReadP a Source # Instance detailsDefined in Data.Sequence.Internal Methodsmplus :: Seq a -> Seq a -> Seq a Source # Instance detailsDefined in Data.DList.Internal Methodsmplus :: DList a -> DList a -> DList a Source # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodsmplus :: IO a -> IO a -> IO a Source # Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmplus :: Maybe a -> Maybe a -> Maybe a Source # Since: base-2.1 Instance detailsDefined in GHC.Base Methodsmzero :: [a] Source #mplus :: [a] -> [a] -> [a] Source # (ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a) Since: base-4.6.0.0 Instance detailsDefined in Control.Arrow Methodsmzero :: ArrowMonad a a0 Source #mplus :: ArrowMonad a a0 -> ArrowMonad a a0 -> ArrowMonad a a0 Source # MonadPlus (Proxy :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in Data.Proxy Methodsmplus :: Proxy a -> Proxy a -> Proxy a Source # MonadPlus (U1 :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsmplus :: U1 a -> U1 a -> U1 a Source # MonadPlus m => MonadPlus (Kleisli m a) Since: base-4.14.0.0 Instance detailsDefined in Control.Arrow Methodsmzero :: Kleisli m a a0 Source #mplus :: Kleisli m a a0 -> Kleisli m a a0 -> Kleisli m a a0 Source # MonadPlus f => MonadPlus (Ap f) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methodsmzero :: Ap f a Source #mplus :: Ap f a -> Ap f a -> Ap f a Source # MonadPlus f => MonadPlus (Rec1 f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsmzero :: Rec1 f a Source #mplus :: Rec1 f a -> Rec1 f a -> Rec1 f a Source # (MonadPlus f, MonadPlus g) => MonadPlus (Product f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methodsmzero :: Product f g a Source #mplus :: Product f g a -> Product f g a -> Product f g a Source # (MonadPlus f, MonadPlus g) => MonadPlus (f :*: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsmzero :: (f :*: g) a Source #mplus :: (f :*: g) a -> (f :*: g) a -> (f :*: g) a Source # MonadPlus f => MonadPlus (M1 i c f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsmzero :: M1 i c f a Source #mplus :: M1 i c f a -> M1 i c f a -> M1 i c f a Source # class Applicative m => Monad (m :: Type -> Type) where Source # The Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions. Instances of Monad should satisfy the following: Left identity return a >>= k = k a Right identity m >>= return = m Associativity m >>= (\x -> k x >>= h) = (m >>= k) >>= h Furthermore, the Monad and Applicative operations should relate as follows: • pure = return • m1 <*> m2 = m1 >>= (\x1 -> m2 >>= (\x2 -> return (x1 x2))) The above laws imply: • fmap f xs = xs >>= return . f • (>>) = (*>) and that pure and (<*>) satisfy the applicative functor laws. The instances of Monad for lists, Maybe and IO defined in the Prelude satisfy these laws. Minimal complete definition (>>=) Methods (>>=) :: m a -> (a -> m b) -> m b infixl 1 Source # Sequentially compose two actions, passing any value produced by the first as an argument to the second. 'as >>= bs' can be understood as the do expression do a <- as bs a  (>>) :: m a -> m b -> m b infixl 1 Source # Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages. 'as >> bs' can be understood as the do expression do as bs  #### Instances Instances details  Since: base-4.9.0.0 Instance detailsDefined in Data.Complex Methods(>>=) :: Complex a -> (a -> Complex b) -> Complex b Source #(>>) :: Complex a -> Complex b -> Complex b Source #return :: a -> Complex a Source # Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methods(>>=) :: Identity a -> (a -> Identity b) -> Identity b Source #(>>) :: Identity a -> Identity b -> Identity b Source #return :: a -> Identity a Source # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: First a -> (a -> First b) -> First b Source #(>>) :: First a -> First b -> First b Source #return :: a -> First a Source # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: Last a -> (a -> Last b) -> Last b Source #(>>) :: Last a -> Last b -> Last b Source #return :: a -> Last a Source # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methods(>>=) :: Down a -> (a -> Down b) -> Down b Source #(>>) :: Down a -> Down b -> Down b Source #return :: a -> Down a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: First a -> (a -> First b) -> First b Source #(>>) :: First a -> First b -> First b Source #return :: a -> First a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Last a -> (a -> Last b) -> Last b Source #(>>) :: Last a -> Last b -> Last b Source #return :: a -> Last a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Max a -> (a -> Max b) -> Max b Source #(>>) :: Max a -> Max b -> Max b Source #return :: a -> Max a Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(>>=) :: Min a -> (a -> Min b) -> Min b Source #(>>) :: Min a -> Min b -> Min b Source #return :: a -> Min a Source # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b Source #(>>) :: Par1 a -> Par1 b -> Par1 b Source #return :: a -> Par1 a Source # Since: base-2.1 Instance detailsDefined in Text.ParserCombinators.ReadP Methods(>>=) :: P a -> (a -> P b) -> P b Source #(>>) :: P a -> P b -> P b Source #return :: a -> P a Source # Since: base-2.1 Instance detailsDefined in Text.ParserCombinators.ReadP Methods(>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b Source #(>>) :: ReadP a -> ReadP b -> ReadP b Source #return :: a -> ReadP a Source # Instance detailsDefined in Data.Sequence.Internal Methods(>>=) :: Seq a -> (a -> Seq b) -> Seq b Source #(>>) :: Seq a -> Seq b -> Seq b Source #return :: a -> Seq a Source # Instance detailsDefined in Data.DList.Internal Methods(>>=) :: DList a -> (a -> DList b) -> DList b Source #(>>) :: DList a -> DList b -> DList b Source #return :: a -> DList a Source # Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: IO a -> (a -> IO b) -> IO b Source #(>>) :: IO a -> IO b -> IO b Source #return :: a -> IO a Source # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b Source #(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b Source #return :: a -> NonEmpty a Source # Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b Source #(>>) :: Maybe a -> Maybe b -> Maybe b Source #return :: a -> Maybe a Source # Since: base-4.15 Instance detailsDefined in GHC.Base Methods(>>=) :: Solo a -> (a -> Solo b) -> Solo b Source #(>>) :: Solo a -> Solo b -> Solo b Source #return :: a -> Solo a Source # Monad [] Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: [a] -> (a -> [b]) -> [b] Source #(>>) :: [a] -> [b] -> [b] Source #return :: a -> [a] Source # Monad m => Monad (WrappedMonad m) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative Methods(>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b Source #(>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source #return :: a -> WrappedMonad m a Source # ArrowApply a => Monad (ArrowMonad a) Since: base-2.1 Instance detailsDefined in Control.Arrow Methods(>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b Source #(>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source #return :: a0 -> ArrowMonad a a0 Source # Monad (Either e) Since: base-4.4.0.0 Instance detailsDefined in Data.Either Methods(>>=) :: Either e a -> (a -> Either e b) -> Either e b Source #(>>) :: Either e a -> Either e b -> Either e b Source #return :: a -> Either e a Source # Monad (Proxy :: Type -> Type) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methods(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b Source #(>>) :: Proxy a -> Proxy b -> Proxy b Source #return :: a -> Proxy a Source # Monad (U1 :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: U1 a -> (a -> U1 b) -> U1 b Source #(>>) :: U1 a -> U1 b -> U1 b Source #return :: a -> U1 a Source # Monoid a => Monad ((,) a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) Source #(>>) :: (a, a0) -> (a, b) -> (a, b) Source #return :: a0 -> (a, a0) Source # Monad m => Monad (Kleisli m a) Since: base-4.14.0.0 Instance detailsDefined in Control.Arrow Methods(>>=) :: Kleisli m a a0 -> (a0 -> Kleisli m a b) -> Kleisli m a b Source #(>>) :: Kleisli m a a0 -> Kleisli m a b -> Kleisli m a b Source #return :: a0 -> Kleisli m a a0 Source # Monad f => Monad (Ap f) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: Ap f a -> (a -> Ap f b) -> Ap f b Source #(>>) :: Ap f a -> Ap f b -> Ap f b Source #return :: a -> Ap f a Source # Monad f => Monad (Rec1 f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: Rec1 f a -> (a -> Rec1 f b) -> Rec1 f b Source #(>>) :: Rec1 f a -> Rec1 f b -> Rec1 f b Source #return :: a -> Rec1 f a Source # (Applicative f, Monad f) => Monad (WhenMissing f x) Equivalent to ReaderT k (ReaderT x (MaybeT f)).Since: containers-0.5.9 Instance detailsDefined in Data.IntMap.Internal Methods(>>=) :: WhenMissing f x a -> (a -> WhenMissing f x b) -> WhenMissing f x b Source #(>>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b Source #return :: a -> WhenMissing f x a Source # (Monoid a, Monoid b) => Monad ((,,) a b) Since: base-4.14.0.0 Instance detailsDefined in GHC.Base Methods(>>=) :: (a, b, a0) -> (a0 -> (a, b, b0)) -> (a, b, b0) Source #(>>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) Source #return :: a0 -> (a, b, a0) Source # (Monad f, Monad g) => Monad (Product f g) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methods(>>=) :: Product f g a -> (a -> Product f g b) -> Product f g b Source #(>>) :: Product f g a -> Product f g b -> Product f g b Source #return :: a -> Product f g a Source # (Monad f, Monad g) => Monad (f :*: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b Source #(>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b Source #return :: a -> (f :*: g) a Source # (Monad f, Applicative f) => Monad (WhenMatched f x y) Equivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))Since: containers-0.5.9 Instance detailsDefined in Data.IntMap.Internal Methods(>>=) :: WhenMatched f x y a -> (a -> WhenMatched f x y b) -> WhenMatched f x y b Source #(>>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b Source #return :: a -> WhenMatched f x y a Source # (Applicative f, Monad f) => Monad (WhenMissing f k x) Equivalent to  ReaderT k (ReaderT x (MaybeT f)) .Since: containers-0.5.9 Instance detailsDefined in Data.Map.Internal Methods(>>=) :: WhenMissing f k x a -> (a -> WhenMissing f k x b) -> WhenMissing f k x b Source #(>>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b Source #return :: a -> WhenMissing f k x a Source # (Monoid a, Monoid b, Monoid c) => Monad ((,,,) a b c) Since: base-4.14.0.0 Instance detailsDefined in GHC.Base Methods(>>=) :: (a, b, c, a0) -> (a0 -> (a, b, c, b0)) -> (a, b, c, b0) Source #(>>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) Source #return :: a0 -> (a, b, c, a0) Source # Monad ((->) r) Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: (r -> a) -> (a -> r -> b) -> r -> b Source #(>>) :: (r -> a) -> (r -> b) -> r -> b Source #return :: a -> r -> a Source # Monad f => Monad (M1 i c f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b Source #(>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source #return :: a -> M1 i c f a Source # (Monad f, Applicative f) => Monad (WhenMatched f k x y) Equivalent to  ReaderT k (ReaderT x (ReaderT y (MaybeT f))) Since: containers-0.5.9 Instance detailsDefined in Data.Map.Internal Methods(>>=) :: WhenMatched f k x y a -> (a -> WhenMatched f k x y b) -> WhenMatched f k x y b Source #(>>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b Source #return :: a -> WhenMatched f k x y a Source # forever :: Applicative f => f a -> f b Source # Repeat an action indefinitely. #### Examples Expand A common use of forever is to process input from network sockets, Handles, and channels (e.g. MVar and Chan). For example, here is how we might implement an echo server, using forever both to listen for client connections on a network socket and to echo client input on client connection handles: echoServer :: Socket -> IO () echoServer socket = forever$ do
client <- accept socket
forkFinally (echo client) (\_ -> hClose client)
where
echo :: Handle -> IO ()

Strict version of <$>. Since: base-4.8.0.0 mfilter :: MonadPlus m => (a -> Bool) -> m a -> m a Source # Direct MonadPlus equivalent of filter. #### Examples Expand The filter function is just mfilter specialized to the list monad: filter = ( mfilter :: (a -> Bool) -> [a] -> [a] )  An example using mfilter with the Maybe monad: >>> mfilter odd (Just 1) Just 1 >>> mfilter odd (Just 2) Nothing  class Monad m => MonadFail (m :: Type -> Type) where Source # When a value is bound in do-notation, the pattern on the left hand side of <- might not match. In this case, this class provides a function to recover. A Monad without a MonadFail instance may only be used in conjunction with pattern that always match, such as newtypes, tuples, data types with only a single data constructor, and irrefutable patterns (~pat). Instances of MonadFail should satisfy the following law: fail s should be a left zero for >>=, fail s >>= f = fail s  If your Monad is also MonadPlus, a popular definition is fail _ = mzero  Since: base-4.9.0.0 Methods fail :: String -> m a Source # #### Instances Instances details  Since: base-4.9.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methodsfail :: String -> P a Source # Since: base-4.9.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methods Instance detailsDefined in Data.DList.Internal Methods Since: base-4.9.0.0 Instance detailsDefined in Control.Monad.Fail Methodsfail :: String -> IO a Source # Since: base-4.9.0.0 Instance detailsDefined in Control.Monad.Fail Methods Since: base-4.9.0.0 Instance detailsDefined in Control.Monad.Fail Methodsfail :: String -> [a] Source # MonadFail f => MonadFail (Ap f) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methodsfail :: String -> Ap f a Source # class Bifunctor (p :: Type -> Type -> Type) where Source # A bifunctor is a type constructor that takes two type arguments and is a functor in both arguments. That is, unlike with Functor, a type constructor such as Either does not need to be partially applied for a Bifunctor instance, and the methods in this class permit mapping functions over the Left value or the Right value, or both at the same time. Formally, the class Bifunctor represents a bifunctor from Hask -> Hask. Intuitively it is a bifunctor where both the first and second arguments are covariant. You can define a Bifunctor by either defining bimap or by defining both first and second. If you supply bimap, you should ensure that: bimap id id ≡ id If you supply first and second, ensure: first id ≡ id second id ≡ id  If you supply both, you should also ensure: bimap f g ≡ first f . second g These ensure by parametricity: bimap (f . g) (h . i) ≡ bimap f h . bimap g i first (f . g) ≡ first f . first g second (f . g) ≡ second f . second g  Since: base-4.8.0.0 Minimal complete definition Methods bimap :: (a -> b) -> (c -> d) -> p a c -> p b d Source # Map over both arguments at the same time. bimap f g ≡ first f . second g #### Examples Expand >>> bimap toUpper (+1) ('j', 3) ('J',4)  >>> bimap toUpper (+1) (Left 'j') Left 'J'  >>> bimap toUpper (+1) (Right 3) Right 4  first :: (a -> b) -> p a c -> p b c Source # Map covariantly over the first argument. first f ≡ bimap f id #### Examples Expand >>> first toUpper ('j', 3) ('J',3)  >>> first toUpper (Left 'j') Left 'J'  second :: (b -> c) -> p a b -> p a c Source # Map covariantly over the second argument. second ≡ bimap id #### Examples Expand >>> second (+1) ('j', 3) ('j',4)  >>> second (+1) (Right 3) Right 4  #### Instances Instances details  Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d Source #first :: (a -> b) -> Either a c -> Either b c Source #second :: (b -> c) -> Either a b -> Either a c Source # Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methodsbimap :: (a -> b) -> (c -> d) -> Arg a c -> Arg b d Source #first :: (a -> b) -> Arg a c -> Arg b c Source #second :: (b -> c) -> Arg a b -> Arg a c Source # Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d) Source #first :: (a -> b) -> (a, c) -> (b, c) Source #second :: (b -> c) -> (a, b) -> (a, c) Source # Bifunctor (Const :: Type -> Type -> Type) Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> Const a c -> Const b d Source #first :: (a -> b) -> Const a c -> Const b c Source #second :: (b -> c) -> Const a b -> Const a c Source # Bifunctor ((,,) x1) Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> (x1, a, c) -> (x1, b, d) Source #first :: (a -> b) -> (x1, a, c) -> (x1, b, c) Source #second :: (b -> c) -> (x1, a, b) -> (x1, a, c) Source # Bifunctor (K1 i :: Type -> Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> K1 i a c -> K1 i b d Source #first :: (a -> b) -> K1 i a c -> K1 i b c Source #second :: (b -> c) -> K1 i a b -> K1 i a c Source # Bifunctor ((,,,) x1 x2) Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> (x1, x2, a, c) -> (x1, x2, b, d) Source #first :: (a -> b) -> (x1, x2, a, c) -> (x1, x2, b, c) Source #second :: (b -> c) -> (x1, x2, a, b) -> (x1, x2, a, c) Source # Bifunctor ((,,,,) x1 x2 x3) Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, d) Source #first :: (a -> b) -> (x1, x2, x3, a, c) -> (x1, x2, x3, b, c) Source #second :: (b -> c) -> (x1, x2, x3, a, b) -> (x1, x2, x3, a, c) Source # Bifunctor ((,,,,,) x1 x2 x3 x4) Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, d) Source #first :: (a -> b) -> (x1, x2, x3, x4, a, c) -> (x1, x2, x3, x4, b, c) Source #second :: (b -> c) -> (x1, x2, x3, x4, a, b) -> (x1, x2, x3, x4, a, c) Source # Bifunctor ((,,,,,,) x1 x2 x3 x4 x5) Since: base-4.8.0.0 Instance detailsDefined in Data.Bifunctor Methodsbimap :: (a -> b) -> (c -> d) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, d) Source #first :: (a -> b) -> (x1, x2, x3, x4, x5, a, c) -> (x1, x2, x3, x4, x5, b, c) Source #second :: (b -> c) -> (x1, x2, x3, x4, x5, a, b) -> (x1, x2, x3, x4, x5, a, c) Source # xor :: Bits a => a -> a -> a infixl 6 Source # Bitwise "xor" toIntegralSized :: (Integral a, Integral b, Bits a, Bits b) => a -> Maybe b Source # Attempt to convert an Integral type a to an Integral type b using the size of the types as measured by Bits methods. A simpler version of this function is: toIntegral :: (Integral a, Integral b) => a -> Maybe b toIntegral x | toInteger x == toInteger y = Just y | otherwise = Nothing where y = fromIntegral x This version requires going through Integer, which can be inefficient. However, toIntegralSized is optimized to allow GHC to statically determine the relative type sizes (as measured by bitSizeMaybe and isSigned) and avoid going through Integer for many types. (The implementation uses fromIntegral, which is itself optimized with rules for base types but may go through Integer for some type pairs.) Since: base-4.8.0.0 data Bool Source # Constructors  False True #### Instances Instances details  Interpret Bool as 1-bit bit-fieldSince: base-4.7.0.0 Instance detailsDefined in GHC.Bits Methods(.&.) :: Bool -> Bool -> Bool Source #(.|.) :: Bool -> Bool -> Bool Source #xor :: Bool -> Bool -> Bool Source #shift :: Bool -> Int -> Bool Source #rotate :: Bool -> Int -> Bool Source #setBit :: Bool -> Int -> Bool Source #shiftL :: Bool -> Int -> Bool Source #shiftR :: Bool -> Int -> Bool Source # Since: base-4.7.0.0 Instance detailsDefined in GHC.Bits Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsenumFrom :: Bool -> [Bool] Source #enumFromThen :: Bool -> Bool -> [Bool] Source #enumFromTo :: Bool -> Bool -> [Bool] Source #enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] Source # Instance detailsDefined in GHC.Generics Associated Typestype Rep Bool :: Type -> Type Source # Methodsto :: Rep Bool x -> Bool Source # SingKind Bool Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Associated Typestype DemoteRep Bool MethodsfromSing :: forall (a :: Bool). Sing a -> DemoteRep Bool Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowList :: [Bool] -> ShowS Source # Instance detailsDefined in GHC.Classes Methods(==) :: Bool -> Bool -> Bool Source #(/=) :: Bool -> Bool -> Bool Source # Instance detailsDefined in GHC.Classes Methods(<) :: Bool -> Bool -> Bool Source #(<=) :: Bool -> Bool -> Bool Source #(>) :: Bool -> Bool -> Bool Source #(>=) :: Bool -> Bool -> Bool Source #max :: Bool -> Bool -> Bool Source #min :: Bool -> Bool -> Bool Source # SingI 'False Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodssing :: Sing 'False SingI 'True Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodssing :: Sing 'True type DemoteRep Bool Instance detailsDefined in GHC.Generics type DemoteRep Bool = Bool type Rep Bool Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics type Rep Bool = D1 ('MetaData "Bool" "GHC.Types" "ghc-prim" 'False) (C1 ('MetaCons "False" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "True" 'PrefixI 'False) (U1 :: Type -> Type)) data Sing (a :: Bool) Instance detailsDefined in GHC.Generics data Sing (a :: Bool) whereSTrue :: Sing 'TrueSFalse :: Sing 'False otherwise is defined as the value True. It helps to make guards more readable. eg.  f x | x < 0 = ... | otherwise = ... (&&) :: Bool -> Bool -> Bool infixr 3 Source # Boolean "and", lazy in the second argument (||) :: Bool -> Bool -> Bool infixr 2 Source # Boolean "or", lazy in the second argument Boolean "not" bool :: a -> a -> Bool -> a Source # Case analysis for the Bool type. bool x y p evaluates to x when p is False, and evaluates to y when p is True. This is equivalent to if p then y else x; that is, one can think of it as an if-then-else construct with its arguments reordered. #### Examples Expand Basic usage: >>> bool "foo" "bar" True "bar" >>> bool "foo" "bar" False "foo"  Confirm that bool x y p and if p then y else x are equivalent: >>> let p = True; x = "bar"; y = "foo" >>> bool x y p == if p then y else x True >>> let p = False >>> bool x y p == if p then y else x True  Since: base-4.7.0.0 data Char Source # The character type Char is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) code points (i.e. characters, see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 characters), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char. To convert a Char to or from the corresponding Int value defined by Unicode, use toEnum and fromEnum from the Enum class respectively (or equivalently ord and chr). #### Instances Instances details  Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsenumFrom :: Char -> [Char] Source #enumFromThen :: Char -> Char -> [Char] Source #enumFromTo :: Char -> Char -> [Char] Source #enumFromThenTo :: Char -> Char -> Char -> [Char] Source # Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Show MethodsshowList :: [Char] -> ShowS Source # Instance detailsDefined in GHC.Classes Methods(==) :: Char -> Char -> Bool Source #(/=) :: Char -> Char -> Bool Source # Instance detailsDefined in GHC.Classes Methods(<) :: Char -> Char -> Bool Source #(<=) :: Char -> Char -> Bool Source #(>) :: Char -> Char -> Bool Source #(>=) :: Char -> Char -> Bool Source #max :: Char -> Char -> Char Source #min :: Char -> Char -> Char Source # Source # Instance detailsDefined in Incipit.String.Conversion Methods Source # Instance detailsDefined in Incipit.String.Conversion Methods Source # Instance detailsDefined in Incipit.String.Conversion Methods Source # Instance detailsDefined in Incipit.String.Conversion Methods Source # Since: 0.6.0.0 Instance detailsDefined in Incipit.String.Conversion Methods Source # Converting String to ByteString might be a slow operation. Consider using lazy bytestring at first place. Instance detailsDefined in Incipit.String.Conversion Methods Generic1 (URec Char :: k -> Type) Instance detailsDefined in GHC.Generics Associated Typestype Rep1 (URec Char) :: k -> Type Source # Methodsfrom1 :: forall (a :: k0). URec Char a -> Rep1 (URec Char) a Source #to1 :: forall (a :: k0). Rep1 (URec Char) a -> URec Char a Source # Foldable (UChar :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in Data.Foldable Methodsfold :: Monoid m => UChar m -> m Source #foldMap :: Monoid m => (a -> m) -> UChar a -> m Source #foldMap' :: Monoid m => (a -> m) -> UChar a -> m Source #foldr :: (a -> b -> b) -> b -> UChar a -> b Source #foldr' :: (a -> b -> b) -> b -> UChar a -> b Source #foldl :: (b -> a -> b) -> b -> UChar a -> b Source #foldl' :: (b -> a -> b) -> b -> UChar a -> b Source #foldr1 :: (a -> a -> a) -> UChar a -> a Source #foldl1 :: (a -> a -> a) -> UChar a -> a Source #toList :: UChar a -> [a] Source #null :: UChar a -> Bool Source #length :: UChar a -> Int Source #elem :: Eq a => a -> UChar a -> Bool Source #maximum :: Ord a => UChar a -> a Source #minimum :: Ord a => UChar a -> a Source #sum :: Num a => UChar a -> a Source #product :: Num a => UChar a -> a Source # Traversable (UChar :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in Data.Traversable Methodstraverse :: Applicative f => (a -> f b) -> UChar a -> f (UChar b) Source #sequenceA :: Applicative f => UChar (f a) -> f (UChar a) Source #mapM :: Monad m => (a -> m b) -> UChar a -> m (UChar b) Source #sequence :: Monad m => UChar (m a) -> m (UChar a) Source # Functor (URec Char :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Char a -> URec Char b Source #(<$) :: a -> URec Char b -> URec Char a Source # Instance detailsDefined in GHC.Generics Associated Typestype Rep (URec Char p) :: Type -> Type Source # Methodsfrom :: URec Char p -> Rep (URec Char p) x Source #to :: Rep (URec Char p) x -> URec Char p Source # Show (URec Char p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics MethodsshowsPrec :: Int -> URec Char p -> ShowS Source #showList :: [URec Char p] -> ShowS Source # Eq (URec Char p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Char p -> URec Char p -> Bool Source #(/=) :: URec Char p -> URec Char p -> Bool Source # Ord (URec Char p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodscompare :: URec Char p -> URec Char p -> Ordering Source #(<) :: URec Char p -> URec Char p -> Bool Source #(<=) :: URec Char p -> URec Char p -> Bool Source #(>) :: URec Char p -> URec Char p -> Bool Source #(>=) :: URec Char p -> URec Char p -> Bool Source #max :: URec Char p -> URec Char p -> URec Char p Source #min :: URec Char p -> URec Char p -> URec Char p Source # data URec Char (p :: k) Used for marking occurrences of Char#Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics data URec Char (p :: k) = UChar {uChar# :: Char#} type Compare (a :: Char) (b :: Char) Instance detailsDefined in Data.Type.Ord type Compare (a :: Char) (b :: Char) = CmpChar a b type Rep1 (URec Char :: k -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics type Rep1 (URec Char :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UChar :: k -> Type))) type Rep (URec Char p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics type Rep (URec Char p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UChar :: Type -> Type)))

The toEnum method restricted to the type Char.

class a ~R# b => Coercible (a :: k) (b :: k) Source #

Coercible is a two-parameter class that has instances for types a and b if the compiler can infer that they have the same representation. This class does not have regular instances; instead they are created on-the-fly during type-checking. Trying to manually declare an instance of Coercible is an error.

Nevertheless one can pretend that the following three kinds of instances exist. First, as a trivial base-case:

instance Coercible a a

Furthermore, for every type constructor there is an instance that allows to coerce under the type constructor. For example, let D be a prototypical type constructor (data or newtype) with three type arguments, which have roles nominal, representational resp. phantom. Then there is an instance of the form

instance Coercible b b' => Coercible (D a b c) (D a b' c')

Note that the nominal type arguments are equal, the representational type arguments can differ, but need to have a Coercible instance themself, and the phantom type arguments can be changed arbitrarily.

The third kind of instance exists for every newtype NT = MkNT T and comes in two variants, namely

instance Coercible a T => Coercible a NT
instance Coercible T b => Coercible NT b

This instance is only usable if the constructor MkNT is in scope.

If, as a library author of a type constructor like Set a, you want to prevent a user of your module to write coerce :: Set T -> Set NT, you need to set the role of Set's type parameter to nominal, by writing

type role Set nominal

For more details about this feature, please refer to Safe Coercions by Joachim Breitner, Richard A. Eisenberg, Simon Peyton Jones and Stephanie Weirich.

Since: ghc-prim-0.4.0

coerce :: forall {k :: RuntimeRep} (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b Source #

The function coerce allows you to safely convert between values of types that have the same representation with no run-time overhead. In the simplest case you can use it instead of a newtype constructor, to go from the newtype's concrete type to the abstract type. But it also works in more complicated settings, e.g. converting a list of newtypes to a list of concrete types.

This function is representation-polymorphic, but the RuntimeRep type argument is marked as Inferred, meaning that it is not available for visible type application. This means the typechecker will accept coerce @Int @Age 42.

class Eq a where Source #

The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq.

The Haskell Report defines no laws for Eq. However, instances are encouraged to follow these properties:

Reflexivity
x == x = True
Symmetry
x == y = y == x
Transitivity
if x == y && y == z = True, then x == z = True
Extensionality
if x == y = True and f is a function whose return type is an instance of Eq, then f x == f y = True
Negation
x /= y = not (x == y)

Minimal complete definition: either == or /=.

Minimal complete definition

Methods

(==) :: a -> a -> Bool infix 4 Source #

(/=) :: a -> a -> Bool infix 4 Source #

#### Instances

Instances details
 Instance detailsDefined in Data.Typeable.Internal Methods Since: base-4.8.0.0 Instance detailsDefined in Data.Void Methods(==) :: Void -> Void -> Bool Source #(/=) :: Void -> Void -> Bool Source # Since: base-3.0 Instance detailsDefined in GHC.Exception.Type Methods Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.3.0.0 Instance detailsDefined in GHC.IO Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods(==) :: Int8 -> Int8 -> Bool Source #(/=) :: Int8 -> Int8 -> Bool Source # Since: base-4.9.0.0 Instance detailsDefined in GHC.Stack.Types Methods Instance detailsDefined in GHC.TypeLits Methods Since: base-4.7.0.0 Instance detailsDefined in GHC.TypeLits Methods Since: base-4.7.0.0 Instance detailsDefined in GHC.TypeNats Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Instance detailsDefined in Data.ByteString.Internal.Type Methods Instance detailsDefined in Data.ByteString.Lazy.Internal Methods Instance detailsDefined in Data.ByteString.Short.Internal Methods Instance detailsDefined in Data.IntSet.Internal Methods Instance detailsDefined in GHC.Num.BigNat Methods Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in Data.Text.Encoding.Error Methods Instance detailsDefined in GHC.Num.Integer Methods Instance detailsDefined in GHC.Num.Natural Methods Eq () Instance detailsDefined in GHC.Classes Methods(==) :: () -> () -> Bool Source #(/=) :: () -> () -> Bool Source # Instance detailsDefined in GHC.Classes Methods(==) :: Bool -> Bool -> Bool Source #(/=) :: Bool -> Bool -> Bool Source # Instance detailsDefined in GHC.Classes Methods(==) :: Char -> Char -> Bool Source #(/=) :: Char -> Char -> Bool Source # Note that due to the presence of NaN, Double's Eq instance does not satisfy reflexivity.>>> 0/0 == (0/0 :: Double) False Also note that Double's Eq instance does not satisfy substitutivity:>>> 0 == (-0 :: Double) True >>> recip 0 == recip (-0 :: Double) False  Instance detailsDefined in GHC.Classes Methods Note that due to the presence of NaN, Float's Eq instance does not satisfy reflexivity.>>> 0/0 == (0/0 :: Float) False Also note that Float's Eq instance does not satisfy extensionality:>>> 0 == (-0 :: Float) True >>> recip 0 == recip (-0 :: Float) False  Instance detailsDefined in GHC.Classes Methods Instance detailsDefined in GHC.Classes Methods(==) :: Int -> Int -> Bool Source #(/=) :: Int -> Int -> Bool Source # Instance detailsDefined in GHC.Classes Methods(==) :: Word -> Word -> Bool Source #(/=) :: Word -> Word -> Bool Source # Eq a => Eq (ZipList a) Since: base-4.7.0.0 Instance detailsDefined in Control.Applicative Methods(==) :: ZipList a -> ZipList a -> Bool Source #(/=) :: ZipList a -> ZipList a -> Bool Source # Eq a => Eq (And a) Since: base-4.16 Instance detailsDefined in Data.Bits Methods(==) :: And a -> And a -> Bool Source #(/=) :: And a -> And a -> Bool Source # Eq a => Eq (Iff a) Since: base-4.16 Instance detailsDefined in Data.Bits Methods(==) :: Iff a -> Iff a -> Bool Source #(/=) :: Iff a -> Iff a -> Bool Source # Eq a => Eq (Ior a) Since: base-4.16 Instance detailsDefined in Data.Bits Methods(==) :: Ior a -> Ior a -> Bool Source #(/=) :: Ior a -> Ior a -> Bool Source # Eq a => Eq (Xor a) Since: base-4.16 Instance detailsDefined in Data.Bits Methods(==) :: Xor a -> Xor a -> Bool Source #(/=) :: Xor a -> Xor a -> Bool Source # Eq a => Eq (Complex a) Since: base-2.1 Instance detailsDefined in Data.Complex Methods(==) :: Complex a -> Complex a -> Bool Source #(/=) :: Complex a -> Complex a -> Bool Source # Eq a => Eq (Identity a) Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methods(==) :: Identity a -> Identity a -> Bool Source #(/=) :: Identity a -> Identity a -> Bool Source # Eq a => Eq (First a) Since: base-2.1 Instance detailsDefined in Data.Monoid Methods(==) :: First a -> First a -> Bool Source #(/=) :: First a -> First a -> Bool Source # Eq a => Eq (Last a) Since: base-2.1 Instance detailsDefined in Data.Monoid Methods(==) :: Last a -> Last a -> Bool Source #(/=) :: Last a -> Last a -> Bool Source # Eq a => Eq (Down a) Since: base-4.6.0.0 Instance detailsDefined in Data.Ord Methods(==) :: Down a -> Down a -> Bool Source #(/=) :: Down a -> Down a -> Bool Source # Eq a => Eq (First a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: First a -> First a -> Bool Source #(/=) :: First a -> First a -> Bool Source # Eq a => Eq (Last a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Last a -> Last a -> Bool Source #(/=) :: Last a -> Last a -> Bool Source # Eq a => Eq (Max a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Max a -> Max a -> Bool Source #(/=) :: Max a -> Max a -> Bool Source # Eq a => Eq (Min a) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Min a -> Min a -> Bool Source #(/=) :: Min a -> Min a -> Bool Source # Eq m => Eq (WrappedMonoid m) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods Eq p => Eq (Par1 p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: Par1 p -> Par1 p -> Bool Source #(/=) :: Par1 p -> Par1 p -> Bool Source # Eq (MVar a) Since: base-4.1.0.0 Instance detailsDefined in GHC.MVar Methods(==) :: MVar a -> MVar a -> Bool Source #(/=) :: MVar a -> MVar a -> Bool Source # Eq a => Eq (Ratio a) Since: base-2.1 Instance detailsDefined in GHC.Real Methods(==) :: Ratio a -> Ratio a -> Bool Source #(/=) :: Ratio a -> Ratio a -> Bool Source # Eq a => Eq (IntMap a) Instance detailsDefined in Data.IntMap.Internal Methods(==) :: IntMap a -> IntMap a -> Bool Source #(/=) :: IntMap a -> IntMap a -> Bool Source # Eq a => Eq (Seq a) Instance detailsDefined in Data.Sequence.Internal Methods(==) :: Seq a -> Seq a -> Bool Source #(/=) :: Seq a -> Seq a -> Bool Source # Eq a => Eq (ViewL a) Instance detailsDefined in Data.Sequence.Internal Methods(==) :: ViewL a -> ViewL a -> Bool Source #(/=) :: ViewL a -> ViewL a -> Bool Source # Eq a => Eq (ViewR a) Instance detailsDefined in Data.Sequence.Internal Methods(==) :: ViewR a -> ViewR a -> Bool Source #(/=) :: ViewR a -> ViewR a -> Bool Source # Eq a => Eq (Intersection a) Instance detailsDefined in Data.Set.Internal Methods(==) :: Intersection a -> Intersection a -> Bool Source #(/=) :: Intersection a -> Intersection a -> Bool Source # Eq a => Eq (Set a) Instance detailsDefined in Data.Set.Internal Methods(==) :: Set a -> Set a -> Bool Source #(/=) :: Set a -> Set a -> Bool Source # Eq a => Eq (DList a) Instance detailsDefined in Data.DList.Internal Methods(==) :: DList a -> DList a -> Bool Source #(/=) :: DList a -> DList a -> Bool Source # Eq a => Eq (NonEmpty a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(==) :: NonEmpty a -> NonEmpty a -> Bool Source #(/=) :: NonEmpty a -> NonEmpty a -> Bool Source # Eq a => Eq (Maybe a) Since: base-2.1 Instance detailsDefined in GHC.Maybe Methods(==) :: Maybe a -> Maybe a -> Bool Source #(/=) :: Maybe a -> Maybe a -> Bool Source # Eq a => Eq (a) Instance detailsDefined in GHC.Classes Methods(==) :: (a) -> (a) -> Bool Source #(/=) :: (a) -> (a) -> Bool Source # Eq a => Eq [a] Instance detailsDefined in GHC.Classes Methods(==) :: [a] -> [a] -> Bool Source #(/=) :: [a] -> [a] -> Bool Source # (Eq a, Eq b) => Eq (Either a b) Since: base-2.1 Instance detailsDefined in Data.Either Methods(==) :: Either a b -> Either a b -> Bool Source #(/=) :: Either a b -> Either a b -> Bool Source # Eq (Fixed a) Since: base-2.1 Instance detailsDefined in Data.Fixed Methods(==) :: Fixed a -> Fixed a -> Bool Source #(/=) :: Fixed a -> Fixed a -> Bool Source # Eq (Proxy s) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methods(==) :: Proxy s -> Proxy s -> Bool Source #(/=) :: Proxy s -> Proxy s -> Bool Source # Eq a => Eq (Arg a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Semigroup Methods(==) :: Arg a b -> Arg a b -> Bool Source #(/=) :: Arg a b -> Arg a b -> Bool Source # Eq (TypeRep a) Since: base-2.1 Instance detailsDefined in Data.Typeable.Internal Methods(==) :: TypeRep a -> TypeRep a -> Bool Source #(/=) :: TypeRep a -> TypeRep a -> Bool Source # Eq (U1 p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: U1 p -> U1 p -> Bool Source #(/=) :: U1 p -> U1 p -> Bool Source # Eq (V1 p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: V1 p -> V1 p -> Bool Source #(/=) :: V1 p -> V1 p -> Bool Source # (Eq k, Eq a) => Eq (Map k a) Instance detailsDefined in Data.Map.Internal Methods(==) :: Map k a -> Map k a -> Bool Source #(/=) :: Map k a -> Map k a -> Bool Source # (Eq a, Eq b) => Eq (a, b) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b) -> (a, b) -> Bool Source #(/=) :: (a, b) -> (a, b) -> Bool Source # Eq a => Eq (Const a b) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Const Methods(==) :: Const a b -> Const a b -> Bool Source #(/=) :: Const a b -> Const a b -> Bool Source # Eq (f a) => Eq (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methods(==) :: Ap f a -> Ap f a -> Bool Source #(/=) :: Ap f a -> Ap f a -> Bool Source # Eq (a :~: b) Since: base-4.7.0.0 Instance detailsDefined in Data.Type.Equality Methods(==) :: (a :~: b) -> (a :~: b) -> Bool Source #(/=) :: (a :~: b) -> (a :~: b) -> Bool Source # Eq (OrderingI a b) Instance detailsDefined in Data.Type.Ord Methods(==) :: OrderingI a b -> OrderingI a b -> Bool Source #(/=) :: OrderingI a b -> OrderingI a b -> Bool Source # Eq (f p) => Eq (Rec1 f p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: Rec1 f p -> Rec1 f p -> Bool Source #(/=) :: Rec1 f p -> Rec1 f p -> Bool Source # Eq (URec (Ptr ()) p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #(/=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # Eq (URec Char p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Char p -> URec Char p -> Bool Source #(/=) :: URec Char p -> URec Char p -> Bool Source # Eq (URec Double p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Double p -> URec Double p -> Bool Source #(/=) :: URec Double p -> URec Double p -> Bool Source # Eq (URec Float p) Instance detailsDefined in GHC.Generics Methods(==) :: URec Float p -> URec Float p -> Bool Source #(/=) :: URec Float p -> URec Float p -> Bool Source # Eq (URec Int p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Int p -> URec Int p -> Bool Source #(/=) :: URec Int p -> URec Int p -> Bool Source # Eq (URec Word p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: URec Word p -> URec Word p -> Bool Source #(/=) :: URec Word p -> URec Word p -> Bool Source # (Eq a, Eq b, Eq c) => Eq (a, b, c) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c) -> (a, b, c) -> Bool Source #(/=) :: (a, b, c) -> (a, b, c) -> Bool Source # (Eq1 f, Eq1 g, Eq a) => Eq (Product f g a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Product Methods(==) :: Product f g a -> Product f g a -> Bool Source #(/=) :: Product f g a -> Product f g a -> Bool Source # (Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Sum Methods(==) :: Sum f g a -> Sum f g a -> Bool Source #(/=) :: Sum f g a -> Sum f g a -> Bool Source # Eq (a :~~: b) Since: base-4.10.0.0 Instance detailsDefined in Data.Type.Equality Methods(==) :: (a :~~: b) -> (a :~~: b) -> Bool Source #(/=) :: (a :~~: b) -> (a :~~: b) -> Bool Source # (Eq (f p), Eq (g p)) => Eq ((f :*: g) p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: (f :*: g) p -> (f :*: g) p -> Bool Source #(/=) :: (f :*: g) p -> (f :*: g) p -> Bool Source # (Eq (f p), Eq (g p)) => Eq ((f :+: g) p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: (f :+: g) p -> (f :+: g) p -> Bool Source #(/=) :: (f :+: g) p -> (f :+: g) p -> Bool Source # Eq c => Eq (K1 i c p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics Methods(==) :: K1 i c p -> K1 i c p -> Bool Source #(/=) :: K1 i c p -> K1 i c p -> Bool Source # (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) Instance detailsDefined in GHC.Classes Methods(==) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #(/=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #