Right to left function composition.
(f . g) x = f (g x)f . id = f = id . fExamples
map ((*2) . length) [[], [0, 1, 2], [0]][0,6,2]
foldr (.) id [(+1), (*3), (^3)] 225
let (...) = (.).(.) in ((*2)...(+)) 5 1030
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27
ModuleCabal-syntax-3.12.1.0Haskell2010
This module does two things:
Acts as a compatibility layer, like base-compat.
Provides commonly used imports.
Right to left function composition.
(f . g) x = f (g x)f . id = f = id . fmap ((*2) . length) [[], [0, 1, 2], [0]][0,6,2]
foldr (.) id [(+1), (*3), (^3)] 225
let (...) = (.).(.) in ((*2)...(+)) 5 1030
Basic numeric class.
The Haskell Report defines no laws for Num. However, (+) and (*) are
customarily expected to define a ring and have the following properties:
(+)(x + y) + z
=
x + (y + z)
(+)x + y
=
y + x
fromInteger 0 is the additive identityx + fromInteger 0
=
x
x + negate x
=
fromInteger 0
(*)(x * y) * z
=
x * (y * z)
fromInteger 1 is the multiplicative identityx * fromInteger 1
=
x
and
fromInteger 1 * x
=
x
(*) with respect to (+)a * (b + c)
=
(a * b) + (a * c)
and
(b + c) * a
=
(b * a) + (c * a)
toIntegerif the type also implements
GHC.Real.Integral
, then
is a left inverse for
, i.e.
fromInteger (toInteger i) == i
Note that it isn't customarily expected that a type instance of both Num
and Ord implement an ordered ring. Indeed, in base only Integer and
Rational do.
(+) :: a -> a -> ainfixl 6(-) :: a -> a -> ainfixl 6(*) :: a -> a -> ainfixl 7negate :: a -> aUnary negation.
abs :: a -> aAbsolute value.
signum :: a -> afromInteger :: Integer -> aConversion from an Integer.
An integer literal represents the application of the function
fromInteger to the appropriate value of type Integer,
so such literals have type (Num a) => a.
Num IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.NumNum NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.NumNum EventTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPollNum EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.PollNum UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.UniqueNum CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesNum IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrNum WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrNum Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntNum Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntNum Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntNum Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntNum CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesNum Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordNum Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordNum Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordNum Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordNum DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
(0.1 + 0.1) + 0.4 == 0.1 + (0.1 + 0.4)False(0.1 + 0.2) * 0.3 == 0.1 * 0.3 + 0.2 * 0.3False(0.1 * 0.1) * 0.3 == 0.1 * (0.1 * 0.3)False
Num FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
(0.1 + 0.1 :: Float) + 0.5 == 0.1 + (0.1 + 0.5)False(0.1 + 0.2 :: Float) * 0.9 == 0.1 * 0.9 + 0.2 * 0.9False(0.1 * 0.1 :: Float) * 0.9 == 0.1 * (0.1 * 0.9)False
Num IntDefined in ghc-internal-9.1003.0 · GHC.Internal.NumNum WordDefined in ghc-internal-9.1003.0 · GHC.Internal.NumNum I8Defined in text-2.1.3 · Data.Text.ForeignNum SizeDefined in text-2.1.3 · Data.Text.Internal.Fusion.SizeNum DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeNum NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeNum CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.CommonNum StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonNum StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonNum BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.CommonRealFloat a => Num (Complex a)Defined in base-4.20.2.0 · Data.ComplexNum a => Num (Max a)Defined in base-4.20.2.0 · Data.SemigroupNum a => Num (Min a)Defined in base-4.20.2.0 · Data.SemigroupNum a => Num (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityNum a => Num (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdNum a => Num (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalNum a => Num (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalIntegral a => Num (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.RealHasResolution a => Num (Fixed a)Defined in base-4.20.2.0 · Data.FixedMultiplication is not associative or distributive:
(0.2 * 0.6 :: Deci) * 0.9 == 0.2 * (0.6 * 0.9)False
(0.1 + 0.1 :: Deci) * 0.5 == 0.1 * 0.5 + 0.1 * 0.5False
Num a => Num (Op a b)Defined in base-4.20.2.0 · Data.Functor.ContravariantNum (f a) => Num (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalNum a => Num (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const(Applicative f, Num a) => Num (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidNote that even if the underlying Num and Applicative instances are lawful, for most Applicatives, this instance will not be lawful. If you use this instance with the list Applicative, the following customary laws will not hold:
Commutativity:
Ap [10,20] + Ap [1,2]Ap {getAp = [11,12,21,22]}Ap [1,2] + Ap [10,20]Ap {getAp = [11,21,12,22]}
Additive inverse:
Ap [] + negate (Ap [])Ap {getAp = []}fromInteger 0 :: Ap [] IntAp {getAp = [0]}
Distributivity:
Ap [1,2] * (3 + 4)Ap {getAp = [7,14]}(Ap [1,2] * 3) + (Ap [1,2] * 4)Ap {getAp = [7,11,10,14]}
Num (f (g a)) => Num (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeDoes the element occur in the structure?
Note: elem is often used in infix form.
Basic usage:
3 `elem` []False
3 `elem` [1,2]False
3 `elem` [1,2,3,4,5]True
For infinite structures, the default implementation of elem terminates if the sought-after value exists at a finite distance from the left side of the structure:
3 `elem` [1..]True
3 `elem` ([4..] ++ [3])* Hangs forever *
Left-associative fold of a structure, lazy in the accumulator. This is rarely what you want, but can work well for structures with efficient right-to-left sequencing and an operator that is lazy in its left argument.
In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xnNote that to produce the outermost application of the operator the entire input list must be traversed. Like all left-associative folds, foldl will diverge if given an infinite list.
If you want an efficient strict left-fold, you probably want to use
foldl' instead of foldl. The reason for this is that the latter
does not force the inner results (e.g. z `f` x1 in the above
example) before applying them to the operator (e.g. to (`f` x2)).
This results in a thunk chain O(n) elements long, which then must be
evaluated from the outside-in.
For a general Foldable structure this should be semantically identical to:
foldl f z = foldl f z . toListThe first example is a strict fold, which in practice is best performed with foldl'.
foldl (+) 42 [1,2,3,4]52
Though the result below is lazy, the input is reversed before prepending it to the initial accumulator, so corecursion begins only after traversing the entire input string.
foldl (\acc c -> c : acc) "abcd" "efgh""hgfeabcd"
A left fold of a structure that is infinite on the right cannot terminate, even when for any finite input the fold just returns the initial accumulator:
foldl (\a _ -> a) 0 $ repeat 1* Hangs forever *
WARNING: When it comes to lists, you always want to use either foldl' or foldr instead.
The largest element of a non-empty structure.
This function is non-total and will raise a runtime exception if the structure happens to be empty. A structure that supports random access and maintains its elements in order should provide a specialised implementation to return the maximum in faster than linear time.
Basic usage:
maximum [1..10]10
maximum []*** Exception: Prelude.maximum: empty list
maximum Nothing*** Exception: maximum: empty structure
WARNING: This function is partial for possibly-empty structures like lists.
The least element of a non-empty structure.
This function is non-total and will raise a runtime exception if the structure happens to be empty. A structure that supports random access and maintains its elements in order should provide a specialised implementation to return the minimum in faster than linear time.
Basic usage:
minimum [1..10]1
minimum []*** Exception: Prelude.minimum: empty list
minimum Nothing*** Exception: minimum: empty structure
WARNING: This function is partial for possibly-empty structures like lists.
The product function computes the product of the numbers of a structure.
Basic usage:
product []1
product [42]42
product [1..10]3628800
product [4.1, 2.0, 1.7]13.939999999999998
product [1..]* Hangs forever *
The sum function computes the sum of the numbers of a structure.
Basic usage:
sum []0
sum [42]42
sum [1..10]55
sum [4.1, 2.0, 1.7]7.8
sum [1..]* Hangs forever *
A functor with application, providing operations to
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 idliftA2 f x y = f Prelude.<$> x <*> yFurther, any definition must satisfy the following:
pure id <*> v = vpure (.) <*> u <*> v <*> w = u <*> (v <*> w)pure f <*> pure x = pure (f x)u <*> pure y = pure ($ y) <*> uThe other methods have the following default definitions, which may be overridden with equivalent specialized implementations:
As a consequence of these laws, the Functor instance for f will satisfy
It may be useful to note that supposing
forall x y. p (q x y) = f x . g yit follows from the above that
liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g vIf f is also a Monad, it should satisfy
(which implies that pure and <*> satisfy the applicative functor laws).
pure :: a -> f aLift a value into the Structure.
pure 1 :: Maybe IntJust 1
pure 'z' :: [Char]"z"
pure (pure ":D") :: Maybe [String]Just [":D"]
(<*>) :: f (a -> b) -> f a -> f binfixl 4Sequential application.
A few functors support an implementation of <*> that is more efficient than the default one.
Used in combination with , (Data.Functor.<$>) can be used to build a record.(<*>)
data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}produceFoo :: Applicative f => f FooproduceBar :: Applicative f => f BarproduceBaz :: Applicative f => f Baz
mkState :: Applicative f => f MyStatemkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
liftA2 :: (a -> b -> c) -> f a -> f b -> f cLift 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.
liftA2 (,) (Just 3) (Just 5)Just (3,5)
liftA2 (+) [1, 2, 3] [4, 5, 6][5,6,7,6,7,8,7,8,9]
(*>) :: f a -> f b -> f binfixl 4Sequence actions, discarding the value of the first argument.
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 3Just 3
Nothing *> Just 3Nothing
Of course a more interesting use case would be to have effectful computations instead of just returning pure values.
import Data.Charimport GHC.Internal.Text.ParserCombinators.ReadPlet p = string "my name is " *> munch1 isAlpha <* eofreadP_to_S p "my name is Simon"[("Simon","")]
(<*) :: f a -> f b -> f ainfixl 4Sequence actions, discarding the value of the second argument.
Applicative LexDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerMonadApplicative ParseResultDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.ParseResultApplicative ParsecParserDefined in Cabal-syntax-3.12.1.0 · Distribution.ParsecApplicative ConditionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionApplicative ComplexDefined in base-4.20.2.0 · Data.ComplexApplicative FirstDefined in base-4.20.2.0 · Data.SemigroupApplicative LastDefined in base-4.20.2.0 · Data.SemigroupApplicative MaxDefined in base-4.20.2.0 · Data.SemigroupApplicative MinDefined in base-4.20.2.0 · Data.SemigroupApplicative GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalApplicative PutMDefined in binary-0.8.9.3 · Data.Binary.PutApplicative PutDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalApplicative SeqDefined in containers-0.7 · Data.Sequence.InternalApplicative TreeDefined in containers-0.7 · Data.TreeApplicative NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseApplicative STMDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncApplicative IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityApplicative FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidApplicative LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidApplicative DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdApplicative DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalApplicative ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalApplicative SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalApplicative ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListf <$> 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"]}Applicative NoIODefined in ghc-internal-9.1003.0 · GHC.Internal.GHCiApplicative Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsApplicative MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseApplicative PDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPApplicative ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPApplicative ReadPrecDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPrecApplicative SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseApplicative IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseApplicative STMDefined in stm-2.5.3.1 · Control.Sequential.STMApplicative PprMDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.PprLibApplicative QDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxApplicative []Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseApplicative ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyApplicative U1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsApplicative (FieldDescrs s)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.FieldDescrsApplicative (ParsecFieldGrammar s)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecApplicative (PrettyFieldGrammar s)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.PrettyApplicative (SetM s)Defined in containers-0.7 · Data.GraphApplicative (State s)Defined in containers-0.7 · Utils.Containers.Internal.StateApplicative (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpApplicative (Either e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.EitherApplicative (StateL s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsApplicative (StateR s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsApplicative (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.STApplicative (IParser t)Defined in text-2.1.3 · Data.Text.Internal.ReadApplicative f => Applicative (Lift f)Defined in transformers-0.6.1.1 · Control.Applicative.LiftA combination is Pure only if both parts are.
Monad m => Applicative (WrappedMonad m)Defined in base-4.20.2.0 · Control.ApplicativeMonad m => Applicative (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.PureMonoid a => Applicative (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseArrow a => Applicative (ArrowMonad a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow(Functor m, Monad m) => Applicative (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeApplicative (t m) => Applicative (LiftingAccum t m)Defined in mtl-2.3.1 · Control.Monad.AccumApplicative (t m) => Applicative (LiftingSelect t m)Defined in mtl-2.3.1 · Control.Monad.SelectApplicative f => Applicative (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidApplicative f => Applicative (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalApplicative f => Applicative (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsApplicative f => Applicative (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsApply f-actions in the reverse order.
Applicative f => Applicative (Reverse f)Defined in transformers-0.6.1.1 · Data.Functor.ReverseDerived instance.
Applicative m => Applicative (Kleisli m a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowApplicative m => Applicative (IdentityT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityApplicative m => Applicative (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ReaderMonad m => Applicative (StateT s m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsMonoid a => Applicative (Constant a)Defined in transformers-0.6.1.1 · Data.Functor.ConstantMonoid m => Applicative (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstArrow a => Applicative (WrappedArrow a b)Defined in base-4.20.2.0 · Control.Applicative(Applicative f, Monad f) => Applicative (WhenMissing f x)Defined in containers-0.7 · Data.IntMap.InternalEquivalent to ReaderT k (ReaderT x (MaybeT f)).
(Functor m, Monad m) => Applicative (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Functor m, Monad m) => Applicative (SelectT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Select(Functor m, Monad m) => Applicative (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Lazy(Functor m, Monad m) => Applicative (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Strict(Functor m, Monad m) => Applicative (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPS(Monoid a, Monoid b) => Applicative (Tuple3 a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base(Monoid w, Applicative m) => Applicative (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Monoid w, Applicative m) => Applicative (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Strict(Monoid w, Functor m, Monad m) => Applicative (AccumT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum(Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsApplicative (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimApplicative (ContT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ContApplicative ((->) r)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid c => Applicative (K1 i c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Applicative f, Applicative g) => Applicative (Product f g)Defined in base-4.20.2.0 · Data.Functor.Product(Applicative f, Applicative g) => Applicative (f :*: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Applicative f, Monad f) => Applicative (WhenMissing f k x)Defined in containers-0.7 · Data.Map.InternalEquivalent to ReaderT k (ReaderT x (MaybeT f)) .
(Monad f, Applicative f) => Applicative (WhenMatched f x y)Defined in containers-0.7 · Data.IntMap.InternalEquivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))
(Monoid a, Monoid b, Monoid c) => Applicative (Tuple4 a b c)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseApplicative f => Applicative (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Applicative f, Applicative g) => Applicative (Compose f g)Defined in base-4.20.2.0 · Data.Functor.Compose(Applicative f, Applicative g) => Applicative (f :.: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Functor m, Monad m) => Applicative (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS(Monad f, Applicative f) => Applicative (WhenMatched f k x y)Defined in containers-0.7 · Data.Map.InternalEquivalent to ReaderT k (ReaderT x (ReaderT y (MaybeT f)))
(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.StrictThe 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:
Furthermore, the Monad and Applicative operations should relate as follows:
The above laws imply:
and that pure and (<*>) satisfy the applicative functor laws.
The instances of Monad for GHC.List.List, Maybe and System.IO.IO
defined in the Prelude satisfy these laws.
(>>=) :: m a -> (a -> m b) -> m binfixl 1Sequentially 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
An alternative name for this function is 'bind', but some people may refer to it as 'flatMap', which results from it being equivialent to
\x f -> join (fmap f x) :: Monad m => m a -> (a -> m b) -> m bwhich can be seen as mapping a value with
Monad m => m a -> m (m b) and then 'flattening' m (m b) to m b using join.
(>>) :: m a -> m b -> m binfixl 1Sequentially 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
or in terms of as(>>=)
as >>= const bsreturn :: a -> m aInject a value into the monadic type. This function should not be different from its default implementation as pure. The justification for the existence of this function is merely historic.
Monad LexDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerMonadMonad ParseResultDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.ParseResultMonad ParsecParserDefined in Cabal-syntax-3.12.1.0 · Distribution.ParsecMonad ConditionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionMonad ComplexDefined in base-4.20.2.0 · Data.ComplexMonad FirstDefined in base-4.20.2.0 · Data.SemigroupMonad LastDefined in base-4.20.2.0 · Data.SemigroupMonad MaxDefined in base-4.20.2.0 · Data.SemigroupMonad MinDefined in base-4.20.2.0 · Data.SemigroupMonad GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalMonad PutMDefined in binary-0.8.9.3 · Data.Binary.PutMonad PutDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalMonad SeqDefined in containers-0.7 · Data.Sequence.InternalMonad TreeDefined in containers-0.7 · Data.TreeMonad NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonad STMDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncMonad IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityMonad FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidMonad LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidMonad DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdMonad DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonad ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonad SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonad NoIODefined in ghc-internal-9.1003.0 · GHC.Internal.GHCiMonad Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonad MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonad PDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPMonad ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPMonad ReadPrecDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPrecMonad SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonad IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonad STMDefined in stm-2.5.3.1 · Control.Sequential.STMMonad PprMDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.PprLibMonad QDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxMonad []Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonad ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyMonad U1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonad (SetM s)Defined in containers-0.7 · Data.GraphMonad (State s)Defined in containers-0.7 · Utils.Containers.Internal.StateMonad (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpMonad (Either e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.EitherMonad (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.STMonad (IParser t)Defined in text-2.1.3 · Data.Text.Internal.ReadMonad m => Monad (WrappedMonad m)Defined in base-4.20.2.0 · Control.ApplicativeMonad m => Monad (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.PureMonad m => Monad (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeMonoid a => Monad (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseArrowApply a => Monad (ArrowMonad a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowMonad (t m) => Monad (LiftingAccum t m)Defined in mtl-2.3.1 · Control.Monad.AccumMonad (t m) => Monad (LiftingSelect t m)Defined in mtl-2.3.1 · Control.Monad.SelectMonad f => Monad (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidMonad f => Monad (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonad f => Monad (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonad m => Monad (Kleisli m a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowMonad m => Monad (StateT s m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsMonad m => Monad (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptMonad m => Monad (IdentityT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityMonad m => Monad (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ReaderMonad m => Monad (SelectT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.SelectMonad m => Monad (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.LazyMonad m => Monad (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.StrictMonad m => Monad (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPSMonad m => Monad (Reverse m)Defined in transformers-0.6.1.1 · Data.Functor.ReverseDerived instance.
(Applicative f, Monad f) => Monad (WhenMissing f x)Defined in containers-0.7 · Data.IntMap.InternalEquivalent to ReaderT k (ReaderT x (MaybeT f)).
(Monoid a, Monoid b) => Monad (Tuple3 a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base(Monoid w, Functor m, Monad m) => Monad (AccumT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum(Monoid w, Monad m) => Monad (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Monoid w, Monad m) => Monad (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictMonad (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonad (ContT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ContMonad ((->) r)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base(Applicative f, Monad f) => Monad (WhenMissing f k x)Defined in containers-0.7 · Data.Map.InternalEquivalent to ReaderT k (ReaderT x (MaybeT f)) .
(Monad f, Applicative f) => Monad (WhenMatched f x y)Defined in containers-0.7 · Data.IntMap.InternalEquivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))
(Monad f, Monad g) => Monad (Product f g)Defined in base-4.20.2.0 · Data.Functor.Product(Monad f, Monad g) => Monad (f :*: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Monoid a, Monoid b, Monoid c) => Monad (Tuple4 a b c)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonad f => Monad (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonad m => Monad (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS(Monad f, Applicative f) => Monad (WhenMatched f k x y)Defined in containers-0.7 · Data.Map.InternalEquivalent to ReaderT k (ReaderT x (ReaderT y (MaybeT f)))
(Monoid w, Monad m) => Monad (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy(Monoid w, Monad m) => Monad (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.StrictThe character type Char represents Unicode codespace and its elements are code points as in definitions D9 and D10 of the Unicode Standard.
Character literals in Haskell are single-quoted: 'Q', 'Я' or 'Ω'.
To represent a single quote itself use '\'', and to represent a backslash
use '\\'. The full grammar can be found in the section 2.6 of the
Haskell 2010 Language Report.
To specify a character by its code point one can use decimal, hexadecimal
or octal notation: '\65', '\x41' and '\o101' are all alternative forms
of 'A'. The largest code point is '\x10ffff'.
There is a special escape syntax for ASCII control characters:
Escape | Alternatives | Meaning |
|---|---|---|
|
| null character |
|
| start of heading |
|
| start of text |
|
| end of text |
|
| end of transmission |
|
| enquiry |
|
| acknowledge |
|
,
| bell (alert) |
|
,
| backspace |
|
,
| horizontal tab |
|
,
| line feed (new line) |
|
,
| vertical tab |
|
,
| form feed |
|
,
| carriage return |
|
| shift out |
|
| shift in |
|
| data link escape |
|
| device control 1 |
|
| device control 2 |
|
| device control 3 |
|
| device control 4 |
|
| negative acknowledge |
|
| synchronous idle |
|
| end of transmission block |
|
| cancel |
|
| end of medium |
|
| substitute |
|
| escape |
|
| file separator |
|
| group separator |
|
| record separator |
|
| unit separator |
|
,
| space |
|
| delete |
Bounded CharDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum CharDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEq CharDefined in ghc-prim-0.12.0 · GHC.ClassesData CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataOrd CharDefined in ghc-prim-0.12.0 · GHC.ClassesRead CharDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadShow CharDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowIx CharDefined in ghc-internal-9.1003.0 · GHC.Internal.IxStorable CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorableIsChar CharDefined in base-4.20.2.0 · Text.PrintfPrintfArg CharDefined in base-4.20.2.0 · Text.PrintfNFData CharDefined in deepseq-1.5.0.0 · Control.DeepSeqPretty CharDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty CharDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary CharDefined in binary-0.8.9.3 · Data.Binary.ClassStructured CharDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift CharDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxTestCoercion SCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsTestEquality SCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsIArray UArray CharDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Char IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMonad m => Stream FieldLineStream m CharDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.FieldLineStreamMonad m => Stream ByteString m CharDefined in parsec-3.1.18.0 · Text.Parsec.PrimMonad m => Stream ByteString m CharDefined in parsec-3.1.18.0 · Text.Parsec.PrimMonad m => Stream Text m CharDefined in parsec-3.1.18.0 · Text.Parsec.PrimMonad m => Stream Text m CharDefined in parsec-3.1.18.0 · Text.Parsec.PrimGeneric1 (URec Char)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFoldable UCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable UCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableMArray (STUArray s) Char (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Char)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep (URec Char p) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UChar"
'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UChar))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 (URec Char) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UChar"
'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UChar))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericsdata URec CharDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsUsed for marking occurrences of Char#
type Compare a b = CmpChar a bDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.OrdThe Either type represents values with two possibilities: a value of
type Either a b is either Left a or Right b.
The Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct").
The type Either String Int is the type of values which can be either
a String or an Int. The Left constructor can be used only on
Strings, and the Right constructor can be used only on Ints:
let s = Left "foo" :: Either String IntsLeft "foo"let n = Right 3 :: Either String IntnRight 3:type ss :: Either String Int:type nn :: Either String Int
The fmap from our Functor instance will ignore Left values, but will apply the supplied function to values contained in a Right:
let s = Left "foo" :: Either String Intlet n = Right 3 :: Either String Intfmap (*2) sLeft "foo"fmap (*2) nRight 6
The Monad instance for Either allows us to chain together multiple actions which may fail, and fail overall if any of the individual steps failed. First we'll write a function that can either parse an Int from a Char, or fail.
import Data.Char ( digitToInt, isDigit ):{ let parseEither :: Char -> Either String Int parseEither c | isDigit c = Right (digitToInt c) | otherwise = Left "parse error":}
The following should work, since both '1' and '2' can be
parsed as Ints.
:{ let parseMultiple :: Either String Int parseMultiple = do x <- parseEither '1' y <- parseEither '2' return (x + y):}
parseMultipleRight 3
But the following should fail overall, since the first operation where
we attempt to parse 'm' as an Int will fail:
:{ let parseMultiple :: Either String Int parseMultiple = do x <- parseEither 'm' y <- parseEither '2' return (x + y):}
parseMultipleLeft "parse error"
Bifoldable EitherDefined in base-4.20.2.0 · Data.BifoldableBifoldable1 EitherDefined in base-4.20.2.0 · Data.Bifoldable1Bifunctor EitherDefined in base-4.20.2.0 · Data.BifunctorBitraversable EitherDefined in base-4.20.2.0 · Data.BitraversableEq2 EitherDefined in base-4.20.2.0 · Data.Functor.ClassesOrd2 EitherDefined in base-4.20.2.0 · Data.Functor.ClassesRead2 EitherDefined in base-4.20.2.0 · Data.Functor.ClassesShow2 EitherDefined in base-4.20.2.0 · Data.Functor.ClassesNFData2 EitherDefined in deepseq-1.5.0.0 · Control.DeepSeqGeneric1 (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonadError e (Either e)Defined in mtl-2.3.1 · Control.Monad.Error.Class(Lift a, Lift b) => Lift (Either a b)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxMonad (Either e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.EitherFunctor (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.EitherMonadFix (Either e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FixApplicative (Either e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.EitherFoldable (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableEq a => Eq1 (Either a)Defined in base-4.20.2.0 · Data.Functor.ClassesOrd a => Ord1 (Either a)Defined in base-4.20.2.0 · Data.Functor.ClassesRead a => Read1 (Either a)Defined in base-4.20.2.0 · Data.Functor.ClassesShow a => Show1 (Either a)Defined in base-4.20.2.0 · Data.Functor.ClassesNFData a => NFData1 (Either a)Defined in deepseq-1.5.0.0 · Control.DeepSeqe ~ SomeException => MonadCatch (Either e)Defined in exceptions-0.10.9 · Control.Monad.Catche ~ SomeException => MonadMask (Either e)Defined in exceptions-0.10.9 · Control.Monad.Catche ~ SomeException => MonadThrow (Either e)Defined in exceptions-0.10.9 · Control.Monad.Catch(Eq a, Eq b) => Eq (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either(Data a, Data b) => Data (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Ord a, Ord b) => Ord (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either(Read a, Read b) => Read (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either(Show a, Show b) => Show (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.EitherGeneric (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either(NFData a, NFData b) => NFData (Either a b)Defined in deepseq-1.5.0.0 · Control.DeepSeq(Pretty a, Pretty b) => Pretty (Either a b)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass(Pretty a, Pretty b) => Pretty (Either a b)Defined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass(Binary a, Binary b) => Binary (Either a b)Defined in binary-0.8.9.3 · Data.Binary.Class(Structured a, Structured b) => Structured (Either a b)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(IsNode a, IsNode b, Key a ~ Key b) => IsNode (Either a b)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.GraphNewtype (Either License License) SpecLicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.NewtypesNewtype (Either License License) SpecLicenseLenientDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfo.FieldGrammartype Rep (Either a b) = D1 ('MetaData "Either"
"GHC.Internal.Data.Either"
"ghc-internal"
'False) (C1 ('MetaCons "Left"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Right"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 (Either a) = D1 ('MetaData "Either"
"GHC.Internal.Data.Either"
"ghc-internal"
'False) (C1 ('MetaCons "Left"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "Right"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Key (Either a b) = Key aDefined in Cabal-syntax-3.12.1.0 · Distribution.Compat.GraphA fixed-precision integer type with at least the range [-2^29 .. 2^29-1].
The exact range for a given implementation can be determined by using
Prelude.minBound and Prelude.maxBound from the Prelude.Bounded class.
Bounded IntDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum IntDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEq IntDefined in ghc-prim-0.12.0 · GHC.ClassesIntegral IntDefined in ghc-internal-9.1003.0 · GHC.Internal.RealData IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum IntDefined in ghc-internal-9.1003.0 · GHC.Internal.NumOrd IntDefined in ghc-prim-0.12.0 · GHC.ClassesRead IntDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal IntDefined in ghc-internal-9.1003.0 · GHC.Internal.RealShow IntDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowIx IntDefined in ghc-internal-9.1003.0 · GHC.Internal.IxBits IntDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsFiniteBits IntDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsStorable IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg IntDefined in base-4.20.2.0 · Text.PrintfNFData IntDefined in deepseq-1.5.0.0 · Control.DeepSeqPretty IntDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty IntDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary IntDefined in binary-0.8.9.3 · Data.Binary.ClassShowPadded IntDefined in time-1.12.2 · Data.Time.Calendar.PrivatePretty IntDefined in Cabal-syntax-3.12.1.0 · Distribution.PrettyStructured IntDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift IntDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray IntDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Int IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Int)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFoldable UIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable UIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableMArray (STUArray s) Int (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Int)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep (URec Int p) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UInt"
'PrefixI 'True) (S1 ('MetaSel ('Just "uInt#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UInt))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 (URec Int) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UInt"
'PrefixI 'True) (S1 ('MetaSel ('Just "uInt#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UInt))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericsdata URec IntDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsUsed for marking occurrences of Int#
The Maybe type encapsulates an optional value. A value of type
Maybe a either contains a value of type a (represented as Just a),
or it is empty (represented as Nothing). Using Maybe is a good way to
deal with errors or exceptional cases without resorting to drastic
measures such as error.
The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Either type.
Monad MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadFix MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FixMonadFail MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FailApplicative MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFoldable MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableAlternative MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadPlus MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadZip MaybeDefined in base-4.20.2.0 · Control.Monad.ZipEq1 MaybeDefined in base-4.20.2.0 · Data.Functor.ClassesOrd1 MaybeDefined in base-4.20.2.0 · Data.Functor.ClassesRead1 MaybeDefined in base-4.20.2.0 · Data.Functor.ClassesShow1 MaybeDefined in base-4.20.2.0 · Data.Functor.ClassesNFData1 MaybeDefined in deepseq-1.5.0.0 · Control.DeepSeqMonadThrow MaybeDefined in exceptions-0.10.9 · Control.Monad.CatchGeneric1 MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonadError () MaybeDefined in mtl-2.3.1 · Control.Monad.Error.ClassLift a => Lift (Maybe a)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq a => Eq (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.MaybeData a => Data (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataOrd a => Ord (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.MaybeRead a => Read (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadShow a => Show (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowGeneric (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup a => Semigroup (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup a => Monoid (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseLift a semigroup into Maybe forming a Monoid according to
http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be
turned into a monoid simply by adjoining an element e not in S
and defining e*e = e and e*s = s = s*e for all s ∈ S."
Since 4.11.0: constraint on inner a value generalised from
Monoid to Semigroup.
SingKind a => SingKind (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsNFData a => NFData (Maybe a)Defined in deepseq-1.5.0.0 · Control.DeepSeqPretty a => Pretty (Maybe a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty a => Pretty (Maybe a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary a => Binary (Maybe a)Defined in binary-0.8.9.3 · Data.Binary.ClassStructured a => Structured (Maybe a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredSingI 'NothingDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSingI a2 => SingI ('Just a2)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep (Maybe a) = D1 ('MetaData "Maybe"
"GHC.Internal.Maybe"
"ghc-internal"
'False) (C1 ('MetaCons "Nothing"
'PrefixI 'False) U1 :+: C1 ('MetaCons "Just"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 Maybe = D1 ('MetaData "Maybe"
"GHC.Internal.Maybe"
"ghc-internal"
'False) (C1 ('MetaCons "Nothing"
'PrefixI 'False) U1 :+: C1 ('MetaCons "Just"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype DemoteRep (Maybe a) = Maybe (DemoteRep a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericsdata SingDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsThe Ord class is used for totally ordered datatypes.
Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects.
Ord, as defined by the Haskell report, implements a total order and has the following properties:
x <= y || y <= x
=
if
x <= y && y <= z
=
, then
x <= z
=
x <= x
=
if
x <= y && y <= x
=
, then
x == y
=
The following operator interactions are expected to hold:
x >= y = y <= x
x < y = x <= y && x /= y
x > y = y < x
x < y = compare x y == LT
x > y = compare x y == GT
x == y = compare x y == EQ
min x y == if x <= y then x else y = True
max x y == if x >= y then x else y = True
Note that (7.) and (8.) do not require min and max to return either of
their arguments. The result is merely required to equal one of the
arguments in terms of (==).
Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.
Ord OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackOrd OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackOrd CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionOrd CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerOrd CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerOrd LexWarningTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerMonadOrd LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseOrd ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameOrd PositionDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.PositionOrd PWarnTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningOrd PWarningDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningOrd LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseOrd LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdOrd LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionOrd SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionOrd LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdOrd LicenseListVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseListVersionOrd LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceOrd ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemOrd OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemOrd PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemOrd BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkOrd BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceOrd BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeOrd BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoOrd BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeOrd ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdOrd ComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameOrd NotLibComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameOrd DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyOrd ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyOrd ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableOrd ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeOrd FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagOrd FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagOrd ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOrd LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOrd ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionOrd ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeOrd IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingOrd LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyOrd LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryOrd LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameOrd LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityOrd MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinOrd ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleOrd ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportOrd ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingOrd MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdOrd MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameOrd PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionOrd PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdOrd PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameOrd PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyOrd PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameOrd PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionOrd PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeOrd SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoOrd KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoOrd RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoOrd RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoOrd SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoOrd TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteOrd TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceOrd TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeOrd DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdOrd UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdOrd UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameOrd VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionOrd LowerBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.Legacylb1 <= lb2 holds iff interval lb1.. is contained in interval lb2...
Ord UpperBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.Legacyub1 <= ub2 holds iff interval 0..ub1 is contained in interval 0..ub2.
Ord VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalOrd ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextOrd StructureDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredOrd ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionOrd KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionOrd LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionOrd ByteArrayDefined in base-4.20.2.0 · Data.Array.ByteNon-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions.
Ord ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeOrd ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalOrd ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalLexicographic order.
Ord IntSetDefined in containers-0.7 · Data.IntSet.InternalOrd FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.CommonOrd PermissionsDefined in directory-1.3.8.5 · System.Directory.Internal.CommonOrd XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.CommonOrd XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.CommonOrd BigNatDefined in ghc-bignum-1.3 · GHC.Num.BigNatOrd IntegerDefined in ghc-bignum-1.3 · GHC.Num.IntegerOrd NaturalDefined in ghc-bignum-1.3 · GHC.Num.NaturalOrd ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.TypeOrd VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseOrd ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrderOrd ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesOrd BlockReasonDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncOrd ThreadIdDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncOrd ThreadStatusDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncOrd AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalOrd AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalOrd SomeTypeRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.InternalOrd UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.UniqueOrd VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.VersionOrd TimeoutKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimeOutOrd UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.UniqueOrd ErrorCallDefined in ghc-internal-9.1003.0 · GHC.Internal.ExceptionOrd ArithExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeOrd FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Fingerprint.TypeOrd CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesOrd IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrOrd WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrOrd AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.DeviceOrd ArrayExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionOrd AsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionOrd ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionOrd BufferModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesOrd NewlineDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesOrd NewlineModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesOrd IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOModeOrd Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntOrd Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntOrd Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntOrd Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntOrd CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CTimerDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesOrd SomeCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsOrd SomeSymbolDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsOrd SomeNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNatsOrd GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.UnicodeOrd Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordOrd Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordOrd Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordOrd Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordOrd BoolDefined in ghc-prim-0.12.0 · GHC.ClassesOrd CharDefined in ghc-prim-0.12.0 · GHC.ClassesOrd DoubleDefined in ghc-prim-0.12.0 · GHC.ClassesIEEE 754 Double-precision type includes not only numbers, but also
positive and negative infinities and a special element called NaN
(which can be quiet or signal).
IEEE 754-2008, section 5.11 requires that if at least one of arguments of
<=, <, >, >= is NaN then the result of the comparison is False,
and instance Ord Double complies with this requirement. This violates
the reflexivity: both NaN <= NaN and NaN >= NaN are False.
IEEE 754-2008, section 5.10 defines totalOrder predicate. Unfortunately,
compare on Doubles violates the IEEE standard and does not define a total order.
More specifically, both compare NaN x and compare x NaN always return GT.
Thus, users must be extremely cautious when using instance Ord Double.
For instance, one should avoid ordered containers with keys represented by Double,
because data loss and corruption may happen. An IEEE-compliant compare is available
in fp-ieee package as TotallyOrdered newtype.
Moving further, the behaviour of min and max with regards to NaN is
also non-compliant. IEEE 754-2008, section 5.3.1 defines that quiet NaN
should be treated as a missing data by minNum and maxNum functions,
for example, minNum(NaN, 1) = minNum(1, NaN) = 1. Some languages such as Java
deviate from the standard implementing minNum(NaN, 1) = minNum(1, NaN) = NaN.
However, min / max in base are even worse: min NaN 1 is 1, but min 1 NaN
is NaN.
IEEE 754-2008 compliant min / max can be found in ieee754 package under
minNum / maxNum names. Implementations compliant with
minimumNumber / maximumNumber from a newer
IEEE 754-2019,
section 9.6 are available from fp-ieee package.
Ord FloatDefined in ghc-prim-0.12.0 · GHC.ClassesOrd IntDefined in ghc-prim-0.12.0 · GHC.ClassesOrd OrderingDefined in ghc-prim-0.12.0 · GHC.ClassesOrd TyConDefined in ghc-prim-0.12.0 · GHC.ClassesOrd WordDefined in ghc-prim-0.12.0 · GHC.ClassesOrd OsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesByte ordering of the internal representation.
Ord OsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesByte ordering of the internal representation.
Ord PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesOrd PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesOrd WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesOrd WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesOrd MessageDefined in parsec-3.1.18.0 · Text.Parsec.ErrorOrd SourcePosDefined in parsec-3.1.18.0 · Text.Parsec.PosOrd PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassOrd PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassOrd AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd I8Defined in text-2.1.3 · Data.Text.ForeignOrd TextDefined in text-2.1.3 · Data.Text · orphanOrd BuilderDefined in text-2.1.3 · Data.Text.Internal.BuilderOrd TextDefined in text-2.1.3 · Data.Text.Lazy · orphanOrd DayDefined in time-1.12.2 · Data.Time.Calendar.DaysOrd MonthDefined in time-1.12.2 · Data.Time.Calendar.MonthOrd QuarterDefined in time-1.12.2 · Data.Time.Calendar.QuarterOrd QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.QuarterOrd DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekOrd AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.AbsoluteTimeOrd DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeOrd NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeOrd SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTimeOrd UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTimeOrd UniversalTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UniversalTimeOrd TimeLocaleDefined in time-1.12.2 · Data.Time.Format.LocaleOrd LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTimeOrd TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDayOrd TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZoneOrd DirTypeDefined in unix-2.8.7.0 · System.Posix.Directory.CommonOrd CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.CommonOrd StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonOrd StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonOrd OpenFileFlagsDefined in unix-2.8.7.0 · System.Posix.IO.CommonOrd OpenModeDefined in unix-2.8.7.0 · System.Posix.IO.CommonOrd ProcessStatusDefined in unix-2.8.7.0 · System.Posix.Process.InternalsOrd BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.CommonOrd ()Defined in ghc-prim-0.12.0 · GHC.ClassesIntegral a => Ord (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.RealOrd (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.ConstPtrOrd (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ForeignPtrOrd (FunPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.PtrOrd (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.PtrOrd (SChar c)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsOrd (SSymbol s)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsOrd (SNat n)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeNatsOrd a => Ord (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetOrd a => Ord (First' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupOrd a => Ord (Last' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupOrd a => Ord (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupOrd a => Ord (First a)Defined in base-4.20.2.0 · Data.SemigroupOrd a => Ord (Last a)Defined in base-4.20.2.0 · Data.SemigroupOrd a => Ord (Max a)Defined in base-4.20.2.0 · Data.SemigroupOrd a => Ord (Min a)Defined in base-4.20.2.0 · Data.SemigroupOrd a => Ord (IntMap a)Defined in containers-0.7 · Data.IntMap.InternalOrd a => Ord (Seq a)Defined in containers-0.7 · Data.Sequence.InternalOrd a => Ord (ViewL a)Defined in containers-0.7 · Data.Sequence.InternalOrd a => Ord (ViewR a)Defined in containers-0.7 · Data.Sequence.InternalOrd a => Ord (Intersection a)Defined in containers-0.7 · Data.Set.InternalOrd a => Ord (Set a)Defined in containers-0.7 · Data.Set.InternalOrd a => Ord (Tree a)Defined in containers-0.7 · Data.TreeOrd a => Ord (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseOrd a => Ord (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityOrd a => Ord (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidOrd a => Ord (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidOrd a => Ord (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdOrd a => Ord (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalOrd a => Ord (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalOrd a => Ord (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalOrd a => Ord (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListOrd a => Ord (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.MaybeOrd a => Ord (Stream a)Defined in text-2.1.3 · Data.Text.Internal.Fusion.TypesOrd a => Ord (a)Defined in ghc-prim-0.12.0 · GHC.ClassesOrd a => Ord [a]Defined in ghc-prim-0.12.0 · GHC.ClassesOrd ann => Ord (Field ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldOrd ann => Ord (FieldLine ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldOrd ann => Ord (Name ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldOrd ann => Ord (SectionArg ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldOrd flag => Ord (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxOrd m => Ord (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupOrd p => Ord (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd v => Ord (PerCompilerFlavor v)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerOrd (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathOrd (Fixed a)Defined in base-4.20.2.0 · Data.FixedOrd (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyOrd (TypeRep a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.InternalOrd (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd a => Ord (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup(Ord1 f, Ord a) => Ord (Lift f a)Defined in transformers-0.6.1.1 · Control.Applicative.Lift(Ord1 m, Ord a) => Ord (MaybeT m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe(Ix i, Ord e) => Ord (Array i e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Arr(Ix ix, Ord e, IArray UArray e) => Ord (UArray ix e)Defined in array-0.5.8.0 · Data.Array.Base(Ord a, Ord b) => Ord (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either(Ord a, Ord b) => Ord (a, b)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord k, Ord v) => Ord (Map k v)Defined in containers-0.7 · Data.Map.InternalOrd (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.CoercionOrd (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec (Ptr ()) p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityOrd (f a) => Ord (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidOrd (f a) => Ord (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalOrd (f p) => Ord (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd a => Ord (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstOrd a => Ord (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant(Ord1 f, Ord a) => Ord (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards(Ord1 f, Ord a) => Ord (IdentityT f a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity(Ord1 f, Ord a) => Ord (Reverse f a)Defined in transformers-0.6.1.1 · Data.Functor.Reverse(Generic1 f, Ord (Rep1 f a)) => Ord (Generically1 f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Ord a, Ord b, Ord c) => Ord (a, b, c)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Ord w, Ord1 m, Ord a) => Ord (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Ord w, Ord1 m, Ord a) => Ord (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictOrd (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityOrd c => Ord (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Ord (f a), Ord (g a)) => Ord (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product(Ord (f a), Ord (g a)) => Ord (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum(Ord (f p), Ord (g p)) => Ord ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Ord (f p), Ord (g p)) => Ord ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)Defined in ghc-prim-0.12.0 · GHC.ClassesOrd (f (g a)) => Ord (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeOrd (f (g p)) => Ord ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (f p) => Ord (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-prim-0.12.0 · GHC.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-prim-0.12.0 · GHC.ClassesString is an alias for a list of characters.
String constants in Haskell are values of type String.
That means if you write a string literal like "hello world",
it will have the type [Char], which is the same as String.
Note: You can ask the compiler to automatically infer different types
with the -XOverloadedStrings language extension, for example
"hello world" :: Text. See IsString for more information.
Because String is just a list of characters, you can use normal list functions
to do basic string manipulation. See Data.List for operations on lists.
[Char] is a relatively memory-inefficient type.
It is a linked list of boxed word-size characters, internally it looks something like:
╭─────┬───┬──╮ ╭─────┬───┬──╮ ╭─────┬───┬──╮ ╭────╮
│ (:) │ │ ─┼─>│ (:) │ │ ─┼─>│ (:) │ │ ─┼─>│ [] │
╰─────┴─┼─┴──╯ ╰─────┴─┼─┴──╯ ╰─────┴─┼─┴──╯ ╰────╯
v v v
'a' 'b' 'c'The String "abc" will use 5*3+1 = 16 (in general 5n+1)
words of space in memory.
Furthermore, operations like (++) (string concatenation) are O(n)
(in the left argument).
For historical reasons, the base library uses String in a lot of places
for the conceptual simplicity, but library code dealing with user-data
should use the text
package for Unicode text, or the the
bytestring package
for binary data.
Newtype String FilePathNTDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.NewtypesNewtype String TokenDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.NewtypesNewtype String Token'Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.NewtypesNewtype String CompatFilePathDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.FieldGrammarNewtype String CompatPackageKeyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfo.FieldGrammarParsing of Strings, producing values.
Derived instances of Read make the following assumptions, which
derived instances of Text.Show.Show obey:
If the constructor is defined to be an infix operator, then the derived Read instance will parse only infix applications of the constructor (not the prefix form).
Associativity is not used to reduce the occurrence of parentheses, although precedence may be.
If the constructor is defined using record syntax, the derived Read will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.
The derived Read instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.
For example, given the declarations
infixr 5 :^:
data Tree a = Leaf a | Tree a :^: Tree athe derived instance of Read in Haskell 2010 is equivalent to
instance (Read a) => Read (Tree a) where
readsPrec d r = readParen (d > app_prec)
(\r -> [(Leaf m,t) |
("Leaf",s) <- lex r,
(m,t) <- readsPrec (app_prec+1) s]) r
++ readParen (d > up_prec)
(\r -> [(u:^:v,w) |
(u,s) <- readsPrec (up_prec+1) r,
(":^:",t) <- lex s,
(v,w) <- readsPrec (up_prec+1) t]) r
where app_prec = 10
up_prec = 5Note that right-associativity of :^: is unused.
The derived instance in GHC is equivalent to
instance (Read a) => Read (Tree a) where
readPrec = parens $ (prec app_prec $ do
Ident "Leaf" <- lexP
m <- step readPrec
return (Leaf m))
+++ (prec up_prec $ do
u <- step readPrec
Symbol ":^:" <- lexP
v <- step readPrec
return (u :^: v))
where app_prec = 10
up_prec = 5
readListPrec = readListPrecDefaultWhy do both readsPrec and readPrec exist, and why does GHC opt to implement readPrec in derived Read instances instead of readsPrec? The reason is that readsPrec is based on the ReadS type, and although ReadS is mentioned in the Haskell 2010 Report, it is not a very efficient parser data structure.
readPrec, on the other hand, is based on a much more efficient ReadPrec
datatype (a.k.a "new-style parsers"), but its definition relies on the use
of the RankNTypes language extension. Therefore, readPrec (and its
cousin, readListPrec) are marked as GHC-only. Nevertheless, it is
recommended to use readPrec instead of readsPrec whenever possible
for the efficiency improvements it brings.
As mentioned above, derived Read instances in GHC will implement readPrec instead of readsPrec. The default implementations of readsPrec (and its cousin, readList) will simply use readPrec under the hood. If you are writing a Read instance by hand, it is recommended to write it like so:
instance Read T where
readPrec = ...
readListPrec = readListPrecDefault
readsPrec :: Int -> ReadS aattempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty.
Derived instances of Read and Text.Show.Show satisfy the following:
That is, readsPrec parses the string produced by showsPrec, and delivers the value that showsPrec started with.
readList :: ReadS [a]Read OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackRead OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackRead CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionRead AbiTagDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerRead CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerRead CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerRead CompilerInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerRead LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseRead ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameRead LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseRead LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdRead LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionRead SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionRead LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdRead LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceRead ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemRead OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemRead PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemRead AbiDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiDependencyRead AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHashRead BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkRead BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceRead BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeRead BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoRead BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeRead ComponentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentRead ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdRead ComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameRead NotLibComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameRead ComponentRequestedSpecDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentRequestedSpecRead DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyRead DependencyMapDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyMapRead ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyRead ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableRead ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeRead ExposedModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExposedModuleRead FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagRead FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagRead ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibRead LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibRead ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionRead ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeRead IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingRead InstalledPackageInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfoRead LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyRead LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryRead LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameRead LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityRead MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinRead ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRead ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportRead ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingRead MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdRead MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameRead PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionRead PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdRead PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameRead PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraintRead PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyRead PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameRead PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRead PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeRead SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoRead KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoRead RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoRead RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoRead SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoRead TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteRead TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceRead TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeRead DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdRead UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdRead UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameRead VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRead VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalRead ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextRead ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionRead KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionRead LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionRead ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeRead ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalRead ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalRead IntSetDefined in containers-0.7 · Data.IntSet.InternalRead FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.CommonRead PermissionsDefined in directory-1.3.8.5 · System.Directory.Internal.CommonRead XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.CommonRead XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.CommonRead IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrderRead AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalRead AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalRead VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.VersionRead CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRead IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrRead WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrRead AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.DeviceRead ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionRead BufferModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesRead NewlineDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesRead NewlineModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesRead IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOModeRead Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntRead Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntRead Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntRead Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntRead GCDetailsDefined in ghc-internal-9.1003.0 · GHC.Internal.StatsRead RTSStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.StatsRead CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesRead LexemeDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead SomeCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsRead SomeSymbolDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsRead SomeNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNatsRead GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead CharDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead IntDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead WordDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead I8Defined in text-2.1.3 · Data.Text.ForeignRead TextDefined in text-2.1.3 · Data.Text · orphanRead TextDefined in text-2.1.3 · Data.Text.Lazy · orphanRead FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloatRead DayDefined in time-1.12.2 · Data.Time.Format.Parse · orphanRead MonthDefined in time-1.12.2 · Data.Time.Calendar.MonthRead as yyyy-mm.
Read QuarterDefined in time-1.12.2 · Data.Time.Calendar.QuarterRead as yyyy-Qn.
Read QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.QuarterRead DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekRead DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeRead NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeRead UTCTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphanRead UniversalTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphanRead LocalTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphanRead TimeOfDayDefined in time-1.12.2 · Data.Time.Format.Parse · orphanRead TimeZoneDefined in time-1.12.2 · Data.Time.Format.Parse · orphanThis only works for ±HHMM format,
single-letter military time-zones,
and these time-zones: "UTC", "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT",
per RFC 822 section 5.
Read ZonedTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphanThis only works for a zonedTimeZone in ±HHMM format,
single-letter military time-zones,
and these time-zones: "UTC", "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT",
per RFC 822 section 5.
Read RTLDFlagsDefined in unix-2.8.7.0 · System.Posix.DynamicLinker.PrimRead CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.CommonRead StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonRead StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonRead OpenFileFlagsDefined in unix-2.8.7.0 · System.Posix.IO.CommonRead OpenModeDefined in unix-2.8.7.0 · System.Posix.IO.CommonRead GroupEntryDefined in unix-2.8.7.0 · System.Posix.User.CommonRead UserEntryDefined in unix-2.8.7.0 · System.Posix.User.CommonRead ()Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead a => Read (Last' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupRead a => Read (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupRead a => Read (VersionRangeF a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalRead a => Read (Complex a)Defined in base-4.20.2.0 · Data.ComplexRead a => Read (First a)Defined in base-4.20.2.0 · Data.SemigroupRead a => Read (Last a)Defined in base-4.20.2.0 · Data.SemigroupRead a => Read (Max a)Defined in base-4.20.2.0 · Data.SemigroupRead a => Read (Min a)Defined in base-4.20.2.0 · Data.SemigroupRead a => Read (Seq a)Defined in containers-0.7 · Data.Sequence.InternalRead a => Read (ViewL a)Defined in containers-0.7 · Data.Sequence.InternalRead a => Read (ViewR a)Defined in containers-0.7 · Data.Sequence.InternalRead a => Read (Tree a)Defined in containers-0.7 · Data.TreeRead a => Read (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead a => Read (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsRead a => Read (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsRead a => Read (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsRead a => Read (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsRead a => Read (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityThis instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed
Read a => Read (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidRead a => Read (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidRead a => Read (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdRead a => Read (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalRead a => Read (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalRead a => Read (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalRead a => Read (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListRead a => Read (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead a => Read (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead a => Read [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadRead e => Read (IntMap e)Defined in containers-0.7 · Data.IntMap.InternalRead m => Read (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupRead p => Read (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead v => Read (PerCompilerFlavor v)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerRead vertex => Read (SCC vertex)Defined in containers-0.7 · Data.Graph(IsNode a, Read a, Show (Key a)) => Read (Graph a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.Graph(Read a, Ord a) => Read (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySet(Read a, Ord a) => Read (Set a)Defined in containers-0.7 · Data.Set.Internal(Integral a, Read a) => Read (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadHasResolution a => Read (Fixed a)Defined in base-4.20.2.0 · Data.FixedRead (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathRead (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyRead (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Read1 f, Read a) => Read (Lift f a)Defined in transformers-0.6.1.1 · Control.Applicative.Lift(Read1 m, Read a) => Read (MaybeT m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe(Ix a, Read a, Read b) => Read (Array a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Ix ix, Read ix, Read e, IArray UArray e) => Read (UArray ix e)Defined in array-0.5.8.0 · Data.Array.Base(Read a, Read b) => Read (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup(Read a, Read b) => Read (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either(Read a, Read b) => Read (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Ord k, Read k, Read e) => Read (Map k e)Defined in containers-0.7 · Data.Map.InternalRead (f a) => Read (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidRead (f a) => Read (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalRead (f p) => Read (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead a => Read (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstRead a => Read (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.ConstantCoercible a b => Read (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Coercion(Read1 f, Read a) => Read (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards(Read1 f, Read a) => Read (IdentityT f a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity(Read1 f, Read a) => Read (Reverse f a)Defined in transformers-0.6.1.1 · Data.Functor.Reverse(Read a, Read b, Read c) => Read (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read e, Read1 m, Read a) => Read (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Read w, Read1 m, Read a) => Read (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Read w, Read1 m, Read a) => Read (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Stricta ~ b => Read (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityRead c => Read (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Read (f a), Read (g a)) => Read (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product(Read (f a), Read (g a)) => Read (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum(Read (f p), Read (g p)) => Read ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Read (f p), Read (g p)) => Read ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Read a, Read b, Read c, Read d) => Read (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Reada ~~ b => Read (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityRead (f (g a)) => Read (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeRead (f (g p)) => Read ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsRead (f p) => Read (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h) => Read (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i) => Read (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j) => Read (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k) => Read (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l) => Read (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n, Read o) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1003.0 · GHC.Internal.Readerror stops execution and displays an error message.
The value of is bottom if seq a ba is bottom, and
otherwise equal to b. In other words, it evaluates the first
argument a to weak head normal form (WHNF). seq is usually
introduced to improve performance by avoiding unneeded laziness.
A note on evaluation order: the expression does
not guarantee that seq a ba will be evaluated before b.
The only guarantee given by seq is that the both a
and b will be evaluated before seq returns a value.
In particular, this means that b may be evaluated before
a. If you need to guarantee a specific order of evaluation,
you must use the function pseq from the "parallel" package.
Conversion of values to readable Strings.
Derived instances of Show have the following properties, which
are compatible with derived instances of Text.Read.Read:
The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.
If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.
the representation will be enclosed in parentheses if the
precedence of the top-level constructor in x is less than d
(associativity is ignored). Thus, if d is 0 then the result
is never surrounded in parentheses; if d is 11 it is always
surrounded in parentheses, unless it is an atomic expression.
If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.
For example, given the declarations
infixr 5 :^:
data Tree a = Leaf a | Tree a :^: Tree athe derived instance of Show is equivalent to
instance (Show a) => Show (Tree a) where
showsPrec d (Leaf m) = showParen (d > app_prec) $
showString "Leaf " . showsPrec (app_prec+1) m
where app_prec = 10
showsPrec d (u :^: v) = showParen (d > up_prec) $
showsPrec (up_prec+1) u .
showString " :^: " .
showsPrec (up_prec+1) v
where up_prec = 5Note that right-associativity of :^: is ignored. For example,
show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string
"Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
Show OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackShow OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackShow CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionShow HasCommonStanzasDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionShow HasElifDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionShow AbiTagDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerShow CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerShow CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerShow CompilerInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerShow SpecLicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.NewtypesShow SpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.NewtypesShow LTokenDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerShow TokenDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerShow LexWarningDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerMonadShow LexWarningTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerMonadShow LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseShow ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameShow PDTaggedDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.ConfigurationShow SyntaxDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.ParsecShow PErrorDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.ErrorShow FieldLineStreamDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.FieldLineStreamShow PositionDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.PositionShow PWarnTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningShow PWarningDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningShow LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseShow LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdShow LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionShow SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionShow LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdShow LicenseListVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseListVersionShow LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceShow ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemShow OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemShow PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemShow AbiDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiDependencyShow AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHashShow BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkShow BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceShow BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeShow BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoShow BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeShow ComponentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentShow ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdShow ComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameShow NotLibComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameShow ComponentRequestedSpecDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentRequestedSpecShow ConfVarDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConfVarShow DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyShow DependencyMapDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyMapShow ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyShow ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableShow ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeShow ExposedModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExposedModuleShow FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagShow FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagShow PackageFlagDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagShow ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibShow LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibShow ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionShow ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeShow GenericPackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.GenericPackageDescriptionShow IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingShow InstalledPackageInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfoShow LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyShow LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryShow LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameShow LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityShow MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinShow ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleShow ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportShow ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingShow MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdShow MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameShow PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionShow PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdShow PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameShow PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraintShow PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyShow PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameShow PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionShow PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeShow SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoShow KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoShow RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoShow RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoShow SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoShow TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteShow TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceShow TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeShow DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdShow UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdShow UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameShow VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionShow BoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalShow LowerBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalShow UpperBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalShow VersionIntervalDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalShow VersionIntervalsDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalShow BoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyShow LowerBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyShow UpperBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyShow VersionIntervalsDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyShow VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalShow ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextShow StructureDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredShow ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionShow KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionShow LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionShow ByteArrayDefined in base-4.20.2.0 · Data.Array.ByteShow TimeoutDefined in base-4.20.2.0 · System.TimeoutShow BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphanShow FormatModeDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloatShow FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.D2SShow FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.F2SShow ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeShow SizeOverflowExceptionDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeShow ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalShow ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalShow IntSetDefined in containers-0.7 · Data.IntSet.InternalShow BitQueueDefined in containers-0.7 · Utils.Containers.Internal.BitQueueShow BitQueueBDefined in containers-0.7 · Utils.Containers.Internal.BitQueueShow FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.CommonShow PermissionsDefined in directory-1.3.8.5 · System.Directory.Internal.CommonShow XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.CommonShow XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.CommonShow IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow ForeignSrcLangDefined in ghc-boot-th-9.10.3 · GHC.ForeignSrcLang.TypeShow ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.TypeShow VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrderShow ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesShow BlockReasonDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncShow ThreadIdDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncShow ThreadStatusDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncShow NestedAtomicallyDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow NoMatchingContinuationPromptDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow NoMethodErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow NonTerminationDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow PatternMatchFailDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow RecConErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow RecSelErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow RecUpdErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow TypeErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseShow ConstrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataShow ConstrRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataShow DataRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataShow DataTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataShow FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataShow DynamicDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DynamicShow AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalShow AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalShow SomeTypeRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.InternalShow VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.VersionShow ControlMessageDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.ControlShow EPollFdDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPollShow EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPollShow EventTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPollShow EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesShow EventLifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesShow LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesShow TimeoutDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesShow FdKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.ManagerShow StateDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.ManagerShow EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.PollShow PollFdDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.PollShow StateDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimerManagerShow UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.UniqueShow ErrorCallDefined in ghc-internal-9.1003.0 · GHC.Internal.ExceptionShow ArithExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeShow SomeExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeShow FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Fingerprint.TypeShow CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesShow IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrShow WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrShow AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow MaskingStateDefined in ghc-internal-9.1003.0 · GHC.Internal.IOShow SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.DeviceShow CodingFailureModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Encoding.FailureShow CodingProgressDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Encoding.TypesShow TextEncodingDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Encoding.TypesShow AllocationLimitExceededDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow ArrayExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow AssertionFailedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow AsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow BlockedIndefinitelyOnMVarDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow BlockedIndefinitelyOnSTMDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow CompactionFailedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow DeadlockDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow FixIOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow IOErrorTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow IOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow SomeAsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow FDDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.FDShow HandlePosnDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.HandleShow FileLockingNotSupportedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Lock.CommonShow BufferModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesShow HandleDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesShow HandleTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesShow NewlineDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesShow NewlineModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesShow IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOModeShow IOPortExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IOPortShow InfoProvDefined in ghc-internal-9.1003.0 · GHC.Internal.InfoProv.TypesShow Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntShow Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntShow Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntShow Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntShow CCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow ConcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow DebugFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow DoCostCentresDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow DoHeapProfileDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow DoTraceDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow GCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow GiveGCStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow HpcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow IoSubSystemDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow MiscFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow ParFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow ProfFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow RTSFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow TickyFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow TraceFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsShow FractionalExponentBaseDefined in ghc-internal-9.1003.0 · GHC.Internal.RealShow StackEntryDefined in ghc-internal-9.1003.0 · GHC.Internal.Stack.CloneStackShow CallStackDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow SrcLocDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow StaticPtrInfoDefined in ghc-internal-9.1003.0 · GHC.Internal.StaticPtrShow GCDetailsDefined in ghc-internal-9.1003.0 · GHC.Internal.StatsShow RTSStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.StatsShow CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CTimerDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesShow LexemeDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.Read.LexShow NumberDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.Read.LexShow SomeCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsShow SomeSymbolDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsShow SomeNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNatsShow GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.UnicodeShow Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordShow Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordShow Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordShow Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordShow BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow CharDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanShow FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanShow IntDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow KindRepDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow LevityDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow ModuleDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow RuntimeRepDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow TrNameDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow TyConDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow TypeLitSortDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow VecCountDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow VecElemDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow WordDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow EncodingExceptionDefined in os-string-2.0.7 · System.OsString.Encoding.InternalShow OsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesShow OsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesOn windows, decodes as UCS-2. On unix prints the raw bytes without decoding.
Show PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesShow PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesPrints the raw bytes without decoding.
Show WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesShow WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesDecodes as UCS-2.
Show ParseErrorDefined in parsec-3.1.18.0 · Text.Parsec.ErrorShow SourcePosDefined in parsec-3.1.18.0 · Text.Parsec.PosShow ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassShow DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJShow PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassShow ForallVisFlagDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.PprShow DocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.PprLibShow AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow DecodingDefined in text-2.1.3 · Data.Text.EncodingShow UnicodeExceptionDefined in text-2.1.3 · Data.Text.Encoding.ErrorShow I8Defined in text-2.1.3 · Data.Text.ForeignShow TextDefined in text-2.1.3 · Data.Text.Show · orphanShow BuilderDefined in text-2.1.3 · Data.Text.Internal.BuilderShow PartialUtf8CodePointDefined in text-2.1.3 · Data.Text.Internal.EncodingShow Utf8StateDefined in text-2.1.3 · Data.Text.Internal.EncodingShow DecoderStateDefined in text-2.1.3 · Data.Text.Internal.Encoding.Utf8Show SizeDefined in text-2.1.3 · Data.Text.Internal.Fusion.SizeShow TextDefined in text-2.1.3 · Data.Text.Lazy · orphanShow FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloatShow IterDefined in text-2.1.3 · Data.Text.UnsafeShow CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysShow DayDefined in time-1.12.2 · Data.Time.Calendar.Gregorian · orphanShow MonthDefined in time-1.12.2 · Data.Time.Calendar.MonthShow as yyyy-mm.
Show QuarterDefined in time-1.12.2 · Data.Time.Calendar.QuarterShow as yyyy-Qn.
Show QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.QuarterShow DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekShow AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.TAI · orphanShow DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeShow NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeShow SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTimeShow UTCTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTime · orphanShow UniversalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTime · orphanShow TimeLocaleDefined in time-1.12.2 · Data.Time.Format.LocaleShow CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTimeShow LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTimeShow TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDayShow TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZoneThis only shows the time zone name, or offset if the name is empty.
Show ZonedTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTimeFor the time zone, this only shows the name, or offset if the name is empty.
Show DirTypeDefined in unix-2.8.7.0 · System.Posix.Directory.CommonShow DLDefined in unix-2.8.7.0 · System.Posix.DynamicLinker.PrimShow RTLDFlagsDefined in unix-2.8.7.0 · System.Posix.DynamicLinker.PrimShow CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.CommonShow StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonShow StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonShow OpenFileFlagsDefined in unix-2.8.7.0 · System.Posix.IO.CommonShow OpenModeDefined in unix-2.8.7.0 · System.Posix.IO.CommonShow ProcessStatusDefined in unix-2.8.7.0 · System.Posix.Process.InternalsShow ResourceDefined in unix-2.8.7.0 · System.Posix.ResourceShow ResourceLimitDefined in unix-2.8.7.0 · System.Posix.ResourceShow ResourceLimitsDefined in unix-2.8.7.0 · System.Posix.ResourceShow BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.CommonShow GroupEntryDefined in unix-2.8.7.0 · System.Posix.User.CommonShow UserEntryDefined in unix-2.8.7.0 · System.Posix.User.CommonShow ()Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.ConstPtrShow (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ForeignPtrShow (FunPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.PtrShow (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.PtrShow (SChar c)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsShow (SSymbol s)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsShow (SNat n)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeNatsShow (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow a => Show (Graph a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.GraphShow a => Show (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetShow a => Show (First' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupShow a => Show (Last' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupShow a => Show (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupShow a => Show (VersionRangeF a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalShow a => Show (Complex a)Defined in base-4.20.2.0 · Data.ComplexShow a => Show (First a)Defined in base-4.20.2.0 · Data.SemigroupShow a => Show (Last a)Defined in base-4.20.2.0 · Data.SemigroupShow a => Show (Max a)Defined in base-4.20.2.0 · Data.SemigroupShow a => Show (Min a)Defined in base-4.20.2.0 · Data.SemigroupShow a => Show (Decoder a)Defined in binary-0.8.9.3 · Data.Binary.Get.InternalShow a => Show (IntMap a)Defined in containers-0.7 · Data.IntMap.InternalShow a => Show (Seq a)Defined in containers-0.7 · Data.Sequence.InternalShow a => Show (ViewL a)Defined in containers-0.7 · Data.Sequence.InternalShow a => Show (ViewR a)Defined in containers-0.7 · Data.Sequence.InternalShow a => Show (Intersection a)Defined in containers-0.7 · Data.Set.InternalShow a => Show (Set a)Defined in containers-0.7 · Data.Set.InternalShow a => Show (Tree a)Defined in containers-0.7 · Data.TreeShow a => Show (ExitCase a)Defined in exceptions-0.10.9 · Control.Monad.CatchShow a => Show (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow a => Show (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsShow a => Show (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsShow a => Show (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsShow a => Show (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsShow a => Show (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityThis instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed
Show a => Show (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidShow a => Show (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidShow a => Show (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdShow a => Show (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (ExceptionWithContext a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeShow a => Show (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListShow a => Show (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow a => Show (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.RealShow a => Show (AnnotDetails a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow a => Show (Span a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow a => Show (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow a => Show [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow ann => Show (NamelessField ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecShow ann => Show (Section ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecShow ann => Show (Field ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldShow ann => Show (FieldLine ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldShow ann => Show (Name ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldShow ann => Show (SectionArg ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldShow c => Show (Condition c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionShow e => Show (NoBacktrace e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeShow flag => Show (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxShow m => Show (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupShow p => Show (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow v => Show (PerCompilerFlavor v)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerShow vertex => Show (SCC vertex)Defined in containers-0.7 · Data.GraphHasResolution a => Show (Fixed a)Defined in base-4.20.2.0 · Data.FixedShow (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathShow (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyShow (TypeRep a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.InternalShow (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (ST s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.STShow (a -> b)Defined in base-4.20.2.0 · Text.Show.Functions · orphan(Show1 f, Show a) => Show (Lift f a)Defined in transformers-0.6.1.1 · Control.Applicative.Lift(Show1 m, Show a) => Show (MaybeT m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe(Ix a, Show a, Show b) => Show (Array a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Arr(Ix ix, Show ix, Show e, IArray UArray e) => Show (UArray ix e)Defined in array-0.5.8.0 · Data.Array.Base(Show a, Show b) => Show (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup(Show a, Show b) => Show (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either(Show a, Show b) => Show (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show k) => Show (Node k a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.Graph(Show k, Show a) => Show (Map k a)Defined in containers-0.7 · Data.Map.InternalShow (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.CoercionShow (OrderingI a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.OrdShow (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityShow (f a) => Show (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidShow (f a) => Show (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalShow (f p) => Show (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow a => Show (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstShow a => Show (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant(Show1 f, Show a) => Show (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards(Show1 f, Show a) => Show (IdentityT f a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity(Show1 f, Show a) => Show (Reverse f a)Defined in transformers-0.6.1.1 · Data.Functor.Reverse(Show a, Show b, Show c) => Show (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show c, Show v) => Show (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Show e, Show1 m, Show a) => Show (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Show v, Show a, Show c) => Show (CondBranch v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Show w, Show1 m, Show a) => Show (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Show w, Show1 m, Show a) => Show (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictShow (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityShow c => Show (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Show (f a), Show (g a)) => Show (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product(Show (f a), Show (g a)) => Show (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum(Show (f p), Show (g p)) => Show ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Show (f p), Show (g p)) => Show ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Show a, Show b, Show c, Show d) => Show (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowShow (f (g a)) => Show (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeShow (f (g p)) => Show ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (f p) => Show (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowStrict (call-by-value) application operator. It takes a function and an argument, evaluates the argument to weak head normal form (WHNF), then calls the function with that value.
Same as >>=, but with the arguments interchanged.
as >>= f == f =<< asconst x y always evaluates to x, ignoring its second argument.
const x = \_ -> xThis function might seem useless at first glance, but it can be very useful in a higher order context.
const 42 "hello"42
map (const 42) [0..3][42,42,42,42]
flip f takes its (first) two arguments in the reverse order of f.
flip f x y = f y xflip . flip = idflip (++) "hello" "world""worldhello"
let (.>) = flip (.) in (+1) .> show $ 5"6"
Identity function.
id x = xThis function might seem useless at first glance, but it can be very useful in a higher order context.
length $ filter id [True, True, False, True]3
Just (Just 3) >>= idJust 3
foldr id 0 [(^3), (*5), (+2)]1000
until p f yields the result of applying f until p holds.
Case analysis for the Either type.
If the value is Left a, apply the first function to a;
if it is Right b, apply the second function to b.
We create two values of type Either String Int, one using the
Left constructor and another using the Right constructor. Then
we apply "either" the Prelude.length function (if we have a String)
or the "times-two" function (if we have an Int):
let s = Left "foo" :: Either String Intlet n = Right 3 :: Either String Inteither length (*2) s3either length (*2) n6
and returns the conjunction of a container of Bools. For the result to be True, the container must be finite; False, however, results from a False value finitely far from the left end.
Basic usage:
and []True
and [True]True
and [False]False
and [True, True, False]False
and (False : repeat True) -- Infinite list [False,True,True,True,...False
and (repeat True)* Hangs forever *
The concatenation of all the elements of a container of lists.
Basic usage:
concat (Just [1, 2, 3])[1,2,3]
concat (Left 42)[]
concat [[1, 2, 3], [4, 5], [6], []][1,2,3,4,5,6]
Map a function over all the elements of a container and concatenate the resulting lists.
Basic usage:
concatMap (take 3) [[1..], [10..], [100..], [1000..]][1,2,3,10,11,12,100,101,102,1000,1001,1002]
concatMap (take 3) (Just [1..])[1,2,3]
notElem is the negation of elem.
Basic usage:
3 `notElem` []True
3 `notElem` [1,2]True
3 `notElem` [1,2,3,4,5]False
For infinite structures, notElem terminates if the value exists at a finite distance from the left side of the structure:
3 `notElem` [1..]False
3 `notElem` ([4..] ++ [3])* Hangs forever *
or returns the disjunction of a container of Bools. For the result to be False, the container must be finite; True, however, results from a True value finitely far from the left end.
Basic usage:
or []False
or [True]True
or [False]False
or [True, True, False]True
or (True : repeat False) -- Infinite list [True,False,False,False,...True
or (repeat False)* Hangs forever *
Evaluate each monadic action in the structure from left to right,
and ignore the results. For a version that doesn't ignore the
results see Data.Traversable.sequence.
sequence_ is just like sequenceA_, but specialised to monadic actions.
An infix synonym for fmap.
The name of this operator is an allusion to Prelude.$.
Note the similarities between their types:
($) :: (a -> b) -> a -> b
(<$>) :: Functor f => (a -> b) -> f a -> f bWhereas Prelude.$ is function application, <$> is function
application lifted over a Functor.
Convert from a Maybe Int to a Maybe
String using show:
show <$> NothingNothing
show <$> Just 3Just "3"
Convert from an Either Int Int to an
Either Int String using show:
show <$> Left 17Left 17
show <$> Right 17Right "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)
The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.
Basic usage:
maybe False odd (Just 3)True
maybe False odd NothingFalse
Read an integer from a string using readMaybe. If we succeed,
return twice the integer; that is, apply (*2) to it. If instead
we fail to parse an integer, return 0 by default:
import GHC.Internal.Text.Read ( readMaybe )maybe 0 (*2) (readMaybe "5")10maybe 0 (*2) (readMaybe "")0
Apply show to a Maybe Int. If we have Just n, we want to show
the underlying Int n. But if we have Nothing, we return the
empty string instead of (for example) "Nothing":
maybe "" show (Just 5)"5"maybe "" show Nothing""
Splits the argument into a list of lines stripped of their terminating
\n characters. The \n terminator is optional in a final non-empty
line of the argument string.
When the argument string is empty, or ends in a \n character, it can be
recovered by passing the result of lines to the unlines function.
Otherwise, unlines appends the missing terminating \n. This makes
unlines . lines idempotent:
(unlines . lines) . (unlines . lines) = (unlines . lines)lines "" -- empty input contains no lines[]
lines "\n" -- single empty line[""]
lines "one" -- single unterminated line["one"]
lines "one\n" -- single non-empty line["one"]
lines "one\n\n" -- second line is empty["one",""]
lines "one\ntwo" -- second line is unterminated["one","two"]
lines "one\ntwo\n" -- two non-empty lines["one","two"]
Appends a \n character to each input string, then concatenates the
results. Equivalent to .foldMap (s -> s ++ "\n")
unlines ["Hello", "World", "!"]"Hello\nWorld\n!\n"
Note that unlines . lines /= id when the input is not \n-terminated:
unlines . lines $ "foo\nbar""foo\nbar\n"
unwords joins words with separating spaces (U+0020 SPACE).
unwords is neither left nor right inverse of words:
words (unwords [" "])[]unwords (words "foo\nbar")"foo bar"
unwords ["Lorem", "ipsum", "dolor"]"Lorem ipsum dolor"
unwords ["foo", "bar", "", "baz"]"foo bar baz"
words breaks a string up into a list of words, which were delimited by white space (as defined by isSpace). This function trims any white spaces at the beginning and at the end.
words "Lorem ipsum\ndolor"["Lorem","ipsum","dolor"]
words " foo bar "["foo","bar"]
Convert an uncurried function to a curried function.
curry fst 1 21
Extract the first component of a pair.
Extract the second component of a pair.
uncurry converts a curried function to a function on pairs.
uncurry (+) (1,2)3
uncurry ($) (show, 1)"1"
map (uncurry max) [(1,2), (3,4), (6,8)][2,4,8]
A variant of error that does not produce a stack trace.
List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type.
WARNING: This function is partial, and should only be used if you are sure that the indexing will not fail. Otherwise, use !?.
WARNING: This function takes linear time in the index.
['a', 'b', 'c'] !! 0'a'
['a', 'b', 'c'] !! 2'c'
['a', 'b', 'c'] !! 3*** Exception: Prelude.!!: index too large
['a', 'b', 'c'] !! (-1)*** Exception: Prelude.!!: negative index
break, applied to a predicate p and a list xs, returns a tuple where
first element is longest prefix (possibly empty) of xs of elements that
do not satisfy p and second element is the remainder of the list:
break p is equivalent to span (not . p)
and consequently to (takeWhile (not . p) xs, dropWhile (not . p) xs),
even if p is _|_.
break undefined []([],[])
fst (break (const True) undefined)*** Exception: Prelude.undefined
fst (break (const True) (undefined : undefined))[]
take 1 (fst (break (const False) (1 : undefined)))[1]
break produces the first component of the tuple lazily:
take 10 (fst (break (const False) [1..]))[1,2,3,4,5,6,7,8,9,10]
break (> 3) [1,2,3,4,1,2,3,4]([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3]([],[1,2,3])
break (> 9) [1,2,3]([1,2,3],[])
cycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.
cycle []*** Exception: Prelude.cycle: empty list
take 10 (cycle [42])[42,42,42,42,42,42,42,42,42,42]
take 10 (cycle [2, 5, 7])[2,5,7,2,5,7,2,5,7,2]
take 1 (cycle (42 : undefined))[42]
drop n xs returns the suffix of xs
after the first n elements, or [] if n >= length xs.
It is an instance of the more general genericDrop,
in which n may be of any integral type.
drop 6 "Hello World!""World!"
drop 3 [1,2,3,4,5][4,5]
drop 3 [1,2][]
drop 3 [][]
drop (-1) [1,2][1,2]
drop 0 [1,2][1,2]
iterate f x returns an infinite list of repeated applications
of f to x:
iterate f x == [x, f x, f (f x), ...]Note that iterate is lazy, potentially leading to thunk build-up if the consumer doesn't force each iterate. See iterate' for a strict variant of this function.
take 1 $ iterate undefined 42[42]
take 10 $ iterate not True[True,False,True,False,True,False,True,False,True,False]
take 10 $ iterate (+3) 42[42,45,48,51,54,57,60,63,66,69]
iterate id == repeat:
take 10 $ iterate id 1[1,1,1,1,1,1,1,1,1,1]
\mathcal{O}(n). lookup key assocs looks up a key in an association
list.
For the result to be Nothing, the list must be finite.
lookup 2 []Nothing
lookup 2 [(1, "first")]Nothing
lookup 2 [(1, "first"), (2, "second"), (3, "third")]Just "second"
repeat x is an infinite list, with x the value of every element.
take 10 $ repeat 17[17,17,17,17,17,17,17,17,17, 17]
repeat undefined[*** Exception: Prelude.undefined
replicate n x is a list of length n with x the value of
every element.
It is an instance of the more general genericReplicate,
in which n may be of any integral type.
replicate 0 True[]
replicate (-1) True[]
replicate 4 True[True,True,True,True]
\mathcal{O}(n). reverse xs returns the elements of xs in reverse order.
xs must be finite.
reverse is lazy in its elements.
head (reverse [undefined, 1])1
reverse (1 : 2 : undefined)*** Exception: Prelude.undefined
reverse [][]
reverse [42][42]
reverse [2,5,7][7,5,2]
reverse [1..]* Hangs forever *
\mathcal{O}(n). scanl is similar to foldl, but returns a list of
successive reduced values from the left:
scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]Note that
last (scanl f z xs) == foldl f z xsscanl (+) 0 [1..4][0,1,3,6,10]
scanl (+) 42 [][42]
scanl (-) 100 [1..4][100,99,97,94,90]
scanl (\reversedString nextChar -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']["foo","afoo","bafoo","cbafoo","dcbafoo"]
take 10 (scanl (+) 0 [1..])[0,1,3,6,10,15,21,28,36,45]
take 1 (scanl undefined 'a' undefined)"a"
\mathcal{O}(n). scanl1 is a variant of scanl that has no starting
value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]scanl1 (+) [1..4][1,3,6,10]
scanl1 (+) [][]
scanl1 (-) [1..4][1,-1,-4,-8]
scanl1 (&&) [True, False, True, True][True,False,False,False]
scanl1 (||) [False, False, True, True][False,False,True,True]
take 10 (scanl1 (+) [1..])[1,3,6,10,15,21,28,36,45,55]
take 1 (scanl1 undefined ('a' : undefined))"a"
\mathcal{O}(n). scanr is the right-to-left dual of scanl. Note that the order of parameters on the accumulating function are reversed compared to scanl.
Also note that
head (scanr f z xs) == foldr f z xs.scanr (+) 0 [1..4][10,9,7,4,0]
scanr (+) 42 [][42]
scanr (-) 100 [1..4][98,-97,99,-96,100]
scanr (\nextChar reversedString -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']["abcdfoo","bcdfoo","cdfoo","dfoo","foo"]
force $ scanr (+) 0 [1..]*** Exception: stack overflow
\mathcal{O}(n). scanr1 is a variant of scanr that has no starting
value argument.
scanr1 (+) [1..4][10,9,7,4]
scanr1 (+) [][]
scanr1 (-) [1..4][-2,3,-1,4]
scanr1 (&&) [True, False, True, True][False,False,True,True]
scanr1 (||) [True, True, False, False][True,True,False,False]
force $ scanr1 (+) [1..]*** Exception: stack overflow
span, applied to a predicate p and a list xs, returns a tuple where
first element is the longest prefix (possibly empty) of xs of elements that
satisfy p and second element is the remainder of the list:
span p xs is equivalent to (takeWhile p xs, dropWhile p xs), even if p is _|_.
span undefined []([],[])fst (span (const False) undefined)*** Exception: Prelude.undefinedfst (span (const False) (undefined : undefined))[]take 1 (fst (span (const True) (1 : undefined)))[1]
span produces the first component of the tuple lazily:
take 10 (fst (span (const True) [1..]))[1,2,3,4,5,6,7,8,9,10]
span (< 3) [1,2,3,4,1,2,3,4]([1,2],[3,4,1,2,3,4])
span (< 9) [1,2,3]([1,2,3],[])
span (< 0) [1,2,3]([],[1,2,3])
splitAt n xs returns a tuple where first element is xs prefix of
length n and second element is the remainder of the list:
splitAt is an instance of the more general genericSplitAt,
in which n may be of any integral type.
It is equivalent to (take n xs, drop n xs)
unless n is _|_:
splitAt _|_ xs = _|_, not (_|_, _|_)).
The first component of the tuple is produced lazily:
fst (splitAt 0 undefined)[]
take 1 (fst (splitAt 10 (1 : undefined)))[1]
splitAt 6 "Hello World!"("Hello ","World!")
splitAt 3 [1,2,3,4,5]([1,2,3],[4,5])
splitAt 1 [1,2,3]([1],[2,3])
splitAt 3 [1,2,3]([1,2,3],[])
splitAt 4 [1,2,3]([1,2,3],[])
splitAt 0 [1,2,3]([],[1,2,3])
splitAt (-1) [1,2,3]([],[1,2,3])
take n, applied to a list xs, returns the prefix of xs
of length n, or xs itself if n >= length xs.
It is an instance of the more general genericTake,
in which n may be of any integral type.
take 0 undefined[]take 2 (1 : 2 : undefined)[1,2]
take 5 "Hello World!""Hello"
take 3 [1,2,3,4,5][1,2,3]
take 3 [1,2][1,2]
take 3 [][]
take (-1) [1,2][]
take 0 [1,2][]
takeWhile, applied to a predicate p and a list xs, returns the
longest prefix (possibly empty) of xs of elements that satisfy p.
takeWhile (const False) undefined*** Exception: Prelude.undefined
takeWhile (const False) (undefined : undefined)[]
take 1 (takeWhile (const True) (1 : undefined))[1]
takeWhile (< 3) [1,2,3,4,1,2,3,4][1,2]
takeWhile (< 9) [1,2,3][1,2,3]
takeWhile (< 0) [1,2,3][]
unzip transforms a list of pairs into a list of first components and a list of second components.
unzip []([],[])
unzip [(1, 'a'), (2, 'b')]([1,2],"ab")
\mathcal{O}(\min(m,n)). zipWith generalises zip by zipping with the
function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys
zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]zipWith is right-lazy:
let f = undefinedzipWith f [] undefined[]
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.
zipWith can be applied to two lists to produce the list of
corresponding sums:(+)
zipWith (+) [1, 2, 3] [4, 5, 6][5,7,9]
zipWith (++) ["hello ", "foo"] ["world!", "bar"]["hello world!","foobar"]
\mathcal{O}(\min(l,m,n)). The zipWith3 function takes a function which combines three
elements, as well as three lists and returns a list of the function applied
to corresponding elements, analogous to zipWith.
It is capable of list fusion, but it is restricted to its
first list argument and its resulting list.
zipWith3 (,,) xs ys zs == zip3 xs ys zs
zipWith3 f [x1,x2,x3..] [y1,y2,y3..] [z1,z2,z3..] == [f x1 y1 z1, f x2 y2 z2, f x3 y3 z3..]zipWith3 (\x y z -> [x, y, z]) "123" "abc" "xyz"["1ax","2by","3cz"]
zipWith3 (\x y z -> (x * y) + z) [1, 2, 3] [4, 5, 6] [7, 8, 9][11,18,27]
The lex function reads a single lexeme from the input, discarding
initial white space, and returning the characters that constitute the
lexeme. If the input string contains only white space, lex returns a
single successful `lexeme' consisting of the empty string. (Thus
lex "" = [("","")].) If there is no legal lexeme at the
beginning of the input string, lex fails (i.e. returns []).
This lexer is not completely faithful to the Haskell lexical syntax in the following respects:
Qualified names are not handled properly
Octal and hexadecimal numerics are not recognized as a single token
Comments are not treated properly
raise a number to a non-negative integral power
raise a number to an integral power
gcd x y is the non-negative factor of both x and y of which
every common factor of x and y is also a factor; for example
gcd 4 2 = 2, gcd (-4) 6 = 2, gcd 0 4 = 4. gcd 0 0 = 0.
(That is, the common divisor that is "greatest" in the divisibility
preordering.)
Note: Since for signed fixed-width integer types, abs minBound < 0,
the result may be negative if one of the arguments is minBound (and
necessarily is if the other is 0 or minBound) for such types.
lcm x y is the smallest positive integer that both x and y divide.
utility function converting a Char to a show function that simply prepends the character unchanged.
utility function converting a String to a show function that simply prepends the string unchanged.
equivalent to showsPrec with a precedence of 0.
The computation appendFile file str function appends the string str,
to the file file.
Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first.
main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])The getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin).
The interact function takes a function of type String->String
as its argument. The entire input from the standard input device is
passed to this function as its argument, and the resulting string is
output on the standard output device.
The same as putStr, but adds a newline character.
The readFile function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with getContents.
The computation writeFile file str function writes the string str,
to the file file.
equivalent to readsPrec with a precedence of 0.
Boolean "and", lazy in the second argument
Boolean "not"
Boolean "or", lazy in the second argument
A type f is a Functor if it provides a function fmap which, given any types a and b
lets you apply any function from (a -> b) to turn an f a into an f b, preserving the
structure of f. Furthermore f needs to adhere to the following:
Note, that the second law follows from the free theorem of the type fmap and the first law, so you need only check that the former condition holds. See these articles by School of Haskell or David Luposchainsky for an explanation.
fmap :: (a -> b) -> f a -> f bfmap is used to apply a function of type (a -> b) to a value of type f a,
where f is a functor, to produce a value of type f b.
Note that for any type constructor with more than one parameter (e.g., Either),
only the last type parameter can be modified with fmap (e.g., b in `Either a b`).
Some type constructors with two parameters or more have a instance that allows
both the last and the penultimate parameters to be mapped over.Data.Bifunctor
Convert from a Maybe Int to a Maybe String
using show:
fmap show NothingNothingfmap show (Just 3)Just "3"
Convert from an Either Int Int to an
Either Int String using show:
fmap show (Left 17)Left 17fmap show (Right 17)Right "17"
Double each element of a list:
fmap (*2) [1,2,3][2,4,6]
Apply even to the second element of a pair:
fmap even (2,2)(2,True)
It may seem surprising that the function is only applied to the last element of the tuple
compared to the list example above which applies it to every element in the list.
To understand, remember that tuples are type constructors with multiple type parameters:
a tuple of 3 elements (a,b,c) can also be written (,,) a b c and its Functor instance
is defined for Functor ((,,) a b) (i.e., only the third parameter is free to be mapped over
with fmap).
It explains why fmap can be used with tuples containing values of different types as in the
following example:
fmap even ("hello", 1.0, 4)("hello",1.0,True)
(<$) :: a -> f b -> f ainfixl 4Replace 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.
Perform a computation with Maybe and replace the result with a constant value if it is Just:
'a' <$ Just 2Just 'a''a' <$ NothingNothing
Functor Last'Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupFunctor Option'Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupFunctor PerCompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerFunctor NamelessFieldDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecFunctor SectionDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecFunctor FieldDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldFunctor FieldLineDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldFunctor NameDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldFunctor SectionArgDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldFunctor LexDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerMonadFunctor ParseResultDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.ParseResultFunctor PrettyFieldDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.PrettyFunctor ParsecParserDefined in Cabal-syntax-3.12.1.0 · Distribution.ParsecFunctor ConditionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionFunctor VersionRangeFDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalFunctor ComplexDefined in base-4.20.2.0 · Data.ComplexFunctor FirstDefined in base-4.20.2.0 · Data.SemigroupFunctor LastDefined in base-4.20.2.0 · Data.SemigroupFunctor MaxDefined in base-4.20.2.0 · Data.SemigroupFunctor MinDefined in base-4.20.2.0 · Data.SemigroupFunctor ArgDescrDefined in base-4.20.2.0 · System.Console.GetOptFunctor ArgOrderDefined in base-4.20.2.0 · System.Console.GetOptFunctor OptDescrDefined in base-4.20.2.0 · System.Console.GetOptFunctor DecoderDefined in binary-0.8.9.3 · Data.Binary.Get.InternalFunctor GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalFunctor PutMDefined in binary-0.8.9.3 · Data.Binary.PutFunctor PutDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalFunctor SCCDefined in containers-0.7 · Data.GraphFunctor IntMapDefined in containers-0.7 · Data.IntMap.InternalFunctor DigitDefined in containers-0.7 · Data.Sequence.InternalFunctor ElemDefined in containers-0.7 · Data.Sequence.InternalFunctor FingerTreeDefined in containers-0.7 · Data.Sequence.InternalFunctor NodeDefined in containers-0.7 · Data.Sequence.InternalFunctor SeqDefined in containers-0.7 · Data.Sequence.InternalFunctor ViewLDefined in containers-0.7 · Data.Sequence.InternalFunctor ViewRDefined in containers-0.7 · Data.Sequence.InternalFunctor TreeDefined in containers-0.7 · Data.TreeFunctor NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor STMDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncFunctor HandlerDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.ExceptionFunctor IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFunctor FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidFunctor LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidFunctor DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdFunctor DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalFunctor ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalFunctor SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalFunctor ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListFunctor NoIODefined in ghc-internal-9.1003.0 · GHC.Internal.GHCiFunctor Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor PDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPFunctor ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPFunctor ReadPrecDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPrecFunctor SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor ConsumedDefined in parsec-3.1.18.0 · Text.Parsec.PrimFunctor AnnotDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJFunctor DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJFunctor SpanDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJFunctor STMDefined in stm-2.5.3.1 · Control.Sequential.STMFunctor PprMDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.PprLibFunctor QDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxFunctor TyVarBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxFunctor []Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyFunctor U1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor V1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (Node k)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.GraphFunctor (FieldDescrs s)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.FieldDescrsFunctor (ParsecFieldGrammar s)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecFunctor (PrettyFieldGrammar s)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.PrettyFunctor (Arg a)Defined in base-4.20.2.0 · Data.SemigroupFunctor (SetM s)Defined in containers-0.7 · Data.GraphFunctor (Map k)Defined in containers-0.7 · Data.Map.InternalFunctor (State s)Defined in containers-0.7 · Utils.Containers.Internal.StateFunctor (Array i)Defined in ghc-internal-9.1003.0 · GHC.Internal.ArrFunctor (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpFunctor (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.EitherFunctor (StateL s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsFunctor (StateR s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsFunctor (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.STFunctor (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor (IParser t)Defined in text-2.1.3 · Data.Text.Internal.ReadFunctor f => Functor (Lift f)Defined in transformers-0.6.1.1 · Control.Applicative.LiftFunctor m => Functor (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeMonad m => Functor (WrappedMonad m)Defined in base-4.20.2.0 · Control.ApplicativeMonad m => Functor (Handler m)Defined in exceptions-0.10.9 · Control.Monad.CatchMonad m => Functor (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.PureArrow a => Functor (ArrowMonad a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowFunctor (Pretext a b)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.LensFunctor (CondBranch v c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeFunctor (CondTree v c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeFunctor (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstFunctor (URec Char)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (URec Double)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (URec Float)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (URec Int)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (URec Word)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (URec (Ptr ()))Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (Tuple3 a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor (Reply s u)Defined in parsec-3.1.18.0 · Text.Parsec.PrimFunctor (Constant a)Defined in transformers-0.6.1.1 · Data.Functor.ConstantFunctor (t m) => Functor (LiftingAccum t m)Defined in mtl-2.3.1 · Control.Monad.AccumFunctor (t m) => Functor (LiftingSelect t m)Defined in mtl-2.3.1 · Control.Monad.SelectFunctor f => Functor (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidFunctor f => Functor (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalFunctor f => Functor (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor f => Functor (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsDerived instance.
Functor f => Functor (Reverse f)Defined in transformers-0.6.1.1 · Data.Functor.ReverseDerived instance.
Functor m => Functor (Kleisli m a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowFunctor m => Functor (AccumT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.AccumFunctor m => Functor (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptFunctor m => Functor (IdentityT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityFunctor m => Functor (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ReaderFunctor m => Functor (SelectT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.SelectFunctor m => Functor (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.LazyFunctor m => Functor (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.StrictFunctor m => Functor (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPSFunctor m => Functor (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.LazyFunctor m => Functor (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictMonad m => Functor (StateT s m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsArrow a => Functor (WrappedArrow a b)Defined in base-4.20.2.0 · Control.Applicative(Applicative f, Monad f) => Functor (WhenMissing f x)Defined in containers-0.7 · Data.IntMap.Internal(Generic1 f, Functor (Rep1 f)) => Functor (Generically1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (K1 i c)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (Tuple4 a b c)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimFunctor (ContT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ContFunctor ((->) r)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor f => Functor (WhenMatched f x y)Defined in containers-0.7 · Data.IntMap.Internal(Applicative f, Monad f) => Functor (WhenMissing f k x)Defined in containers-0.7 · Data.Map.Internal(Functor f, Functor g) => Functor (Product f g)Defined in base-4.20.2.0 · Data.Functor.Product(Functor f, Functor g) => Functor (Sum f g)Defined in base-4.20.2.0 · Data.Functor.Sum(Functor f, Functor g) => Functor (f :*: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Functor f, Functor g) => Functor (f :+: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (Tuple5 a b c d)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor f => Functor (WhenMatched f k x y)Defined in containers-0.7 · Data.Map.InternalFunctor f => Functor (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor m => Functor (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPSFunctor m => Functor (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.LazyFunctor m => Functor (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Strict(Functor f, Functor g) => Functor (Compose f g)Defined in base-4.20.2.0 · Data.Functor.Compose(Functor f, Functor g) => Functor (f :.: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFunctor (Tuple6 a b c d e)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor (Tuple7 a b c d e f)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseThe Bounded class is used to name the upper and lower limits of a type. Ord is not a superclass of Bounded since types that are not totally ordered may also have upper and lower bounds.
The Bounded class may be derived for any enumeration type;
minBound is the first constructor listed in the data declaration
and maxBound is the last.
Bounded may also be derived for single-constructor datatypes whose
constituent types are in Bounded.
Bounded CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionBounded PWarnTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningBounded LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdBounded LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdBounded LicenseListVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseListVersionBounded KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoBounded KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionBounded FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.CommonBounded XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.CommonBounded XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.CommonBounded ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.TypeBounded ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrderBounded AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalBounded AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalBounded CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesBounded IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrBounded WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrBounded AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsBounded DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsBounded SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsBounded SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsBounded Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntBounded Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntBounded Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntBounded Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntBounded CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesBounded GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.UnicodeBounded Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordBounded Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordBounded Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordBounded Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordBounded BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded CharDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded IntDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded LevityDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded VecCountDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded VecElemDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded WordDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded I8Defined in text-2.1.3 · Data.Text.ForeignBounded FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloatBounded QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.QuarterBounded ()Defined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded a => Bounded (First a)Defined in base-4.20.2.0 · Data.SemigroupBounded a => Bounded (Last a)Defined in base-4.20.2.0 · Data.SemigroupBounded a => Bounded (Max a)Defined in base-4.20.2.0 · Data.SemigroupBounded a => Bounded (Min a)Defined in base-4.20.2.0 · Data.SemigroupBounded a => Bounded (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsBounded a => Bounded (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsBounded a => Bounded (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsBounded a => Bounded (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsBounded a => Bounded (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityBounded a => Bounded (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdBounded a => Bounded (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalBounded a => Bounded (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalBounded a => Bounded (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalBounded a => Bounded (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded m => Bounded (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupBounded (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy(Bounded a, Bounded b) => Bounded (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.EnumBounded a => Bounded (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstCoercible a b => Bounded (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Coercion(Applicative f, Bounded a) => Bounded (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid(Bounded a, Bounded b, Bounded c) => Bounded (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enuma ~ b => Bounded (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality(Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enuma ~~ b => Bounded (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityBounded (f (g a)) => Bounded (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => Bounded (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => Bounded (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => Bounded (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => Bounded (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => Bounded (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1003.0 · GHC.Internal.EnumClass Enum defines operations on sequentially ordered types.
The enumFrom... methods are used in Haskell's translation of
arithmetic sequences.
Instances of Enum may be derived for any enumeration type (types
whose constructors have no fields). The nullary constructors are
assumed to be numbered left-to-right by fromEnum from 0 through n-1.
See Chapter 10 of the Haskell Report for more details.
For any type that is an instance of class Bounded as well as Enum, the following should hold:
The calls succ maxBound and pred minBound should result in
a runtime error.
fromEnum and toEnum should give a runtime error if the
result value is not representable in the result type.
For example, toEnum 7 :: Bool is an error.
enumFrom and enumFromThen should be defined with an implicit bound, thus:
enumFrom x = enumFromTo x maxBound
enumFromThen x y = enumFromThenTo x y bound
where
bound | fromEnum y >= fromEnum x = maxBound
| otherwise = minBoundsucc :: a -> aSuccessor of a value. For numeric types, succ adds 1.
pred :: a -> aPredecessor of a value. For numeric types, pred subtracts 1.
toEnum :: Int -> aConvert from an Int.
fromEnum :: a -> IntenumFrom :: a -> [a]Used in Haskell's translation of [n..] with [n..] = enumFrom n,
a possible implementation being enumFrom n = n : enumFrom (succ n).
enumFrom 4 :: [Integer] = [4,5,6,7,...]enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound :: Int]enumFromThen :: a -> a -> [a]Used in Haskell's translation of [n,n'..]
with [n,n'..] = enumFromThen n n', a possible implementation being
enumFromThen n n' = n : n' : worker (f x) (f x n'),
worker s v = v : worker s (s v), x = fromEnum n' - fromEnum n and
f n y
| n > 0 = f (n - 1) (succ y)
| n < 0 = f (n + 1) (pred y)
| otherwise = y
enumFromThen 4 6 :: [Integer] = [4,6,8,10...]enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: Int]enumFromTo :: a -> a -> [a]Used in Haskell's translation of [n..m] with
[n..m] = enumFromTo n m, a possible implementation being
enumFromTo n m
| n <= m = n : enumFromTo (succ n) m
| otherwise = []
enumFromTo 6 10 :: [Int] = [6,7,8,9,10]enumFromTo 42 1 :: [Integer] = []enumFromThenTo :: a -> a -> a -> [a]Used in Haskell's translation of [n,n'..m] with
[n,n'..m] = enumFromThenTo n n' m, a possible implementation
being enumFromThenTo n n' m = worker (f x) (c x) n m,
x = fromEnum n' - fromEnum n, c x = bool (>=) ((x 0)
f n y
| n > 0 = f (n - 1) (succ y)
| n < 0 = f (n + 1) (pred y)
| otherwise = y
and
worker s c v m
| c v m = v : worker s c (s v) m
| otherwise = []
enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6]enumFromThenTo 6 8 2 :: [Int] = []Enum CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionEnum PWarnTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningEnum LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdEnum LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdEnum LicenseListVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseListVersionEnum KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoEnum KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionEnum FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.CommonEnum XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.CommonEnum XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.CommonEnum IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.TypeEnum ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrderEnum ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesEnum CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEnum IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrEnum WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrEnum AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEnum DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEnum SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEnum SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEnum SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.DeviceEnum IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOModeEnum Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEnum Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEnum Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEnum Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEnum DoCostCentresDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsEnum DoHeapProfileDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsEnum DoTraceDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsEnum GiveGCStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsEnum IoSubSystemDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsEnum CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEnum GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.UnicodeEnum Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEnum Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEnum Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEnum Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEnum BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum CharDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanfromEnum just truncates its argument, beware of all sorts of overflows.
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
[0..1.5][0.0,1.0,2.0]
Enum FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanfromEnum just truncates its argument, beware of all sorts of overflows.
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
[0..1.5 :: Float][0.0,1.0,2.0]
Enum IntDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum LevityDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum VecCountDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum VecElemDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum WordDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum MessageDefined in parsec-3.1.18.0 · Text.Parsec.ErrorEnum I8Defined in text-2.1.3 · Data.Text.ForeignEnum FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloatEnum DayDefined in time-1.12.2 · Data.Time.Calendar.DaysEnum MonthDefined in time-1.12.2 · Data.Time.Calendar.MonthEnum QuarterDefined in time-1.12.2 · Data.Time.Calendar.QuarterEnum QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.Quartermaps Q1..Q4 to 1..4
Enum DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekEnum DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeEnum NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeEnum StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonEnum StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonEnum BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.CommonEnum ()Defined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum a => Enum (First a)Defined in base-4.20.2.0 · Data.SemigroupEnum a => Enum (Last a)Defined in base-4.20.2.0 · Data.SemigroupEnum a => Enum (Max a)Defined in base-4.20.2.0 · Data.SemigroupEnum a => Enum (Min a)Defined in base-4.20.2.0 · Data.SemigroupEnum a => Enum (WrappedMonoid a)Defined in base-4.20.2.0 · Data.SemigroupEnum a => Enum (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsEnum a => Enum (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsEnum a => Enum (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsEnum a => Enum (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsEnum a => Enum (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityEnum a => Enum (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.EnumIntegral a => Enum (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Real(Enum a, Bounded a, Eq a) => Enum (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdEnum (Fixed a)Defined in base-4.20.2.0 · Data.FixedRecall that, for numeric types, succ and pred typically add and subtract
1, respectively. This is not true in the case of Fixed, whose successor
and predecessor functions intuitively return the "next" and "previous" values
in the enumeration. The results of these functions thus depend on the
resolution of the Fixed value. For example, when enumerating values of
resolution 10^-3 of type Milli = Fixed E3,
succ (0.000 :: Milli)0.001
and likewise
pred (0.000 :: Milli)-0.001
In other words, succ and pred increment and decrement a fixed-precision
value by the least amount such that the value's resolution is unchanged.
For example, 10^-12 is the smallest (positive) amount that can be added to
a value of type Pico = Fixed E12 without changing its resolution, and so
succ (0.000000000000 :: Pico)0.000000000001
and similarly
pred (0.000000000000 :: Pico)-0.000000000001
This is worth bearing in mind when defining Fixed arithmetic sequences. In particular, you may be forgiven for thinking the sequence
[1..10] :: [Pico]
evaluates to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] :: [Pico].
However, this is not true. On the contrary, similarly to the above
implementations of succ and pred, enumFromTo :: Pico -> Pico -> [Pico]
has a "step size" of 10^-12. Hence, the list [1..10] :: [Pico] has
the form
[1.000000000000, 1.00000000001, 1.00000000002, ..., 10.000000000000]
and contains 9 * 10^12 + 1 values.
Enum (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyEnum (f a) => Enum (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidEnum (f a) => Enum (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalEnum a => Enum (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstCoercible a b => Enum (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Coerciona ~ b => Enum (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equalitya ~~ b => Enum (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityEnum (f (g a)) => Enum (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeFloating CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFloating CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFloating DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.FloatFloating FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.FloatFloating a => Floating (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFloating a => Floating (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdRealFloat a => Floating (Complex a)Defined in base-4.20.2.0 · Data.ComplexFloating a => Floating (Op a b)Defined in base-4.20.2.0 · Data.Functor.ContravariantFloating a => Floating (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstFloating (f (g a)) => Floating (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeEfficient, machine-independent access to the components of a floating-point number.
floatRadix :: a -> Integera constant function, returning the radix of the representation
(often 2)
floatDigits :: a -> Inta constant function, returning the number of digits of floatRadix in the significand
floatRange :: a -> (Int, Int)a constant function, returning the lowest and highest values the exponent may assume
decodeFloat :: a -> (Integer, Int)The function decodeFloat applied to a real floating-point
number returns the significand expressed as an Integer and an
appropriately scaled exponent (an Int). If decodeFloat x
yields (m,n), then x is equal in value to m*b^^n, where b
is the floating-point radix, and furthermore, either m and n
are both zero or else b^(d-1) <= abs m < b^d, where d is
the value of floatDigits x.
In particular, decodeFloat 0 = (0,0). If the type
contains a negative zero, also decodeFloat (-0.0) = (0,0).
The result of decodeFloat x is unspecified if either of
isNaN x or isInfinite x is True.
encodeFloat :: Integer -> Int -> aencodeFloat performs the inverse of decodeFloat in the
sense that for finite x with the exception of -0.0,
.
Prelude.uncurry encodeFloat (decodeFloat x) = xencodeFloat m n is one of the two closest representable
floating-point numbers to m*b^^n (or ±Infinity if overflow
occurs); usually the closer, but if m contains too many bits,
the result may be rounded in the wrong direction.
exponent :: a -> Intexponent corresponds to the second component of decodeFloat.
exponent 0 = 0 and for finite nonzero x,
exponent x = snd (decodeFloat x) + floatDigits x.
If x is a finite floating-point number, it is equal in value to
significand x * b ^^ exponent x, where b is the
floating-point radix.
The behaviour is unspecified on infinite or NaN values.
significand :: a -> aThe first component of decodeFloat, scaled to lie in the open
interval (-1,1), either 0.0 or of absolute value >= 1/b,
where b is the floating-point radix.
The behaviour is unspecified on infinite or NaN values.
scaleFloat :: Int -> a -> amultiplies a floating-point number by an integer power of the radix
isNaN :: a -> BoolTrue if the argument is an IEEE "not-a-number" (NaN) value
isInfinite :: a -> BoolTrue if the argument is an IEEE infinity or negative infinity
isDenormalized :: a -> BoolTrue if the argument is too small to be represented in normalized format
isNegativeZero :: a -> BoolTrue if the argument is an IEEE negative zero
isIEEE :: a -> BoolTrue if the argument is an IEEE floating point number
atan2 :: a -> a -> aa version of arctangent taking two real floating-point arguments.
For real floating x and y, atan2 y x computes the angle
(from the positive x-axis) of the vector from the origin to the
point (x,y). atan2 y x returns a value in the range [-pi,
pi]. It follows the Common Lisp semantics for the origin when
signed zeroes are supported. atan2 y 1, with y in a type
that is RealFloat, should return the same value as atan y.
A default definition of atan2 is provided, but implementors
can provide a more accurate implementation.
RealFloat CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRealFloat CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRealFloat DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.FloatRealFloat FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.FloatRealFloat a => RealFloat (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityRealFloat a => RealFloat (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdRealFloat a => RealFloat (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstRealFloat (f (g a)) => RealFloat (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeFile and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.
Fractional numbers, supporting real division.
The Haskell Report defines no laws for Fractional. However, (+) and
(*) are customarily expected to define a division ring and have the
following properties:
x * recip x
=
recip x * x
=
fromInteger 1
is total
if the type also implements
, then
is a left inverse for
, i.e.
fromRational (toRational i) = i
Note that it isn't customarily expected that a type instance of
Fractional implement a field. However, all instances in base do.
(/) :: a -> a -> ainfixl 7Fractional division.
recip :: a -> aReciprocal fraction.
fromRational :: Rational -> aConversion from a Rational (that is Ratio Integer).
A floating literal stands for an application of fromRational
to a value of type Rational, so such literals have type
(Fractional a) => a.
Fractional CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFractional CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesFractional DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
0 == (-0 :: Double)Truerecip 0 == recip (-0 :: Double)Falsemap (/ 0) [-1, 0, 1][-Infinity,NaN,Infinity]map (* 0) $ map (/ 0) [-1, 0, 1][NaN,NaN,NaN]
Fractional FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
0 == (-0 :: Float)Truerecip 0 == recip (-0 :: Float)Falsemap (/ 0) [-1, 0, 1 :: Float][-Infinity,NaN,Infinity]map (* 0) $ map (/ 0) [-1, 0, 1 :: Float][NaN,NaN,NaN]
Fractional DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeFractional NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeRealFloat a => Fractional (Complex a)Defined in base-4.20.2.0 · Data.ComplexFractional a => Fractional (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFractional a => Fractional (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdIntegral a => Fractional (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.RealHasResolution a => Fractional (Fixed a)Defined in base-4.20.2.0 · Data.FixedFractional a => Fractional (Op a b)Defined in base-4.20.2.0 · Data.Functor.ContravariantFractional a => Fractional (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstFractional (f (g a)) => Fractional (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeIntegral numbers, supporting integer division.
The Haskell Report defines no laws for Integral. However, Integral
instances are customarily expected to define a Euclidean domain and have the
following properties for the div/mod and quot/rem pairs, given
suitable Euclidean functions f and g:
x = y * quot x y + rem x y with rem x y = fromInteger 0 or
g (rem x y) < g y
x = y * div x y + mod x y with mod x y = fromInteger 0 or
f (mod x y) < f y
An example of a suitable Euclidean function, for Integer's instance, is abs.
In addition, toInteger should be total, and fromInteger should be a left
inverse for it, i.e. fromInteger (toInteger i) = i.
quot :: a -> a -> ainfixl 7Integer division truncated toward zero.
WARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base.
rem :: a -> a -> ainfixl 7Integer remainder, satisfying
(x `quot` y)*y + (x `rem` y) == xWARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base.
div :: a -> a -> ainfixl 7Integer division truncated toward negative infinity.
WARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base.
mod :: a -> a -> ainfixl 7Integer modulus, satisfying
(x `div` y)*y + (x `mod` y) == xWARNING: This function is partial (because it throws when 0 is passed as
the divisor) for all the integer types in base.
quotRem :: a -> a -> (a, a)divMod :: a -> a -> (a, a)toInteger :: a -> IntegerConversion to Integer.
Integral IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.RealIntegral NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.RealIntegral CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesIntegral IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrIntegral WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrIntegral Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIntegral Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIntegral Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIntegral Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIntegral CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesIntegral Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIntegral Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIntegral Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIntegral Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIntegral IntDefined in ghc-internal-9.1003.0 · GHC.Internal.RealIntegral WordDefined in ghc-internal-9.1003.0 · GHC.Internal.RealIntegral I8Defined in text-2.1.3 · Data.Text.ForeignIntegral StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonIntegral StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonIntegral a => Integral (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityIntegral a => Integral (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstIntegral (f (g a)) => Integral (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeExtracting components of fractions.
properFraction :: Integral b => a -> (b, a)The function properFraction takes a real fractional number x
and returns a pair (n,f) such that x = n+f, and:
n is an integral number with the same sign as x; and
f is a fraction with the same type and sign as x,
and with absolute value less than 1.
The default definitions of the ceiling, floor, truncate and round functions are in terms of properFraction.
truncate :: Integral b => a -> btruncate x returns the integer nearest x between zero and x
round :: Integral b => a -> bround x returns the nearest integer to x;
the even integer if x is equidistant between two integers
ceiling :: Integral b => a -> bceiling x returns the least integer not less than x
floor :: Integral b => a -> bfloor x returns the greatest integer not greater than x
RealFrac CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRealFrac CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesRealFrac DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanBeware that results for non-finite arguments are garbage:
[ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0] ] :: [Int][0,0,0,0,0,0,0,0,0]map properFraction [-1/0, 0/0, 1/0] :: [(Int, Double)][(0,0.0),(0,0.0),(0,0.0)]
and get even more non-sensical if you ask for Integer instead of Int.
RealFrac FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanBeware that results for non-finite arguments are garbage:
[ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0 :: Float] ] :: [Int][0,0,0,0,0,0,0,0,0]map properFraction [-1/0, 0/0, 1/0] :: [(Int, Float)][(0,0.0),(0,0.0),(0,0.0)]
and get even more non-sensical if you ask for Integer instead of Int.
RealFrac DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeRealFrac NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeIntegral a => RealFrac (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.RealRealFrac a => RealFrac (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityRealFrac a => RealFrac (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdHasResolution a => RealFrac (Fixed a)Defined in base-4.20.2.0 · Data.FixedRealFrac a => RealFrac (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstRealFrac (f (g a)) => RealFrac (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeThe 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:
Eq OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackEq OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackEq CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionEq HasCommonStanzasDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionEq HasElifDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionEq AbiTagDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerEq CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerEq CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerEq SpecLicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.NewtypesEq SpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.NewtypesEq LexWarningTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.LexerMonadEq MarginDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.PrettyEq LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseEq ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameEq SyntaxDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.ParsecEq PositionDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.PositionEq PWarnTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningEq PWarningDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningEq LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseEq LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdEq LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionEq SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionEq LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdEq LicenseListVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseListVersionEq LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceEq ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemEq OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemEq PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemEq AbiDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiDependencyEq AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHashEq BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkEq BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceEq BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeEq BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoEq BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeEq ComponentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentEq ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdEq ComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameEq NotLibComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameEq ComponentRequestedSpecDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentRequestedSpecEq ConfVarDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConfVarEq DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyEq DependencyMapDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyMapEq ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyEq ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableEq ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeEq ExposedModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExposedModuleEq FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagEq FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagEq PackageFlagDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagEq ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibEq LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibEq ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionEq ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeEq GenericPackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.GenericPackageDescriptionEq IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingEq InstalledPackageInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfoEq LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyEq LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryEq LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameEq LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityEq MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinEq ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleEq ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportEq ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingEq MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdEq MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameEq PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionEq PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdEq PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameEq PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraintEq PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyEq PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameEq PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionEq PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeEq SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoEq KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoEq RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoEq RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoEq SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoEq TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteEq TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceEq TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeEq DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdEq UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdEq UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameEq VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionEq BoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalEq LowerBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalEq UpperBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalEq VersionIntervalDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalEq VersionIntervalsDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionIntervalEq BoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyEq LowerBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyEq UpperBoundDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyEq VersionIntervalsDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionInterval.LegacyEq VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalEq ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextEq StructureDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredEq ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionEq KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionEq LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionEq ByteArrayDefined in base-4.20.2.0 · Data.Array.ByteEq TimeoutDefined in base-4.20.2.0 · System.TimeoutEq FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.D2SEq FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.F2SEq ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeEq ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalEq ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalEq IntSetDefined in containers-0.7 · Data.IntSet.InternalEq FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.CommonEq PermissionsDefined in directory-1.3.8.5 · System.Directory.Internal.CommonEq XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.CommonEq XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.CommonEq BigNatDefined in ghc-bignum-1.3 · GHC.Num.BigNatEq IntegerDefined in ghc-bignum-1.3 · GHC.Num.IntegerEq NaturalDefined in ghc-bignum-1.3 · GHC.Num.NaturalEq ForeignSrcLangDefined in ghc-boot-th-9.10.3 · GHC.ForeignSrcLang.TypeEq ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.TypeEq VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseEq ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrderEq ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesEq BlockReasonDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncEq ThreadIdDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncEq ThreadStatusDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncEq ConstrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataEquality of constructors
Eq ConstrRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataEq DataRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataEq FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataEq AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalEq AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalEq SomeTypeRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.InternalEq UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.UniqueEq VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.VersionEq ControlMessageDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.ControlEq EPollFdDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPollEq EventTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPollEq EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesEq EventLifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesEq LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesEq FdKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.ManagerEq StateDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.ManagerEq EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.PollEq TimeoutKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimeOutEq StateDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimerManagerEq UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.UniqueEq ErrorCallDefined in ghc-internal-9.1003.0 · GHC.Internal.ExceptionEq ArithExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeEq SpecConstrAnnotationDefined in ghc-internal-9.1003.0 · GHC.Internal.ExtsEq FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Fingerprint.TypeEq ErrnoDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.ErrorEq CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesEq IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrEq WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrEq AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq MaskingStateDefined in ghc-internal-9.1003.0 · GHC.Internal.IOEq BufferStateDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.BufferEq IODeviceTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.DeviceEq SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.DeviceEq CodingProgressDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Encoding.TypesEq ArrayExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionEq AsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionEq ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionEq IOErrorTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionEq IOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionEq HandlePosnDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.HandleEq BufferModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesEq HandleDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesEq NewlineDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesEq NewlineModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.TypesEq IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOModeEq InfoProvDefined in ghc-internal-9.1003.0 · GHC.Internal.InfoProv.TypesEq Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEq Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEq Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEq Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEq IoSubSystemDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsEq StackEntryDefined in ghc-internal-9.1003.0 · GHC.Internal.Stack.CloneStackEq SrcLocDefined in ghc-internal-9.1003.0 · GHC.Internal.Stack.TypesEq CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CTimerDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesEq LexemeDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.Read.LexEq NumberDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.Read.LexEq SomeCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsEq SomeSymbolDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsEq SomeNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNatsEq GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.UnicodeEq Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEq Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEq Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEq Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEq BoolDefined in ghc-prim-0.12.0 · GHC.ClassesEq CharDefined in ghc-prim-0.12.0 · GHC.ClassesEq DoubleDefined in ghc-prim-0.12.0 · GHC.ClassesEq FloatDefined in ghc-prim-0.12.0 · GHC.ClassesEq IntDefined in ghc-prim-0.12.0 · GHC.ClassesEq ModuleDefined in ghc-prim-0.12.0 · GHC.ClassesEq OrderingDefined in ghc-prim-0.12.0 · GHC.ClassesEq TrNameDefined in ghc-prim-0.12.0 · GHC.ClassesEq TyConDefined in ghc-prim-0.12.0 · GHC.ClassesEq WordDefined in ghc-prim-0.12.0 · GHC.ClassesEq EncodingExceptionDefined in os-string-2.0.7 · System.OsString.Encoding.InternalEq OsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesByte equality of the internal representation.
Eq OsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesByte equality of the internal representation.
Eq PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesEq PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesEq WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesEq WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesEq MessageDefined in parsec-3.1.18.0 · Text.Parsec.ErrorEq ParseErrorDefined in parsec-3.1.18.0 · Text.Parsec.ErrorEq SourcePosDefined in parsec-3.1.18.0 · Text.Parsec.PosEq ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassEq DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJEq PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassEq TSemDefined in stm-2.5.3.1 · Control.Concurrent.STM.TSemEq AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq UnicodeExceptionDefined in text-2.1.3 · Data.Text.Encoding.ErrorEq I8Defined in text-2.1.3 · Data.Text.ForeignEq TextDefined in text-2.1.3 · Data.Text · orphanEq BuilderDefined in text-2.1.3 · Data.Text.Internal.BuilderEq PartialUtf8CodePointDefined in text-2.1.3 · Data.Text.Internal.EncodingEq Utf8StateDefined in text-2.1.3 · Data.Text.Internal.EncodingEq DecoderStateDefined in text-2.1.3 · Data.Text.Internal.Encoding.Utf8Eq SizeDefined in text-2.1.3 · Data.Text.Internal.Fusion.SizeEq TextDefined in text-2.1.3 · Data.Text.Lazy · orphanEq CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysEq DayDefined in time-1.12.2 · Data.Time.Calendar.DaysEq MonthDefined in time-1.12.2 · Data.Time.Calendar.MonthEq QuarterDefined in time-1.12.2 · Data.Time.Calendar.QuarterEq QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.QuarterEq DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekEq FirstWeekTypeDefined in time-1.12.2 · Data.Time.Calendar.WeekDateEq AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.AbsoluteTimeEq DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeEq NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeEq SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTimeEq UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTimeEq UniversalTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UniversalTimeEq TimeLocaleDefined in time-1.12.2 · Data.Time.Format.LocaleEq CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTimeEq LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTimeEq TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDayEq TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZoneEq DirTypeDefined in unix-2.8.7.0 · System.Posix.Directory.CommonEq AdviceDefined in unix-2.8.7.0 · System.Posix.FcntlEq CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.CommonEq StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonEq StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonEq OpenFileFlagsDefined in unix-2.8.7.0 · System.Posix.IO.CommonEq OpenModeDefined in unix-2.8.7.0 · System.Posix.IO.CommonEq ProcessStatusDefined in unix-2.8.7.0 · System.Posix.Process.InternalsEq ResourceDefined in unix-2.8.7.0 · System.Posix.ResourceEq ResourceLimitDefined in unix-2.8.7.0 · System.Posix.ResourceEq ResourceLimitsDefined in unix-2.8.7.0 · System.Posix.ResourceEq BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.CommonEq GroupEntryDefined in unix-2.8.7.0 · System.Posix.User.CommonEq UserEntryDefined in unix-2.8.7.0 · System.Posix.User.CommonEq ()Defined in ghc-prim-0.12.0 · GHC.ClassesEq (Chan a)Defined in base-4.20.2.0 · Control.Concurrent.ChanEq (MutableByteArray s)Defined in base-4.20.2.0 · Data.Array.ByteEq (TVar a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncEq (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.ConstPtrEq (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ForeignPtrEq (IOPort a)Defined in ghc-internal-9.1003.0 · GHC.Internal.IOPortEq (IORef a)Defined in ghc-internal-9.1003.0 · GHC.Internal.IORefPointer equality.
Eq (MVar a)Defined in ghc-internal-9.1003.0 · GHC.Internal.MVarCompares the underlying pointers.
Eq (FunPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.PtrEq (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.PtrEq (StablePtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.StableEq (StableName a)Defined in ghc-internal-9.1003.0 · GHC.Internal.StableNameEq (SChar c)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsEq (SSymbol s)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLitsEq (SNat n)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeNatsEq (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq (TBQueue a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TBQueueEq (TChan a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TChanEq (TMVar a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TMVarEq (TQueue a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TQueueEq (TVar a)Defined in stm-2.5.3.1 · Control.Sequential.STMEq a => Eq (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetEq a => Eq (First' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupEq a => Eq (Last' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupEq a => Eq (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupEq a => Eq (VersionRangeF a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalEq a => Eq (Complex a)Defined in base-4.20.2.0 · Data.ComplexEq a => Eq (First a)Defined in base-4.20.2.0 · Data.SemigroupEq a => Eq (Last a)Defined in base-4.20.2.0 · Data.SemigroupEq a => Eq (Max a)Defined in base-4.20.2.0 · Data.SemigroupEq a => Eq (Min a)Defined in base-4.20.2.0 · Data.SemigroupEq a => Eq (IntMap a)Defined in containers-0.7 · Data.IntMap.InternalEq a => Eq (Seq a)Defined in containers-0.7 · Data.Sequence.InternalEq a => Eq (ViewL a)Defined in containers-0.7 · Data.Sequence.InternalEq a => Eq (ViewR a)Defined in containers-0.7 · Data.Sequence.InternalEq a => Eq (Intersection a)Defined in containers-0.7 · Data.Set.InternalEq a => Eq (Set a)Defined in containers-0.7 · Data.Set.InternalEq a => Eq (Tree a)Defined in containers-0.7 · Data.TreeEq a => Eq (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseEq a => Eq (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsEq a => Eq (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsEq a => Eq (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsEq a => Eq (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsEq a => Eq (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityEq a => Eq (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidEq a => Eq (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidEq a => Eq (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdEq a => Eq (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalEq a => Eq (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalEq a => Eq (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalEq a => Eq (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListEq a => Eq (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.MaybeEq a => Eq (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.RealEq a => Eq (AnnotDetails a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq a => Eq (Span a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq a => Eq (Stream a)Defined in text-2.1.3 · Data.Text.Internal.Fusion.TypesEq a => Eq (a)Defined in ghc-prim-0.12.0 · GHC.ClassesEq a => Eq [a]Defined in ghc-prim-0.12.0 · GHC.ClassesEq ann => Eq (NamelessField ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecEq ann => Eq (Section ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.ParsecEq ann => Eq (Field ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldEq ann => Eq (FieldLine ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldEq ann => Eq (Name ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldEq ann => Eq (SectionArg ann)Defined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldEq c => Eq (Condition c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionEq flag => Eq (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxEq m => Eq (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupEq p => Eq (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq v => Eq (PerCompilerFlavor v)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerEq vertex => Eq (SCC vertex)Defined in containers-0.7 · Data.Graph(Eq (Key a), Eq a) => Eq (Graph a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.GraphEq (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathEq (IOUArray i e)Defined in array-0.5.8.0 · Data.Array.IO.InternalsEq (Fixed a)Defined in base-4.20.2.0 · Data.FixedEq (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyEq (TypeRep a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.InternalEq (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (IOArray i e)Defined in ghc-internal-9.1003.0 · GHC.Internal.IOArrayEq (STRef s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.STRefPointer equality.
Eq a => Eq (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup(Eq1 f, Eq a) => Eq (Lift f a)Defined in transformers-0.6.1.1 · Control.Applicative.Lift(Eq1 m, Eq a) => Eq (MaybeT m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe(Ix i, Eq e) => Eq (Array i e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Arr(Ix ix, Eq e, IArray UArray e) => Eq (UArray ix e)Defined in array-0.5.8.0 · Data.Array.Base(Eq a, Eq b) => Eq (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either(Eq a, Eq b) => Eq (a, b)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq k) => Eq (Node k a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.Graph(Eq i, Eq e) => Eq (TArray i e)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TArray(Eq k, Eq a) => Eq (Map k a)Defined in containers-0.7 · Data.Map.InternalEq (STUArray s i e)Defined in array-0.5.8.0 · Data.Array.BaseEq (STArray s i e)Defined in ghc-internal-9.1003.0 · GHC.Internal.ArrEq (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.CoercionEq (OrderingI a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.OrdEq (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec (Ptr ()) p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityEq (f a) => Eq (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidEq (f a) => Eq (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalEq (f p) => Eq (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq a => Eq (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstEq a => Eq (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant(Eq1 f, Eq a) => Eq (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards(Eq1 f, Eq a) => Eq (IdentityT f a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity(Eq1 f, Eq a) => Eq (Reverse f a)Defined in transformers-0.6.1.1 · Data.Functor.Reverse(Generic1 f, Eq (Rep1 f a)) => Eq (Generically1 f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Eq a, Eq b, Eq c) => Eq (a, b, c)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq c, Eq v) => Eq (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Eq e, Eq1 m, Eq a) => Eq (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Eq v, Eq a, Eq c) => Eq (CondBranch v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Eq w, Eq1 m, Eq a) => Eq (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Eq w, Eq1 m, Eq a) => Eq (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictEq (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.EqualityEq c => Eq (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Eq (f a), Eq (g a)) => Eq (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product(Eq (f a), Eq (g a)) => Eq (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum(Eq (f p), Eq (g p)) => Eq ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Eq (f p), Eq (g p)) => Eq ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)Defined in ghc-prim-0.12.0 · GHC.ClassesEq (f (g a)) => Eq (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeEq (f (g p)) => Eq ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (f p) => Eq (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-prim-0.12.0 · GHC.Classes(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-prim-0.12.0 · GHC.ClassesBounded BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEq BoolDefined in ghc-prim-0.12.0 · GHC.ClassesData BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataOrd BoolDefined in ghc-prim-0.12.0 · GHC.ClassesRead BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadShow BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowIx BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.IxGeneric BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsBits BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsInterpret Bool as 1-bit bit-field
FiniteBits BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsStorable BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorableSingKind BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsNFData BoolDefined in deepseq-1.5.0.0 · Control.DeepSeqPretty BoolDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty BoolDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary BoolDefined in binary-0.8.9.3 · Data.Binary.ClassParsec BoolDefined in Cabal-syntax-3.12.1.0 · Distribution.ParsecPretty BoolDefined in Cabal-syntax-3.12.1.0 · Distribution.PrettyStructured BoolDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift BoolDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxSingI 'FalseDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSingI 'TrueDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsIArray UArray BoolDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Bool IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Bool (ST s)Defined in array-0.5.8.0 · Data.Array.Basetype Rep Bool = D1 ('MetaData "Bool"
"GHC.Types"
"ghc-prim"
'False) (C1 ('MetaCons "False"
'PrefixI 'False) U1 :+: C1 ('MetaCons "True"
'PrefixI 'False) U1)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype DemoteRep Bool = BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Genericsdata SingDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsDouble-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.
Enum DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanfromEnum just truncates its argument, beware of all sorts of overflows.
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
[0..1.5][0.0,1.0,2.0]
Eq DoubleDefined in ghc-prim-0.12.0 · GHC.ClassesFloating DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.FloatFractional DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
0 == (-0 :: Double)Truerecip 0 == recip (-0 :: Double)Falsemap (/ 0) [-1, 0, 1][-Infinity,NaN,Infinity]map (* 0) $ map (/ 0) [-1, 0, 1][NaN,NaN,NaN]
Data DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
(0.1 + 0.1) + 0.4 == 0.1 + (0.1 + 0.4)False(0.1 + 0.2) * 0.3 == 0.1 * 0.3 + 0.2 * 0.3False(0.1 * 0.1) * 0.3 == 0.1 * (0.1 * 0.3)False
Ord DoubleDefined in ghc-prim-0.12.0 · GHC.ClassesIEEE 754 Double-precision type includes not only numbers, but also
positive and negative infinities and a special element called NaN
(which can be quiet or signal).
IEEE 754-2008, section 5.11 requires that if at least one of arguments of
<=, <, >, >= is NaN then the result of the comparison is False,
and instance Ord Double complies with this requirement. This violates
the reflexivity: both NaN <= NaN and NaN >= NaN are False.
IEEE 754-2008, section 5.10 defines totalOrder predicate. Unfortunately,
compare on Doubles violates the IEEE standard and does not define a total order.
More specifically, both compare NaN x and compare x NaN always return GT.
Thus, users must be extremely cautious when using instance Ord Double.
For instance, one should avoid ordered containers with keys represented by Double,
because data loss and corruption may happen. An IEEE-compliant compare is available
in fp-ieee package as TotallyOrdered newtype.
Moving further, the behaviour of min and max with regards to NaN is
also non-compliant. IEEE 754-2008, section 5.3.1 defines that quiet NaN
should be treated as a missing data by minNum and maxNum functions,
for example, minNum(NaN, 1) = minNum(1, NaN) = 1. Some languages such as Java
deviate from the standard implementing minNum(NaN, 1) = minNum(1, NaN) = NaN.
However, min / max in base are even worse: min NaN 1 is 1, but min 1 NaN
is NaN.
IEEE 754-2008 compliant min / max can be found in ieee754 package under
minNum / maxNum names. Implementations compliant with
minimumNumber / maximumNumber from a newer
IEEE 754-2019,
section 9.6 are available from fp-ieee package.
Read DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanBeware that toRational generates garbage for non-finite arguments:
toRational (1/0)179769313 (and 300 more digits...) % 1toRational (0/0)269653970 (and 300 more digits...) % 1
RealFloat DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.FloatRealFrac DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanBeware that results for non-finite arguments are garbage:
[ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0] ] :: [Int][0,0,0,0,0,0,0,0,0]map properFraction [-1/0, 0/0, 1/0] :: [(Int, Double)][(0,0.0),(0,0.0),(0,0.0)]
and get even more non-sensical if you ask for Integer instead of Int.
Show DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanStorable DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg DoubleDefined in base-4.20.2.0 · Text.PrintfNFData DoubleDefined in deepseq-1.5.0.0 · Control.DeepSeqPretty DoubleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty DoubleDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary DoubleDefined in binary-0.8.9.3 · Data.Binary.ClassUses non-IEEE754 encoding. Does not round-trip NaN.
Structured DoubleDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift DoubleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray DoubleDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Double IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Double)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFoldable UDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable UDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableMArray (STUArray s) Double (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Double)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep (URec Double p) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UDouble"
'PrefixI 'True) (S1 ('MetaSel ('Just "uDouble#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 (URec Double) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UDouble"
'PrefixI 'True) (S1 ('MetaSel ('Just "uDouble#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericsdata URec DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsUsed for marking occurrences of Double#
Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.
Enum FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanfromEnum just truncates its argument, beware of all sorts of overflows.
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
[0..1.5 :: Float][0.0,1.0,2.0]
Eq FloatDefined in ghc-prim-0.12.0 · GHC.ClassesFloating FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.FloatFractional FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.
0 == (-0 :: Float)Truerecip 0 == recip (-0 :: Float)Falsemap (/ 0) [-1, 0, 1 :: Float][-Infinity,NaN,Infinity]map (* 0) $ map (/ 0) [-1, 0, 1 :: Float][NaN,NaN,NaN]
Data FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
(0.1 + 0.1 :: Float) + 0.5 == 0.1 + (0.1 + 0.5)False(0.1 + 0.2 :: Float) * 0.9 == 0.1 * 0.9 + 0.2 * 0.9False(0.1 * 0.1 :: Float) * 0.9 == 0.1 * (0.1 * 0.9)False
Ord FloatDefined in ghc-prim-0.12.0 · GHC.ClassesRead FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanBeware that toRational generates garbage for non-finite arguments:
toRational (1/0 :: Float)340282366920938463463374607431768211456 % 1toRational (0/0 :: Float)510423550381407695195061911147652317184 % 1
RealFloat FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.FloatRealFrac FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanBeware that results for non-finite arguments are garbage:
[ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0 :: Float] ] :: [Int][0,0,0,0,0,0,0,0,0]map properFraction [-1/0, 0/0, 1/0] :: [(Int, Float)][(0,0.0),(0,0.0),(0,0.0)]
and get even more non-sensical if you ask for Integer instead of Int.
Show FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanStorable FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg FloatDefined in base-4.20.2.0 · Text.PrintfNFData FloatDefined in deepseq-1.5.0.0 · Control.DeepSeqPretty FloatDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty FloatDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary FloatDefined in binary-0.8.9.3 · Data.Binary.ClassUses non-IEEE754 encoding. Does not round-trip NaN.
Structured FloatDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift FloatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray FloatDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Float IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Float)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFoldable UFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable UFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableMArray (STUArray s) Float (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Float)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep (URec Float p) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UFloat"
'PrefixI 'True) (S1 ('MetaSel ('Just "uFloat#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 (URec Float) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UFloat"
'PrefixI 'True) (S1 ('MetaSel ('Just "uFloat#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericsdata URec FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsUsed for marking occurrences of Float#
Bounded OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEq OrderingDefined in ghc-prim-0.12.0 · GHC.ClassesData OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataOrd OrderingDefined in ghc-prim-0.12.0 · GHC.ClassesRead OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadShow OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowIx OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.IxGeneric OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseNFData OrderingDefined in deepseq-1.5.0.0 · Control.DeepSeqPretty OrderingDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty OrderingDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary OrderingDefined in binary-0.8.9.3 · Data.Binary.ClassStructured OrderingDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structuredtype Rep Ordering = D1 ('MetaData "Ordering"
"GHC.Types"
"ghc-prim"
'False) (C1 ('MetaCons "LT"
'PrefixI 'False) U1 :+: (C1 ('MetaCons "EQ"
'PrefixI 'False) U1 :+: C1 ('MetaCons "GT"
'PrefixI 'False) U1))Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsLifted, homogeneous equality. By lifted, we mean that it
can be bogus (deferred type error). By homogeneous, the two
types a and b must have the same kinds.
Arbitrary precision integers. In contrast with fixed-size integral types such as Int, the Integer type represents the entire infinite range of integers.
Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations.
If the value is small (i.e., fits into an Int), the IS constructor is used. Otherwise IP and IN constructors are used to store a BigNat representing the positive or the negative value magnitude, respectively.
Invariant: IP and IN are used iff the value does not fit in IS.
Enum IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEq IntegerDefined in ghc-bignum-1.3 · GHC.Num.IntegerIntegral IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.RealData IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.NumOrd IntegerDefined in ghc-bignum-1.3 · GHC.Num.IntegerRead IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.RealShow IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowIx IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.IxBits IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsPrintfArg IntegerDefined in base-4.20.2.0 · Text.PrintfNFData IntegerDefined in deepseq-1.5.0.0 · Control.DeepSeqPretty IntegerDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty IntegerDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary IntegerDefined in binary-0.8.9.3 · Data.Binary.ClassDayPeriod YearDefined in time-1.12.2 · Data.Time.Calendar.Gregorian · orphanShowPadded IntegerDefined in time-1.12.2 · Data.Time.Calendar.PrivateStructured IntegerDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift IntegerDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax is the function application operator.($)
Applying to a function ($)f and an argument x gives the same result as applying f to x directly. The definition is akin to this:
($) :: (a -> b) -> a -> b
($) f x = f x
This is id specialized from a -> a to (a -> b) -> (a -> b) which by the associativity of (->)
is the same as (a -> b) -> a -> b.
On the face of it, this may appear pointless! But it's actually one of the most useful and important operators in Haskell.
The order of operations is very different between ($) and normal function application. Normal function application has precedence 10 - higher than any operator - and associates to the left. So these two definitions are equivalent:
expr = min 5 1 + 5
expr = ((min 5) 1) + 5
($) has precedence 0 (the lowest) and associates to the right, so these are equivalent:
expr = min 5 $ 1 + 5
expr = (min 5) (1 + 5)
A common use cases of ($) is to avoid parentheses in complex expressions.
For example, instead of using nested parentheses in the following Haskell function:
-- | Sum numbers in a string: strSum "100 5 -7" == 98
strSum :: String -> Int
strSum s = sum (mapMaybe readMaybe (words s))
we can deploy the function application operator:
-- | Sum numbers in a string: strSum "100 5 -7" == 98
strSum :: String -> Int
strSum s = sum $ mapMaybe readMaybe $ words s
($) is also used as a section (a partially applied operator), in order to indicate that we wish to apply some yet-unspecified function to a given value. For example, to apply the argument 5 to a list of functions:
applyFive :: [Int]
applyFive = map ($ 5) [(+1), (2^)]
>>> [6, 32]
($) is fully representation-polymorphic. This allows it to also be used with arguments of unlifted and even unboxed kinds, such as unboxed integers:
fastMod :: Int -> Int -> Int
fastMod (I# x) (I# m) = I# $ remInt# x m
(++) appends two lists, i.e.,
[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]If the first list is not finite, the result is the first list.
This function takes linear time in the number of elements of the
first list. Thus it is better to associate repeated
applications of (++) to the right (which is the default behaviour):
xs ++ (ys ++ zs) or simply xs ++ ys ++ zs, but not (xs ++ ys) ++ zs.
For the same reason GHC.Internal.Data.List.concat = GHC.Internal.Data.List.foldr (++) []
has linear performance, while GHC.Internal.Data.List.foldl (++) [] is prone
to quadratic slowdown
[1, 2, 3] ++ [4, 5, 6][1,2,3,4,5,6]
[] ++ [1, 2, 3][1,2,3]
[3, 2, 1] ++ [][3,2,1]
\mathcal{O}(n). map f xs is the list obtained by applying f to
each element of xs, i.e.,
map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]this means that map id == id
map (+1) [1, 2, 3][2,3,4]
map id [1, 2, 3][1,2,3]
map (\n -> 3 * n + 1) [1, 2, 3][4,7,10]
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following:
(
law)
You can alternatively define mconcat instead of mempty, in which case the laws are:
The method names refer to the monoid of lists under concatenation, but there are many other instances.
Some types can be viewed as a monoid in more than one way,
e.g. both addition and multiplication on numbers.
In such cases we often define newtypes and make those instances
of Monoid, e.g. Data.Semigroup.Sum and Data.Semigroup.Product.
NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.
mempty :: aIdentity of mappend
"Hello world" <> mempty"Hello world"
mempty <> [1, 2, 3][1,2,3]
mappend :: a -> a -> aAn associative operation
NOTE: This method is redundant and has the default
implementation mappend = (<>) since base-4.11.0.0.
Should it be implemented manually, since mappend is a synonym for
(<>), it is expected that the two functions are defined the same
way. In a future GHC release mappend will be removed from Monoid.
mconcat :: [a] -> aFold a list using the monoid.
For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.
mconcat ["Hello", " ", "Haskell", "!"]"Hello Haskell!"
Monoid PDTaggedDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.ConfigurationMonoid BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkMonoid BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceMonoid BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoMonoid DependencyMapDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyMapMonoid ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableMonoid ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeMonoid FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagMonoid ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibMonoid ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeMonoid LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryThis instance is not good.
We need it for PackageDescription.Configuration.addBuildableCondition.
More correct method would be some kind of "create empty clone".
More concretely, addBuildableCondition will make `libVisibility = False`
libraries when `buildable: false`. This may cause problems.
Monoid LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityMonoid SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoMonoid TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteMonoid TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceMonoid UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameMonoid ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextMonoid ByteArrayDefined in base-4.20.2.0 · Data.Array.ByteMonoid BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalMonoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeMonoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalMonoid ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalMonoid IntSetDefined in containers-0.7 · Data.IntSet.InternalMonoid AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonoid AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonoid EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesMonoid EventLifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesMonoid LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Typesmappend takes the longer of two lifetimes.
Monoid ExceptionContextDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.ContextMonoid OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid OsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types"String-Concatenation" for OsString. This is not the same
as (</>).
Monoid PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesMonoid WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesMonoid DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJMonoid TextDefined in text-2.1.3 · Data.Text · orphanMonoid BuilderDefined in text-2.1.3 · Data.Text.Internal.BuilderMonoid TextDefined in text-2.1.3 · Data.Text.Lazy · orphanMonoid StrictTextBuilderDefined in text-2.1.3 · Data.Text.Internal.StrictBuilderMonoid CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysAdditive
Monoid CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTimeAdditive
Monoid StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonMonoid StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonMonoid ()Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid (DList a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.DListMonoid (Condition a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionMonoid (Comparison a)Defined in base-4.20.2.0 · Data.Functor.ContravariantMonoid (Equivalence a)Defined in base-4.20.2.0 · Data.Functor.ContravariantMonoid (Predicate a)Defined in base-4.20.2.0 · Data.Functor.ContravariantMonoid (PutM ())Defined in binary-0.8.9.3 · Data.Binary.PutMonoid (IntMap a)Defined in containers-0.7 · Data.IntMap.InternalMonoid (Seq a)Defined in containers-0.7 · Data.Sequence.InternalMonoid (MergeSet a)Defined in containers-0.7 · Data.Set.InternalMonoid (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidMonoid (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidMonoid (Endo a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonoid (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJMonoid [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid a => Monoid (STM a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncMonoid a => Monoid (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityMonoid a => Monoid (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdMonoid a => Monoid (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonoid a => Monoid (IO a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid a => Monoid (Q a)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxMonoid a => Monoid (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid m => Monoid (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupMonoid p => Monoid (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup a => Monoid (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupSemigroup a => Monoid (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseLift a semigroup into Maybe forming a Monoid according to
http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be
turned into a monoid simply by adjoining an element e not in S
and defining e*e = e and e*s = s = s*e for all s ∈ S."
Since 4.11.0: constraint on inner a value generalised from
Monoid to Semigroup.
Semigroup d => Monoid (DepTestRslt d)Defined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.ConfigurationBits a => Monoid (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsBits a => Monoid (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsFiniteBits a => Monoid (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsThis constraint is arguably too strong. However,
as some types (such as Natural) have undefined complement, this is the
only safe choice.
FiniteBits a => Monoid (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsThis constraint is arguably
too strong. However, as some types (such as Natural) have undefined
complement, this is the only safe choice.
Num a => Monoid (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalNum a => Monoid (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalOrd a => Monoid (Set a)Defined in containers-0.7 · Data.Set.InternalOrd a => Monoid (Max a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsOrd a => Monoid (Min a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils(Semigroup a, Monoid a) => Monoid (PerCompilerFlavor a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compiler(Generic a, Monoid (Rep a ())) => Monoid (Generically a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Ord a, Bounded a) => Monoid (Max a)Defined in base-4.20.2.0 · Data.Semigroup(Ord a, Bounded a) => Monoid (Min a)Defined in base-4.20.2.0 · Data.SemigroupMonoid (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyMonoid (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonoid a => Monoid (Op a b)Defined in base-4.20.2.0 · Data.Functor.Contravariantmempty @(Op a b) without newtypes is mempty @(b->a)
= _ -> mempty.
mempty :: Op a b
mempty = Op _ -> mempty
Monoid a => Monoid (ST s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.STMonoid b => Monoid (a -> b)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseOrd k => Monoid (Map k v)Defined in containers-0.7 · Data.Map.Internal(Monoid a, Monoid b) => Monoid (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseAlternative f => Monoid (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonoid (f p) => Monoid (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonoid a => Monoid (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstMonoid a => Monoid (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant(Applicative f, Monoid a) => Monoid (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base(Semigroup a, Semigroup c, Monoid a, Monoid c) => Monoid (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeMonoid c => Monoid (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Monoid (f a), Monoid (g a)) => Monoid (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product(Monoid (f p), Monoid (g p)) => Monoid ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base(Monoid a, Semigroup (ParsecT s u m a)) => Monoid (ParsecT s u m a)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonoid (f (g a)) => Monoid (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeMonoid (f (g p)) => Monoid ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonoid (f p) => Monoid (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base\mathcal{O}(\min(m,n)). zip takes two lists and returns a list of
corresponding pairs.
zip is right-lazy:
zip [] undefined[]zip undefined []*** Exception: Prelude.undefined...
zip is capable of list fusion, but it is restricted to its first list argument and its resulting list.
zip [1, 2, 3] ['a', 'b', 'c'][(1,'a'),(2,'b'),(3,'c')]
If one input list is shorter than the other, excess elements of the longer list are discarded, even if one of the lists is infinite:
zip [1] ['a', 'b'][(1,'a')]
zip [1, 2] ['a'][(1,'a')]
zip [] [1..][]
zip [1..] [][]
\mathcal{O}(n). filter, applied to a predicate and a list, returns
the list of those elements that satisfy the predicate; i.e.,
filter p xs = [ x | x <- xs, p x]filter odd [1, 2, 3][1,3]
filter (\l -> length l > 3) ["Hello", ", ", "World", "!"]["Hello","World"]
filter (/= 3) [1, 2, 3, 4, 3, 2, 1][1,2,4,2,1]
General coercion to Fractional types.
WARNING: This function goes through the Rational type, which does not have values for NaN for example.
This means it does not round-trip.
For Double it also behaves differently with or without -O0:
Prelude> realToFrac nan -- With -O0
-Infinity
Prelude> realToFrac nan
NaNGeneral coercion from Integral types.
WARNING: This function performs silent truncation if the result type is not at least as big as the argument's type.
Real numbers.
The Haskell report defines no laws for Real, however Real instances are customarily expected to adhere to the following law:
if the type also implements
, then
is a left inverse for
, i.e.
fromRational (toRational i) = i
The law does not hold for Float, Double, CFloat, CDouble, etc., because these types contain non-finite values, which cannot be roundtripped through Rational.
toRational :: a -> RationalRational equivalent of its real argument with full precision.
Real IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.RealReal NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.RealReal CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.TypesReal IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrReal WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.PtrReal Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntReal Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntReal Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntReal Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntReal CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.TypesReal Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordReal Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordReal Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordReal Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordReal DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanBeware that toRational generates garbage for non-finite arguments:
toRational (1/0)179769313 (and 300 more digits...) % 1toRational (0/0)269653970 (and 300 more digits...) % 1
Real FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphanBeware that toRational generates garbage for non-finite arguments:
toRational (1/0 :: Float)340282366920938463463374607431768211456 % 1toRational (0/0 :: Float)510423550381407695195061911147652317184 % 1
Real IntDefined in ghc-internal-9.1003.0 · GHC.Internal.RealReal WordDefined in ghc-internal-9.1003.0 · GHC.Internal.RealReal I8Defined in text-2.1.3 · Data.Text.ForeignReal DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeReal NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeReal StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonReal StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonReal BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.CommonIntegral a => Real (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.RealReal a => Real (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityReal a => Real (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdHasResolution a => Real (Fixed a)Defined in base-4.20.2.0 · Data.FixedReal a => Real (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstReal (f (g a)) => Real (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeThe print function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class Show; print converts values to strings for output using the show operation and adds a newline.
For example, a program to print the first 20 integers and their powers of 2 could be written as:
main = print ([(n, 2^n) | n <- [0..19]])A value of type IO a is a computation which, when performed,
does some I/O before returning a value of type a.
There is really only one way to "perform" an I/O action: bind it to
Main.main in your program. When your program is run, the I/O will
be performed. It isn't possible to perform I/O from an arbitrary
function, unless that function is itself in the IO monad and called
at some point, directly or indirectly, from Main.main.
IO is a monad, so IO actions can be combined using either the do-notation
or the Prelude.>> and Prelude.>>= operations from the Prelude.Monad
class.
Monad IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadFix IODefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FixMonadFail IODefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FailApplicative IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseGHCiSandboxIO IODefined in ghc-internal-9.1003.0 · GHC.Internal.GHCiQuote IODefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxAlternative IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadPlus IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadIO IODefined in base-4.20.2.0 · Control.Monad.IO.ClassQuasi IODefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxMonadCatch IODefined in exceptions-0.10.9 · Control.Monad.CatchMonadMask IODefined in exceptions-0.10.9 · Control.Monad.CatchMonadThrow IODefined in exceptions-0.10.9 · Control.Monad.CatchMonadError IOException IODefined in mtl-2.3.1 · Control.Monad.Error.ClassMArray IOUArray Int16 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Int32 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Int64 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Int8 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word16 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word32 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word64 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word8 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Bool IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Char IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Double IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Float IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Int IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOArray e IODefined in array-0.5.8.0 · Data.Array.BaseMArray TArray e IODefined in stm-2.5.3.1 · Control.Concurrent.STM.TArrayWrites are slow in IO.
Storable e => MArray StorableArray e IODefined in array-0.5.8.0 · Data.Array.Storable.InternalsMArray IOUArray (FunPtr a) IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray (Ptr a) IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray (StablePtr a) IODefined in array-0.5.8.0 · Data.Array.IO.InternalsSemigroup a => Semigroup (IO a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid a => Monoid (IO a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Basea ~ () => HPrintfType (IO a)Defined in base-4.20.2.0 · Text.Printfa ~ () => PrintfType (IO a)Defined in base-4.20.2.0 · Text.PrintfWhen 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
fail s should be an action that runs in the monad itself, not an
exception (except in instances of MonadIO). In particular,
fail should not be implemented in terms of error.
MonadFail ParsecParserDefined in Cabal-syntax-3.12.1.0 · Distribution.ParsecMonadFail GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalMonadFail MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FailMonadFail PDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPMonadFail ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPMonadFail ReadPrecDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPrecMonadFail IODefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FailMonadFail QDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxMonadFail []Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FailMonad m => MonadFail (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.PureMonad m => MonadFail (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeMonadFail f => MonadFail (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidMonadFail m => MonadFail (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptMonadFail m => MonadFail (IdentityT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityMonadFail m => MonadFail (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ReaderMonadFail m => MonadFail (SelectT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.SelectMonadFail m => MonadFail (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.LazyMonadFail m => MonadFail (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.StrictMonadFail m => MonadFail (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPSMonadFail m => MonadFail (Reverse m)Defined in transformers-0.6.1.1 · Data.Functor.Reverse(Monoid w, MonadFail m) => MonadFail (AccumT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum(Monoid w, MonadFail m) => MonadFail (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Monoid w, MonadFail m) => MonadFail (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictMonadFail (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.PrimMonadFail m => MonadFail (ContT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ContMonadFail m => MonadFail (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS(Monoid w, MonadFail m) => MonadFail (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy(Monoid w, MonadFail m) => MonadFail (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.StrictThe class of semigroups (types with an associative binary operation).
Instances should satisfy the following:
You can alternatively define sconcat instead of (<>), in which case the laws are:
(<>) :: a -> a -> ainfixr 6An associative operation.
[1,2,3] <> [4,5,6][1,2,3,4,5,6]
Just [1, 2, 3] <> Just [4, 5, 6]Just [1,2,3,4,5,6]
putStr "Hello, " <> putStrLn "World!"Hello, World!
Semigroup MarginDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.PrettyCollapse margins, any margin = margin
Semigroup DepMapUnionDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.ConfigurationSemigroup PDTaggedDefined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.ConfigurationSemigroup BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkSemigroup BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceSemigroup BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoSemigroup ComponentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentSemigroup DependencyMapDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyMapSemigroup ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableSemigroup ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeAny like semigroup, where ExecutablePrivate is 'Any True'
Semigroup FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagSemigroup ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibSemigroup ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeSemigroup LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibrarySemigroup LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilitySemigroup SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoSemigroup TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteSemigroup TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceSemigroup UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameSemigroup ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextSemigroup ByteArrayDefined in base-4.20.2.0 · Data.Array.ByteSemigroup BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalSemigroup ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeSemigroup ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalSemigroup ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalSemigroup IntSetDefined in containers-0.7 · Data.IntSet.InternalSemigroup VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalSemigroup AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalSemigroup EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesSemigroup EventLifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesSemigroup LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.TypesSemigroup ExceptionContextDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.ContextSemigroup OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup OsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesSemigroup PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesSemigroup WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesSemigroup DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJSemigroup TextDefined in text-2.1.3 · Data.Text · orphanBeware: stimes will crash if the given number does not fit into
an Int.
Semigroup BuilderDefined in text-2.1.3 · Data.Text.Internal.BuilderSemigroup TextDefined in text-2.1.3 · Data.Text.Lazy · orphanSemigroup StrictTextBuilderDefined in text-2.1.3 · Data.Text.Internal.StrictBuilderConcatenation of StrictBuilder is right-biased: the right builder will be run first. This allows a builder to run tail-recursively when it was accumulated left-to-right.
Semigroup CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysAdditive
Semigroup CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTimeAdditive
Semigroup StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.CommonORs the flags.
Semigroup StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.CommonORs the masks.
Semigroup ()Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonoid m => Semigroup (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupSemigroup (DList a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.DListSemigroup (First' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupSemigroup (Last' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupSemigroup (Condition a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionSemigroup (FromMaybe b)Defined in base-4.20.2.0 · Data.Foldable1Semigroup (NonEmptyDList a)Defined in base-4.20.2.0 · Data.Foldable1Semigroup (Comparison a)Defined in base-4.20.2.0 · Data.Functor.ContravariantSemigroup (Equivalence a)Defined in base-4.20.2.0 · Data.Functor.ContravariantSemigroup (Predicate a)Defined in base-4.20.2.0 · Data.Functor.ContravariantSemigroup (First a)Defined in base-4.20.2.0 · Data.SemigroupSemigroup (Last a)Defined in base-4.20.2.0 · Data.SemigroupSemigroup (PutM ())Defined in binary-0.8.9.3 · Data.Binary.PutSemigroup (IntMap a)Defined in containers-0.7 · Data.IntMap.InternalSemigroup (Seq a)Defined in containers-0.7 · Data.Sequence.InternalSemigroup (MergeSet a)Defined in containers-0.7 · Data.Set.InternalSemigroup (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidSemigroup (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidSemigroup (Endo a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalSemigroup (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJSemigroup [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup a => Semigroup (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupSemigroup a => Semigroup (PerCompilerFlavor a)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerSemigroup a => Semigroup (JoinWith a)Defined in base-4.20.2.0 · Data.Foldable1Semigroup a => Semigroup (STM a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncSemigroup a => Semigroup (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentitySemigroup a => Semigroup (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.OrdSemigroup a => Semigroup (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalSemigroup a => Semigroup (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup a => Semigroup (IO a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup a => Semigroup (Q a)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxSemigroup a => Semigroup (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup d => Semigroup (DepTestRslt d)Defined in Cabal-syntax-3.12.1.0 · Distribution.PackageDescription.ConfigurationSemigroup p => Semigroup (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsBits a => Semigroup (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsBits a => Semigroup (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsBits a => Semigroup (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsFiniteBits a => Semigroup (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.BitsThis constraint is arguably
too strong. However, as some types (such as Natural) have undefined
complement, this is the only safe choice.
Num a => Semigroup (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalNum a => Semigroup (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalOrd a => Semigroup (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetNote: there aren't Monoid instance.
Ord a => Semigroup (Max a)Defined in base-4.20.2.0 · Data.SemigroupOrd a => Semigroup (Min a)Defined in base-4.20.2.0 · Data.SemigroupOrd a => Semigroup (Intersection a)Defined in containers-0.7 · Data.Set.InternalOrd a => Semigroup (Set a)Defined in containers-0.7 · Data.Set.InternalOrd a => Semigroup (Max a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.UtilsOrd a => Semigroup (Min a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils(Generic a, Semigroup (Rep a ())) => Semigroup (Generically a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.EitherSemigroup (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxySemigroup (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup a => Semigroup (Op a b)Defined in base-4.20.2.0 · Data.Functor.ContravariantSemigroup a => Semigroup (ST s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.STSemigroup b => Semigroup (a -> b)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseOrd k => Semigroup (Map k v)Defined in containers-0.7 · Data.Map.Internal(Semigroup a, Semigroup b) => Semigroup (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseAlternative f => Semigroup (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalSemigroup (f p) => Semigroup (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup a => Semigroup (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstSemigroup a => Semigroup (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant(Applicative f, Semigroup a) => Semigroup (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base(Semigroup a, Semigroup c) => Semigroup (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeSemigroup a => Semigroup (ParsecT s u m a)Defined in parsec-3.1.18.0 · Text.Parsec.PrimThe Semigroup instance for ParsecT is used to append the result of several parsers, for example:
(many $ char a) <> (many $ char b)
The above will parse a string like "aabbb" and return a successful
parse result "aabbb". Compare against the below which will
produce a result of "bbb" for the same input:
(many $ char a) >> (many $ char b)
(many $ char a) *> (many $ char b)
Semigroup c => Semigroup (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Semigroup (f a), Semigroup (g a)) => Semigroup (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product(Semigroup (f p), Semigroup (g p)) => Semigroup ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseSemigroup (f (g a)) => Semigroup (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeSemigroup (f (g p)) => Semigroup ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup (f p) => Semigroup (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseThe class Typeable allows a concrete representation of a type to be calculated.
A quantified type representation.
Takes a value of type a and returns a concrete representation
of that type.
The Data class comprehends a fundamental primitive gfoldl for
folding over constructor applications, say terms. This primitive can
be instantiated in several ways to map over the immediate subterms
of a term; see the gmap combinators later in this class. Indeed, a
generic programmer does not necessarily need to use the ingenious gfoldl
primitive but rather the intuitive gmap combinators. The gfoldl
primitive is completed by means to query top-level constructors, to
turn constructor representations into proper terms, and to list all
possible datatype constructors. This completion allows us to serve
generic programming scenarios like read, show, equality, term generation.
The combinators gmapT, gmapQ, gmapM, etc are all provided with
default definitions in terms of gfoldl, leaving open the opportunity
to provide datatype-specific definitions.
(The inclusion of the gmap combinators as members of class Data
allows the programmer or the compiler to derive specialised, and maybe
more efficient code per datatype. Note: gfoldl is more higher-order
than the gmap combinators. This is subject to ongoing benchmarking
experiments. It might turn out that the gmap combinators will be
moved out of the class Data.)
Conceptually, the definition of the gmap combinators in terms of the
primitive gfoldl requires the identification of the gfoldl function
arguments. Technically, we also need to identify the type constructor
c for the construction of the result type from the folded term type.
In the definition of gmapQx combinators, we use phantom type
constructors for the c in the type of gfoldl because the result type
of a query does not involve the (polymorphic) type of the term argument.
In the definition of gmapQl we simply use the plain constant type
constructor because gfoldl is left-associative anyway and so it is
readily suited to fold a left-associative binary operation over the
immediate subterms. In the definition of gmapQr, extra effort is
needed. We use a higher-order accumulation trick to mediate between
left-associative constructor application vs. right-associative binary
operation (e.g., (:)). When the query is meant to compute a value
of type r, then the result type within generic folding is r -> r.
So the result of folding is a function to which we finally pass the
right unit.
With the -XDeriveDataTypeable option, GHC can generate instances of the
Data class automatically. For example, given the declaration
data T a b = C1 a b | C2 deriving (Typeable, Data)GHC will generate an instance that is equivalent to
instance (Data a, Data b) => Data (T a b) where
gfoldl k z (C1 a b) = z C1 `k` a `k` b
gfoldl k z C2 = z C2
gunfold k z c = case constrIndex c of
1 -> k (k (z C1))
2 -> z C2
toConstr (C1 _ _) = con_C1
toConstr C2 = con_C2
dataTypeOf _ = ty_T
con_C1 = mkConstr ty_T "C1" [] Prefix
con_C2 = mkConstr ty_T "C2" [] Prefix
ty_T = mkDataType "Module.T" [con_C1, con_C2]This is suitable for datatypes that are exported transparently.
Data OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackData OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackData CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionData CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerData LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseData ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameData LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseData LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdData LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionData SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionData LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdData LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceData ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemData OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemData PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemData BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkData BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceData BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeData BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoData BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeData ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdData ConfVarDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConfVarData DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyData ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyData ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableData ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeData FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagData PackageFlagDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagData ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibData LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibData ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionData ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeData GenericPackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.GenericPackageDescriptionData IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingData LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyData LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryData LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameData LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityData MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinData ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleData ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportData ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingData MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdData MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameData PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionData PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdData PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameData PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraintData PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyData PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameData PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionData PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeData SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoData KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoData RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoData RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoData SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoData TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteData TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceData TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeData DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdData UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdData UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameData VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionData VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalData LicenseFileDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathData PackageDirDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathData SourceDirDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathData ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextData ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionData KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionData LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionData ByteArrayDefined in base-4.20.2.0 · Data.Array.ByteData ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeData ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalData ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalData IntSetDefined in containers-0.7 · Data.IntSet.InternalData IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData SpecConstrAnnotationDefined in ghc-internal-9.1003.0 · GHC.Internal.ExtsData IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData SourcePosDefined in parsec-3.1.18.0 · Text.Parsec.PosData AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData TextDefined in text-2.1.3 · Data.Text · orphanThis instance preserves data abstraction at the cost of inefficiency. We omit reflection services for the sake of data abstraction.
This instance was created by copying the updated behavior of
Data.Set.Set and Data.Map.Data.Map.Map. If you
feel a mistake has been made, please feel free to submit
improvements.
The original discussion is archived here: could we get a Data instance for Data.Text.Text?
The followup discussion that changed the behavior of Set
and Data.Map.Map is archived here:
Proposal: Allow gunfold for Data.Map, ...
Data TextDefined in text-2.1.3 · Data.Text.Lazy · orphanData CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysData DayDefined in time-1.12.2 · Data.Time.Calendar.DaysData MonthDefined in time-1.12.2 · Data.Time.Calendar.MonthData QuarterDefined in time-1.12.2 · Data.Time.Calendar.QuarterData QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.QuarterData DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekData AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.AbsoluteTimeData DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeData NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeData SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTimeData UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTimeData UniversalTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UniversalTimeData CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTimeData LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTimeData TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDayData TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZoneData ZonedTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTimeData ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (VersionRangeF a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalData a => Data (Complex a)Defined in base-4.20.2.0 · Data.ComplexData a => Data (First a)Defined in base-4.20.2.0 · Data.SemigroupData a => Data (Last a)Defined in base-4.20.2.0 · Data.SemigroupData a => Data (Max a)Defined in base-4.20.2.0 · Data.SemigroupData a => Data (Min a)Defined in base-4.20.2.0 · Data.SemigroupData a => Data (IntMap a)Defined in containers-0.7 · Data.IntMap.InternalData a => Data (Seq a)Defined in containers-0.7 · Data.Sequence.InternalData a => Data (ViewL a)Defined in containers-0.7 · Data.Sequence.InternalData a => Data (ViewR a)Defined in containers-0.7 · Data.Sequence.InternalData a => Data (Tree a)Defined in containers-0.7 · Data.TreeData a => Data (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListData a => Data (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData a => Data [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataFor historical reasons, the constructor name used for (:) is
"(:)". In a derived instance, it would be ":".
Data c => Data (Condition c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionData flag => Data (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxData m => Data (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupData p => Data (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData v => Data (PerCompilerFlavor v)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerData vertex => Data (SCC vertex)Defined in containers-0.7 · Data.GraphTypeable s => Data (MutableByteArray s)Defined in base-4.20.2.0 · Data.Array.Byte(Data a, Integral a) => Data (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Ord a) => Data (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySet(Data a, Ord a) => Data (Set a)Defined in containers-0.7 · Data.Set.InternalData p => Data (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData p => Data (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataData t => Data (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Data b) => Data (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup(Data a, Data b) => Data (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Data b) => Data (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Data b, Ix a) => Data (Array a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data from, Data to) => Data (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Path(Data k, Data a, Ord k) => Data (Map k a)Defined in containers-0.7 · Data.Map.Internal(Typeable k, Typeable a) => Data (Fixed a)Defined in base-4.20.2.0 · Data.Fixed(Typeable m, Typeable a, Data (m a)) => Data (WrappedMonad m a)Defined in base-4.20.2.0 · Control.Applicative(Data (f a), Data a, Typeable f) => Data (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data (f a), Data a, Typeable f) => Data (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data (f p), Typeable f, Data p) => Data (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Data b, Data c) => Data (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data v, Data a, Data c) => Data (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Data v, Data c, Data a) => Data (CondBranch v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Typeable a, Typeable b, Typeable c, Data (a b c)) => Data (WrappedArrow a b c)Defined in base-4.20.2.0 · Control.Applicative(Typeable b, Typeable k, Data a) => Data (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant(Typeable k, Data a, Typeable b) => Data (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Coercible a b, Data a, Data b) => Data (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(a ~ b, Data a) => Data (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Data b, Data c, Data d) => Data (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Typeable a, Typeable f, Typeable g, Typeable k, Data (f a), Data (g a)) => Data (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product(Typeable a, Typeable f, Typeable g, Typeable k, Data (f a), Data (g a)) => Data (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Typeable f, Typeable g, Data p, Data (f p), Data (g p)) => Data ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Typeable i, Data p, Data c) => Data (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Typeable i, Typeable j, Typeable a, Typeable b, a ~~ b) => Data (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Data b, Data c, Data d, Data e) => Data (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data p, Data (f p), Typeable c, Typeable i, Typeable f) => Data (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Typeable a, Typeable f, Typeable g, Typeable k1, Typeable k2, Data (f (g a))) => Data (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose(Typeable f, Typeable g, Data p, Data (f (g p))) => Data ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Data b, Data c, Data d, Data e, Data f) => Data (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data(Data a, Data b, Data c, Data d, Data e, Data f, Data g) => Data (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataGeneric OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackGeneric OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackGeneric CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionGeneric AbiTagDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerGeneric CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerGeneric CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerGeneric CompilerInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerGeneric LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseGeneric ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameGeneric PErrorDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.ErrorGeneric PositionDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.PositionGeneric PWarnTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningGeneric PWarningDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningGeneric LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseGeneric LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdGeneric LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionGeneric SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionGeneric LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceGeneric ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemGeneric OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemGeneric PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemGeneric AbiDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiDependencyGeneric AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHashGeneric BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkGeneric BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceGeneric BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeGeneric BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoGeneric BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeGeneric ComponentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentGeneric ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdGeneric ComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameGeneric NotLibComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameGeneric ComponentRequestedSpecDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentRequestedSpecGeneric ConfVarDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConfVarGeneric DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyGeneric ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyGeneric ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableGeneric ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeGeneric ExposedModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExposedModuleGeneric FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagGeneric FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagGeneric PackageFlagDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagGeneric ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibGeneric LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibGeneric ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionGeneric ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeGeneric GenericPackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.GenericPackageDescriptionGeneric IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingGeneric InstalledPackageInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfoGeneric LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyGeneric LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryGeneric LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameGeneric LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityGeneric MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinGeneric ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleGeneric ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportGeneric ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingGeneric MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdGeneric MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameGeneric PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionGeneric PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdGeneric PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameGeneric PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraintGeneric PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyGeneric PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameGeneric PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionGeneric PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeGeneric SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoGeneric KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoGeneric RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoGeneric RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoGeneric SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoGeneric TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteGeneric TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceGeneric TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeGeneric DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdGeneric UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdGeneric UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameGeneric VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionGeneric VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalGeneric ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextGeneric StructureDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredGeneric ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionGeneric KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionGeneric LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionGeneric ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalGeneric ForeignSrcLangDefined in ghc-boot-th-9.10.3 · GHC.ForeignSrcLang.TypeGeneric ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.TypeGeneric VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrderGeneric ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypesGeneric AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalGeneric AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalGeneric VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.VersionGeneric FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionGeneric CCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric ConcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric DebugFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric DoCostCentresDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric DoHeapProfileDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric DoTraceDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric GCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric GiveGCStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric HpcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric MiscFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric ParFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric ProfFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric RTSFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric TickyFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric TraceFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.FlagsGeneric SrcLocDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric GCDetailsDefined in ghc-internal-9.1003.0 · GHC.Internal.StatsGeneric RTSStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.StatsGeneric GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric OsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesGeneric OsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesGeneric PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesGeneric PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesGeneric WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesGeneric WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesGeneric ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJGeneric StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJGeneric TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJGeneric DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJGeneric AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric ()Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Last' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupGeneric (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupGeneric (PerCompilerFlavor v)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerGeneric (Condition c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionGeneric (VersionRangeF a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalGeneric (Complex a)Defined in base-4.20.2.0 · Data.ComplexGeneric (First a)Defined in base-4.20.2.0 · Data.SemigroupGeneric (Last a)Defined in base-4.20.2.0 · Data.SemigroupGeneric (Max a)Defined in base-4.20.2.0 · Data.SemigroupGeneric (Min a)Defined in base-4.20.2.0 · Data.SemigroupGeneric (WrappedMonoid m)Defined in base-4.20.2.0 · Data.SemigroupGeneric (SCC vertex)Defined in containers-0.7 · Data.GraphGeneric (Digit a)Defined in containers-0.7 · Data.Sequence.InternalGeneric (Elem a)Defined in containers-0.7 · Data.Sequence.InternalGeneric (FingerTree a)Defined in containers-0.7 · Data.Sequence.InternalGeneric (Node a)Defined in containers-0.7 · Data.Sequence.InternalGeneric (ViewL a)Defined in containers-0.7 · Data.Sequence.InternalGeneric (ViewR a)Defined in containers-0.7 · Data.Sequence.InternalGeneric (Tree a)Defined in containers-0.7 · Data.TreeGeneric (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityGeneric (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidGeneric (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidGeneric (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalGeneric (Endo a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalGeneric (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalGeneric (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalGeneric (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListGeneric (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJGeneric (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxGeneric (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathGeneric (WrappedMonad m a)Defined in base-4.20.2.0 · Control.ApplicativeGeneric (Arg a b)Defined in base-4.20.2.0 · Data.SemigroupGeneric (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Lift f a)Defined in transformers-0.6.1.1 · Control.Applicative.LiftGeneric (MaybeT m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeGeneric (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (CondBranch v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeGeneric (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeGeneric (WrappedArrow a b c)Defined in base-4.20.2.0 · Control.ApplicativeGeneric (Kleisli m a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowGeneric (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstGeneric (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidGeneric (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalGeneric (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec (Ptr ()) p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsGeneric (AccumT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.AccumGeneric (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptGeneric (IdentityT f a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityGeneric (ReaderT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ReaderGeneric (SelectT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.SelectGeneric (StateT s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.LazyGeneric (StateT s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.StrictGeneric (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPSGeneric (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.LazyGeneric (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictGeneric (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.ConstantGeneric (Reverse f a)Defined in transformers-0.6.1.1 · Data.Functor.ReverseGeneric (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Product f g a)Defined in base-4.20.2.0 · Data.Functor.ProductGeneric (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.SumGeneric (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (ContT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ContGeneric ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.ComposeGeneric (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPSGeneric (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.LazyGeneric (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.StrictGeneric ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsA class of types that can be fully evaluated.
rnf :: a -> ()rnf should reduce its argument to normal form (that is, fully
evaluate all sub-components), and then return ().
Starting with GHC 7.2, you can automatically derive instances for types possessing a Generic instance.
Note: Generic1 can be auto-derived starting with GHC 7.4
{-# LANGUAGE DeriveGeneric #-}
import GHC.Generics (Generic, Generic1)
import Control.DeepSeq
data Foo a = Foo a String
deriving (Eq, Generic, Generic1)
instance NFData a => NFData (Foo a)
instance NFData1 Foo
data Colour = Red | Green | Blue
deriving Generic
instance NFData ColourStarting with GHC 7.10, the example above can be written more
concisely by enabling the new DeriveAnyClass extension:
{-# LANGUAGE DeriveGeneric, DeriveAnyClass #-}
import GHC.Generics (Generic)
import Control.DeepSeq
data Foo a = Foo a String
deriving (Eq, Generic, Generic1, NFData, NFData1)
data Colour = Red | Green | Blue
deriving (Generic, NFData)
deepseq versionsPrior to version 1.4.0.0, the default implementation of the rnf method was defined as
rnf a = seq a ()However, starting with deepseq-1.4.0.0, the default
implementation is based on DefaultSignatures allowing for
more accurate auto-derived NFData instances. If you need the
previously used exact default rnf method implementation
semantics, use
instance NFData Colour where rnf x = seq x ()or alternatively
instance NFData Colour where rnf = rwhnfor
{-# LANGUAGE BangPatterns #-}
instance NFData Colour where rnf !_ = ()NFData OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackNFData OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackNFData CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionNFData CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerNFData CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerNFData LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseNFData ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameNFData PErrorDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.ErrorNFData PositionDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.PositionNFData PWarnTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningNFData PWarningDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningNFData LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseNFData LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdNFData LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionNFData SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionNFData LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdNFData LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceNFData ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemNFData OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemNFData PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemNFData AbiDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiDependencyNFData AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHashNFData BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkNFData BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceNFData BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeNFData BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoNFData BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeNFData ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdNFData ConfVarDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConfVarNFData DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyNFData ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyNFData ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableNFData ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeNFData ExposedModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExposedModuleNFData FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagNFData FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagNFData PackageFlagDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagNFData ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibNFData LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibNFData ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionNFData ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeNFData GenericPackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.GenericPackageDescriptionNFData IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingNFData InstalledPackageInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfoNFData LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyNFData LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNFData LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameNFData LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityNFData MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinNFData ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleNFData ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportNFData ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingNFData MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdNFData MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameNFData PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionNFData PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdNFData PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameNFData PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraintNFData PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyNFData PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameNFData PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionNFData PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeNFData SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoNFData KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoNFData RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoNFData RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoNFData SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoNFData TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteNFData TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceNFData TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeNFData DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdNFData UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdNFData UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameNFData VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionNFData VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalNFData ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextNFData ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionNFData KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionNFData LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionNFData ByteArrayDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData BufferDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalLike the NFData instance for StrictByteString,
this does not force the ForeignPtrContents field
of the underlying ForeignPtr.
NFData BufferRangeDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalNFData ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeNFData ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalNFData ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalNFData IntSetDefined in containers-0.7 · Data.IntSet.InternalNFData IntegerDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData NaturalDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData VoidDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData ThreadIdDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData AllDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData AnyDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData TypeRepDefined in deepseq-1.5.0.0 · Control.DeepSeqNOTE: Prior to deepseq-1.4.4.0 this instance was only defined for base-4.8.0.0 and later.
NFData UniqueDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData VersionDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData FingerprintDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CBoolDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CCharDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CClockDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CDoubleDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CFileDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CFloatDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CFposDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CIntDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CIntMaxDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CIntPtrDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CJmpBufDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CLLongDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CLongDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CPtrdiffDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CSCharDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CSUSecondsDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CShortDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CSigAtomicDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CSizeDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CTimeDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CUCharDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CUIntDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CUIntMaxDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CUIntPtrDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CULLongDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CULongDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CUSecondsDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CUShortDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CWcharDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData MaskingStateDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData ExitCodeDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData Int16Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData Int32Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData Int64Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData Int8Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData CallStackDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData SrcLocDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData Word16Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData Word32Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData Word64Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData Word8Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData BoolDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData CharDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData DoubleDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData FloatDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData IntDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData ModuleDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData OrderingDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData TyConDefined in deepseq-1.5.0.0 · Control.DeepSeqNOTE: Prior to deepseq-1.4.4.0 this instance was only defined for base-4.8.0.0 and later.
NFData WordDefined in deepseq-1.5.0.0 · Control.DeepSeqNFData EncodingExceptionDefined in os-string-2.0.7 · System.OsString.Encoding.InternalNFData OsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesNFData OsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesNFData PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesNFData PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesNFData WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.TypesNFData WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.TypesNFData TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJNFData DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJNFData UnicodeExceptionDefined in text-2.1.3 · Data.Text.Encoding.ErrorNFData TextDefined in text-2.1.3 · Data.Text · orphanNFData TextDefined in text-2.1.3 · Data.Text.Lazy · orphanNFData CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDaysNFData DayDefined in time-1.12.2 · Data.Time.Calendar.DaysNFData MonthDefined in time-1.12.2 · Data.Time.Calendar.MonthNFData QuarterDefined in time-1.12.2 · Data.Time.Calendar.QuarterNFData QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.QuarterNFData DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.WeekNFData AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.AbsoluteTimeNFData DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTimeNFData NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTimeNFData SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTimeNFData UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTimeNFData UniversalTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UniversalTimeNFData CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTimeNFData LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTimeNFData TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDayNFData TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZoneNFData ZonedTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTimeNFData ()Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData (MutableByteArray s)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData (IORef a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNOTE: Only strict in the reference and not the referenced value.
NFData (MVar a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNOTE: Only strict in the reference and not the referenced value.
NFData (FunPtr a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData (Ptr a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData (StableName a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetNFData a => NFData (PerCompilerFlavor a)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerNFData a => NFData (Complex a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (First a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Last a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Max a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Min a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (SCC a)Defined in containers-0.7 · Data.GraphNFData a => NFData (IntMap a)Defined in containers-0.7 · Data.IntMap.InternalNFData a => NFData (Digit a)Defined in containers-0.7 · Data.Sequence.InternalNFData a => NFData (Elem a)Defined in containers-0.7 · Data.Sequence.InternalNFData a => NFData (FingerTree a)Defined in containers-0.7 · Data.Sequence.InternalNFData a => NFData (Node a)Defined in containers-0.7 · Data.Sequence.InternalNFData a => NFData (Seq a)Defined in containers-0.7 · Data.Sequence.InternalNFData a => NFData (Set a)Defined in containers-0.7 · Data.Set.InternalNFData a => NFData (Tree a)Defined in containers-0.7 · Data.TreeNFData a => NFData (NonEmpty a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Identity a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (First a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Last a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Down a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Dual a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Product a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Sum a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (ZipList a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Maybe a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Ratio a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (AnnotDetails a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJNFData a => NFData (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJNFData a => NFData (a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData [a]Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData c => NFData (Condition c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionNFData m => NFData (WrappedMonoid m)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a, NFData (Key a)) => NFData (Graph a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.GraphNFData (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathNFData (Fixed a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData (Proxy a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData (TypeRep a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData (STRef s a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNOTE: Only strict in the reference and not the referenced value.
NFData (a -> b)Defined in deepseq-1.5.0.0 · Control.DeepSeqThis instance is for convenience and consistency with seq. This assumes that WHNF is equivalent to NF for functions.
(NFData a, NFData b) => NFData (Arg a b)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a, NFData b) => NFData (Array a b)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a, NFData b) => NFData (Either a b)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a, NFData b) => NFData (a, b)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData k, NFData a) => NFData (Map k a)Defined in containers-0.7 · Data.Map.InternalNFData (a :~: b)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData a => NFData (Const a b)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a1, NFData a2, NFData a3) => NFData (a1, a2, a3)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData v, NFData c, NFData a) => NFData (CondBranch v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(NFData v, NFData c, NFData a) => NFData (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeNFData (a :~~: b)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData (f a), NFData (g a)) => NFData (Product f g a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNote: in deepseq-1.5.0.0 this instance's superclasses were changed.
(NFData (f a), NFData (g a)) => NFData (Sum f g a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNote: in deepseq-1.5.0.0 this instance's superclasses were changed.
(NFData a1, NFData a2, NFData a3, NFData a4) => NFData (a1, a2, a3, a4)Defined in deepseq-1.5.0.0 · Control.DeepSeqNFData (f (g a)) => NFData (Compose f g a)Defined in deepseq-1.5.0.0 · Control.DeepSeqNote: in deepseq-1.5.0.0 this instance's superclasses were changed.
(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5) => NFData (a1, a2, a3, a4, a5)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6) => NFData (a1, a2, a3, a4, a5, a6)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7) => NFData (a1, a2, a3, a4, a5, a6, a7)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8) => NFData (a1, a2, a3, a4, a5, a6, a7, a8)Defined in deepseq-1.5.0.0 · Control.DeepSeq(NFData a1, NFData a2, NFData a3, NFData a4, NFData a5, NFData a6, NFData a7, NFData a8, NFData a9) => NFData (a1, a2, a3, a4, a5, a6, a7, a8, a9)Defined in deepseq-1.5.0.0 · Control.DeepSeqGHC.Generics-based rnf implementation
This is needed in order to support deepseq < 1.4 which didn't
have a Generic-based default rnf implementation yet.
In order to define instances, use e.g.
instance NFData MyType where rnf = genericRnfThe implementation has been taken from deepseq-1.4.2's default
rnf implementation.
The Binary class provides put and get, methods to encode and decode a Haskell value to a lazy ByteString. It mirrors the Read and Show classes for textual representation of Haskell types, and is suitable for serialising Haskell values to disk, over the network.
For decoding and generating simple external binary formats (e.g. C structures), Binary may be used, but in general is not suitable for complex protocols. Instead use the Put and Get primitives directly.
Instances of Binary should satisfy the following property:
decode . encode == idThat is, the get and put methods should be the inverse of each other. A range of instances are provided for basic Haskell types.
Binary OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackBinary OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackBinary CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionBinary AbiTagDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerBinary CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerBinary CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerBinary CompilerInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerBinary LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseBinary ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameBinary PErrorDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.ErrorBinary PositionDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.PositionBinary PWarnTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningBinary PWarningDefined in Cabal-syntax-3.12.1.0 · Distribution.Parsec.WarningBinary LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseBinary LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdBinary LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionBinary SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionBinary LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdBinary LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceBinary ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemBinary OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemBinary PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemBinary AbiDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiDependencyBinary AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHashBinary BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkBinary BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceBinary BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeBinary BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoBinary BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeBinary ComponentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentBinary ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdBinary ComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameBinary NotLibComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameBinary ComponentRequestedSpecDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentRequestedSpecBinary ConfVarDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConfVarBinary DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyBinary ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyBinary ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableBinary ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeBinary ExposedModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExposedModuleBinary FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagBinary FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagBinary PackageFlagDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagBinary ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibBinary LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibBinary ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionBinary ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeBinary GenericPackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.GenericPackageDescriptionBinary IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingBinary InstalledPackageInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfoBinary LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyBinary LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryBinary LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameBinary LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityBinary MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinBinary ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleBinary ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportBinary ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingBinary MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdBinary MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameBinary PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionBinary PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdBinary PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameBinary PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraintBinary PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyBinary PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameBinary PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionBinary PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeBinary SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoBinary KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoBinary RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoBinary RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoBinary SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoBinary TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteBinary TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceBinary TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeBinary DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdBinary UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdBinary UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameBinary VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionBinary VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalBinary ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextBinary ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionBinary KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionBinary LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionBinary ByteStringDefined in binary-0.8.9.3 · Data.Binary.ClassBinary ByteStringDefined in binary-0.8.9.3 · Data.Binary.ClassBinary ShortByteStringDefined in binary-0.8.9.3 · Data.Binary.ClassBinary IntSetDefined in binary-0.8.9.3 · Data.Binary.ClassBinary IntegerDefined in binary-0.8.9.3 · Data.Binary.ClassBinary NaturalDefined in binary-0.8.9.3 · Data.Binary.ClassBinary VoidDefined in binary-0.8.9.3 · Data.Binary.ClassBinary AllDefined in binary-0.8.9.3 · Data.Binary.ClassBinary AnyDefined in binary-0.8.9.3 · Data.Binary.ClassBinary SomeTypeRepDefined in binary-0.8.9.3 · Data.Binary.ClassBinary VersionDefined in binary-0.8.9.3 · Data.Binary.ClassBinary FingerprintDefined in binary-0.8.9.3 · Data.Binary.ClassBinary Int16Defined in binary-0.8.9.3 · Data.Binary.ClassBinary Int32Defined in binary-0.8.9.3 · Data.Binary.ClassBinary Int64Defined in binary-0.8.9.3 · Data.Binary.ClassBinary Int8Defined in binary-0.8.9.3 · Data.Binary.ClassBinary Word16Defined in binary-0.8.9.3 · Data.Binary.ClassBinary Word32Defined in binary-0.8.9.3 · Data.Binary.ClassBinary Word64Defined in binary-0.8.9.3 · Data.Binary.ClassBinary Word8Defined in binary-0.8.9.3 · Data.Binary.ClassBinary BoolDefined in binary-0.8.9.3 · Data.Binary.ClassBinary CharDefined in binary-0.8.9.3 · Data.Binary.ClassBinary DoubleDefined in binary-0.8.9.3 · Data.Binary.ClassUses non-IEEE754 encoding. Does not round-trip NaN.
Binary FloatDefined in binary-0.8.9.3 · Data.Binary.ClassUses non-IEEE754 encoding. Does not round-trip NaN.
Binary IntDefined in binary-0.8.9.3 · Data.Binary.ClassBinary KindRepDefined in binary-0.8.9.3 · Data.Binary.ClassBinary OrderingDefined in binary-0.8.9.3 · Data.Binary.ClassBinary RuntimeRepDefined in binary-0.8.9.3 · Data.Binary.ClassBinary TyConDefined in binary-0.8.9.3 · Data.Binary.ClassBinary TypeLitSortDefined in binary-0.8.9.3 · Data.Binary.ClassBinary VecCountDefined in binary-0.8.9.3 · Data.Binary.ClassBinary VecElemDefined in binary-0.8.9.3 · Data.Binary.ClassBinary WordDefined in binary-0.8.9.3 · Data.Binary.ClassBinary TextDefined in text-2.1.3 · Data.Text · orphanBinary TextDefined in text-2.1.3 · Data.Text.Lazy · orphanBinary ()Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetBinary a => Binary (Last' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupBinary a => Binary (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupBinary a => Binary (PerCompilerFlavor a)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerBinary a => Binary (Complex a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (First a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Last a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Max a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Min a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Set a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (NonEmpty a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Identity a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (First a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Last a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Dual a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Product a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Sum a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary (Maybe a)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary a => Binary [a]Defined in binary-0.8.9.3 · Data.Binary.ClassBinary c => Binary (Condition c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionBinary e => Binary (IntMap e)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary e => Binary (Seq e)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary e => Binary (Tree e)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary m => Binary (WrappedMonoid m)Defined in binary-0.8.9.3 · Data.Binary.Class(IsNode a, Binary a, Show (Key a)) => Binary (Graph a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.Graph(Binary a, Integral a) => Binary (Ratio a)Defined in binary-0.8.9.3 · Data.Binary.ClassStructured a => Binary (Tag a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredBinary (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.PathBinary (Fixed a)Defined in binary-0.8.9.3 · Data.Binary.ClassTypeable a => Binary (TypeRep a)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b) => Binary (Arg a b)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b) => Binary (Either a b)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b) => Binary (a, b)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary i, Ix i, Binary e) => Binary (Array i e)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary i, Ix i, Binary e, IArray UArray e) => Binary (UArray i e)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary k, Binary e) => Binary (Map k e)Defined in binary-0.8.9.3 · Data.Binary.ClassBinary (f a) => Binary (Alt f a)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b, Binary c) => Binary (a, b, c)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary v, Binary c, Binary a) => Binary (CondBranch v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Binary v, Binary c, Binary a) => Binary (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b, Binary c, Binary d, Binary e) => Binary (a, b, c, d, e)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f) => Binary (a, b, c, d, e, f)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g) => Binary (a, b, c, d, e, f, g)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g, Binary h) => Binary (a, b, c, d, e, f, g, h)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g, Binary h, Binary i) => Binary (a, b, c, d, e, f, g, h, i)Defined in binary-0.8.9.3 · Data.Binary.Class(Binary a, Binary b, Binary c, Binary d, Binary e, Binary f, Binary g, Binary h, Binary i, Binary j) => Binary (a, b, c, d, e, f, g, h, i, j)Defined in binary-0.8.9.3 · Data.Binary.ClassClass of types with a known Structure.
For regular data types Structured can be derived generically.
data Record = Record { a :: Int, b :: Bool, c :: [Char] } deriving (Generic)
instance Structured Record
Structured OpenModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackStructured OpenUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.BackpackStructured CabalSpecVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.CabalSpecVersionStructured AbiTagDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerStructured CompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerStructured CompilerIdDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerStructured LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.LicenseStructured ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameStructured LicenseDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseStructured LicenseExceptionIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExceptionIdStructured LicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionStructured SimpleLicenseExpressionDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseExpressionStructured LicenseIdDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseIdStructured LicenseRefDefined in Cabal-syntax-3.12.1.0 · Distribution.SPDX.LicenseReferenceStructured ArchDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemStructured OSDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemStructured PlatformDefined in Cabal-syntax-3.12.1.0 · Distribution.SystemStructured AbiDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiDependencyStructured AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHashStructured BenchmarkDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkStructured BenchmarkInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkInterfaceStructured BenchmarkTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BenchmarkTypeStructured BuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildInfoStructured BuildTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.BuildTypeStructured ComponentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentStructured ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdStructured ComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameStructured NotLibComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentNameStructured ComponentRequestedSpecDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentRequestedSpecStructured ConfVarDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConfVarStructured DependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.DependencyStructured ExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExeDependencyStructured ExecutableDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableStructured ExecutableScopeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExecutableScopeStructured ExposedModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ExposedModuleStructured FlagAssignmentDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagStructured FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagStructured PackageFlagDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagStructured ForeignLibDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibStructured LibVersionInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibStructured ForeignLibOptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibOptionStructured ForeignLibTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ForeignLibTypeStructured GenericPackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.GenericPackageDescriptionStructured IncludeRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.IncludeRenamingStructured InstalledPackageInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.InstalledPackageInfoStructured LegacyExeDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LegacyExeDependencyStructured LibraryDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryStructured LibraryNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryNameStructured LibraryVisibilityDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.LibraryVisibilityStructured MixinDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MixinStructured ModuleDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleStructured ModuleReexportDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleReexportStructured ModuleRenamingDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ModuleRenamingStructured MungedPackageIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageIdStructured MungedPackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.MungedPackageNameStructured PackageDescriptionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageDescriptionStructured PackageIdentifierDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageIdStructured PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameStructured PackageVersionConstraintDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageVersionConstraintStructured PkgconfigDependencyDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigDependencyStructured PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameStructured PkgconfigVersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionStructured PkgconfigVersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigVersionRangeStructured SetupBuildInfoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SetupBuildInfoStructured KnownRepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoStructured RepoKindDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoStructured RepoTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoStructured SourceRepoDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.SourceRepoStructured TestSuiteDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteStructured TestSuiteInterfaceDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestSuiteInterfaceStructured TestTypeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.TestTypeStructured DefUnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdStructured UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdStructured UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameStructured VersionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionStructured VersionRangeDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalStructured ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextStructured ExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionStructured KnownExtensionDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionStructured LanguageDefined in Cabal-syntax-3.12.1.0 · Language.Haskell.ExtensionStructured ByteStringDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured ByteStringDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured IntSetDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured IntegerDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured Int16Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured Int32Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured Int64Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured Int8Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured Word16Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured Word32Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured Word64Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured Word8Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured BoolDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured CharDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured DoubleDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured FloatDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured IntDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured OrderingDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured WordDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured TextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured TextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured DayDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured DiffTimeDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured NominalDiffTimeDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured UTCTimeDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured UniversalTimeDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured LocalTimeDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured TimeOfDayDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured TimeZoneDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured ()Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured a => Structured (Graph a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.GraphStructured a => Structured (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetStructured a => Structured (Last' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupStructured a => Structured (Option' a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.SemigroupStructured a => Structured (PerCompilerFlavor a)Defined in Cabal-syntax-3.12.1.0 · Distribution.CompilerStructured a => Structured (NonEmpty a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured a => Structured (Maybe a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured a => Structured (Ratio a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured a => Structured [a]Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured c => Structured (Condition c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionStructured k => Structured (Set k)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured v => Structured (IntMap v)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredStructured v => Structured (Seq v)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(Structured a, Structured b) => Structured (Either a b)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(Structured a1, Structured a2) => Structured (a1, a2)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(Structured k, Structured v) => Structured (Map k v)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(Typeable from, Typeable to) => Structured (SymbolicPath from to)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Path(Structured a1, Structured a2, Structured a3) => Structured (a1, a2, a3)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(Structured v, Structured c, Structured a) => Structured (CondBranch v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Structured v, Structured c, Structured a) => Structured (CondTree v c a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTree(Structured a1, Structured a2, Structured a3, Structured a4) => Structured (a1, a2, a3, a4)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(Structured a1, Structured a2, Structured a3, Structured a4, Structured a5) => Structured (a1, a2, a3, a4, a5)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6) => Structured (a1, a2, a3, a4, a5, a6)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structured(Structured a1, Structured a2, Structured a3, Structured a4, Structured a5, Structured a6, Structured a7) => Structured (a1, a2, a3, a4, a5, a6, a7)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredA monoid on applicative functors.
If defined, some and many should be the least solutions of the equations:
Nothing <|> Just 42Just 42
[1, 2] <|> [3, 4][1,2,3,4]
empty <|> print (2^15)32768
empty :: f aThe identity of <|>
empty <|> a == a
a <|> empty == a(<|>) :: f a -> f a -> f ainfixl 3An associative binary operation
some :: f a -> f [a]One or more.
some (putStr "la")lalalalalalalalala... * goes on forever *
some Nothingnothing
take 5 <$> some (Just 1)* hangs forever *
Note that this function can be used with Parsers based on
Applicatives. In that case some parser will attempt to
parse parser one or more times until it fails.
many :: f a -> f [a]Zero or more.
many (putStr "la")lalalalalalalalala... * goes on forever *
many NothingJust []
take 5 <$> many (Just 1)* hangs forever *
Note that this function can be used with Parsers based on
Applicatives. In that case many parser will attempt to
parse parser zero or more times until it fails.
Alternative ParsecParserDefined in Cabal-syntax-3.12.1.0 · Distribution.ParsecAlternative ConditionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionAlternative GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalAlternative SeqDefined in containers-0.7 · Data.Sequence.InternalAlternative STMDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncAlternative ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListAlternative MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseAlternative PDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPAlternative ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPAlternative ReadPrecDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPrecAlternative IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseAlternative []Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseCombines lists by concatenation, starting from the empty list.
Alternative ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyAlternative U1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsAlternative f => Alternative (Lift f)Defined in transformers-0.6.1.1 · Control.Applicative.LiftA combination is Pure only either part is.
Monad m => Alternative (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.PureMonadPlus m => Alternative (WrappedMonad m)Defined in base-4.20.2.0 · Control.ApplicativeArrowPlus a => Alternative (ArrowMonad a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow(Functor m, Monad m) => Alternative (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeAlternative f => Alternative (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidAlternative f => Alternative (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalAlternative f => Alternative (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsAlternative f => Alternative (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsTry alternatives in the same order as f.
Alternative f => Alternative (Reverse f)Defined in transformers-0.6.1.1 · Data.Functor.ReverseDerived instance.
Alternative m => Alternative (Kleisli m a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowAlternative m => Alternative (IdentityT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityAlternative m => Alternative (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Reader(Functor m, Monad m, Monoid e) => Alternative (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Functor m, MonadPlus m) => Alternative (SelectT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Select(Functor m, MonadPlus m) => Alternative (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Lazy(Functor m, MonadPlus m) => Alternative (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Strict(Functor m, MonadPlus m) => Alternative (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPS(Monoid w, Alternative m) => Alternative (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Monoid w, Alternative m) => Alternative (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Strict(Monoid w, Functor m, MonadPlus m) => Alternative (AccumT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum(ArrowZero a, ArrowPlus a) => Alternative (WrappedArrow a b)Defined in base-4.20.2.0 · Control.Applicative(Generic1 f, Alternative (Rep1 f)) => Alternative (Generically1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsAlternative (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.Prim(Alternative f, Alternative g) => Alternative (Product f g)Defined in base-4.20.2.0 · Data.Functor.Product(Alternative f, Alternative g) => Alternative (f :*: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsAlternative f => Alternative (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Alternative f, Applicative g) => Alternative (Compose f g)Defined in base-4.20.2.0 · Data.Functor.Compose(Alternative f, Applicative g) => Alternative (f :.: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Functor m, MonadPlus m) => Alternative (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS(Monoid w, Functor m, MonadPlus m) => Alternative (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy(Monoid w, Functor m, MonadPlus m) => Alternative (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.StrictMonads that also support choice and failure.
MonadPlus ParsecParserDefined in Cabal-syntax-3.12.1.0 · Distribution.ParsecMonadPlus ConditionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionMonadPlus GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalMonadPlus SeqDefined in containers-0.7 · Data.Sequence.InternalMonadPlus STMDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.SyncMonadPlus MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadPlus PDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPMonadPlus ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPMonadPlus ReadPrecDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPrecMonadPlus IODefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadPlus []Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseCombines lists by concatenation, starting from the empty list.
Monad m => MonadPlus (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.PureMonad m => MonadPlus (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeMonadPlus ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyMonadPlus U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(ArrowApply a, ArrowPlus a) => MonadPlus (ArrowMonad a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowMonadPlus f => MonadPlus (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.MonoidMonadPlus f => MonadPlus (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.InternalMonadPlus f => MonadPlus (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonadPlus m => MonadPlus (Kleisli m a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.ArrowMonadPlus m => MonadPlus (IdentityT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityMonadPlus m => MonadPlus (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ReaderMonadPlus m => MonadPlus (SelectT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.SelectMonadPlus m => MonadPlus (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.LazyMonadPlus m => MonadPlus (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.StrictMonadPlus m => MonadPlus (Reverse m)Defined in transformers-0.6.1.1 · Data.Functor.ReverseDerived instance.
(Functor m, MonadPlus m) => MonadPlus (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPS(Monad m, Monoid e) => MonadPlus (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except(Monoid w, Functor m, MonadPlus m) => MonadPlus (AccumT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum(Monoid w, MonadPlus m) => MonadPlus (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy(Monoid w, MonadPlus m) => MonadPlus (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictMonadPlus (ParsecT s u m)Defined in parsec-3.1.18.0 · Text.Parsec.Prim(MonadPlus f, MonadPlus g) => MonadPlus (Product f g)Defined in base-4.20.2.0 · Data.Functor.Product(MonadPlus f, MonadPlus g) => MonadPlus (f :*: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonadPlus f => MonadPlus (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics(Functor m, MonadPlus m) => MonadPlus (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy(Monoid w, MonadPlus m) => MonadPlus (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.StrictIsString is used in combination with the -XOverloadedStrings
language extension to convert the literals to different string types.
For example, if you use the text package, you can say
{-# LANGUAGE OverloadedStrings #-}
myText = "hello world" :: Text
Internally, the extension will convert this to the equivalent of
myText = fromString @Text ("hello world" :: String)
Note: You can use fromString in normal code as well,
but the usual performance/memory efficiency problems with String apply.
fromString :: String -> aIsString ModuleNameDefined in Cabal-syntax-3.12.1.0 · Distribution.ModuleNameConstruct a ModuleName from a valid module name String.
This is just a convenience function intended for valid module strings. It is an error if it is used with a string that is not a valid module name. If you are parsing user input then use simpleParse instead.
IsString AbiHashDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.AbiHashIsString ComponentIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ComponentIdIsString FlagNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.FlagIsString PackageNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PackageNameIsString PkgconfigNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.PkgconfigNameIsString UnitIdDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnitIdIsString UnqualComponentNameDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.UnqualComponentNameIsString ShortTextDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.ShortTextIsString BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphanIsString ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeBeware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�
IsString ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalBeware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�
IsString ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalBeware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�
IsString DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJIsString TextDefined in text-2.1.3 · Data.Text · orphanPerforms replacement on invalid scalar values:
:set -XOverloadedStrings"\55555" :: Text"\65533"
IsString BuilderDefined in text-2.1.3 · Data.Text.Internal.BuilderPerforms replacement on invalid scalar values:
:set -XOverloadedStrings"\55555" :: Builder"\65533"
IsString TextDefined in text-2.1.3 · Data.Text.Lazy · orphanPerforms replacement on invalid scalar values:
:set -XOverloadedStrings"\55555" :: Data.Text.Lazy.Text"\65533"
IsString (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJIsString a => IsString (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Stringa ~ Char => IsString (Seq a)Defined in containers-0.7 · Data.Sequence.Internala ~ Char => IsString [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.String(a ~ Char) context was introduced in 4.9.0.0
IsString a => IsString (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.StringBifoldable MapDefined in containers-0.7 · Data.Map.InternalEq2 MapDefined in containers-0.7 · Data.Map.InternalOrd2 MapDefined in containers-0.7 · Data.Map.InternalShow2 MapDefined in containers-0.7 · Data.Map.Internal(Lift k, Lift a) => Lift (Map k a)Defined in containers-0.7 · Data.Map.InternalFunctor (Map k)Defined in containers-0.7 · Data.Map.InternalFoldable (Map k)Defined in containers-0.7 · Data.Map.InternalFolds in order of increasing key.
Traversable (Map k)Defined in containers-0.7 · Data.Map.InternalTraverses in order of increasing key.
Eq k => Eq1 (Map k)Defined in containers-0.7 · Data.Map.InternalOrd k => Ord1 (Map k)Defined in containers-0.7 · Data.Map.Internal(Ord k, Read k) => Read1 (Map k)Defined in containers-0.7 · Data.Map.InternalShow k => Show1 (Map k)Defined in containers-0.7 · Data.Map.InternalOrd k => IsList (Map k v)Defined in containers-0.7 · Data.Map.Internal(Eq k, Eq a) => Eq (Map k a)Defined in containers-0.7 · Data.Map.Internal(Data k, Data a, Ord k) => Data (Map k a)Defined in containers-0.7 · Data.Map.Internal(Ord k, Ord v) => Ord (Map k v)Defined in containers-0.7 · Data.Map.Internal(Ord k, Read k, Read e) => Read (Map k e)Defined in containers-0.7 · Data.Map.Internal(Show k, Show a) => Show (Map k a)Defined in containers-0.7 · Data.Map.InternalOrd k => Semigroup (Map k v)Defined in containers-0.7 · Data.Map.InternalOrd k => Monoid (Map k v)Defined in containers-0.7 · Data.Map.Internal(NFData k, NFData a) => NFData (Map k a)Defined in containers-0.7 · Data.Map.Internal(Binary k, Binary e) => Binary (Map k e)Defined in binary-0.8.9.3 · Data.Binary.Class(Structured k, Structured v) => Structured (Map k v)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.Structuredtype Item (Map k v) = (k, v)Defined in containers-0.7 · Data.Map.InternalA set of values a.
Foldable SetDefined in containers-0.7 · Data.Set.InternalFolds in order of increasing key.
Eq1 SetDefined in containers-0.7 · Data.Set.InternalOrd1 SetDefined in containers-0.7 · Data.Set.InternalShow1 SetDefined in containers-0.7 · Data.Set.InternalLift a => Lift (Set a)Defined in containers-0.7 · Data.Set.InternalOrd a => IsList (Set a)Defined in containers-0.7 · Data.Set.InternalEq a => Eq (Set a)Defined in containers-0.7 · Data.Set.Internal(Data a, Ord a) => Data (Set a)Defined in containers-0.7 · Data.Set.InternalOrd a => Ord (Set a)Defined in containers-0.7 · Data.Set.Internal(Read a, Ord a) => Read (Set a)Defined in containers-0.7 · Data.Set.InternalShow a => Show (Set a)Defined in containers-0.7 · Data.Set.InternalOrd a => Semigroup (Set a)Defined in containers-0.7 · Data.Set.InternalOrd a => Monoid (Set a)Defined in containers-0.7 · Data.Set.InternalNFData a => NFData (Set a)Defined in containers-0.7 · Data.Set.InternalBinary a => Binary (Set a)Defined in binary-0.8.9.3 · Data.Binary.ClassStructured k => Structured (Set k)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredNewtype (Set a) (Set' sep wrapper a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypestype Item (Set a) = aDefined in containers-0.7 · Data.Set.InternalFoldable NonEmptySetDefined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetEq a => Eq (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySet(Data a, Ord a) => Data (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetOrd a => Ord (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySet(Read a, Ord a) => Read (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetShow a => Show (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetOrd a => Semigroup (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetNote: there aren't Monoid instance.
NFData a => NFData (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetBinary a => Binary (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetStructured a => Structured (NonEmptySet a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetIdentity functor and monad. (a non-strict monad)
fmap (+1) (Identity 0)Identity 1
Identity [1, 2, 3] <> Identity [4, 5, 6]Identity [1,2,3,4,5,6]
>>> do
x <- Identity 10
y <- Identity (x + 5)
pure (x + y)
Identity 25
IdentityrunIdentity :: aMonad IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFunctor IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityMonadFix IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityApplicative IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFoldable IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityTraversable IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableMonadZip IdentityDefined in base-4.20.2.0 · Control.Monad.ZipFoldable1 IdentityDefined in base-4.20.2.0 · Data.Foldable1Eq1 IdentityDefined in base-4.20.2.0 · Data.Functor.ClassesOrd1 IdentityDefined in base-4.20.2.0 · Data.Functor.ClassesRead1 IdentityDefined in base-4.20.2.0 · Data.Functor.ClassesShow1 IdentityDefined in base-4.20.2.0 · Data.Functor.ClassesNFData1 IdentityDefined in deepseq-1.5.0.0 · Control.DeepSeqGeneric1 IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityStream LexState' Identity LTokenDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.ParserNewtype a (Identity a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NewtypeMonoid w => MonadAccum w (AccumT w Identity)Defined in mtl-2.3.1 · Control.Monad.AccumMonadSelect r (SelectT r Identity)Defined in mtl-2.3.1 · Control.Monad.SelectBounded a => Bounded (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityEnum a => Enum (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityEq a => Eq (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFloating a => Floating (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFractional a => Fractional (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityIntegral a => Integral (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityData a => Data (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum a => Num (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityOrd a => Ord (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityRead a => Read (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityThis instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed
Real a => Real (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityRealFloat a => RealFloat (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityRealFrac a => RealFrac (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityShow a => Show (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityThis instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed
Ix a => Ix (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityIsString a => IsString (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.StringGeneric (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentitySemigroup a => Semigroup (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityMonoid a => Monoid (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityBits a => Bits (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFiniteBits a => FiniteBits (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityStorable a => Storable (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityNFData a => NFData (Identity a)Defined in deepseq-1.5.0.0 · Control.DeepSeqBinary a => Binary (Identity a)Defined in binary-0.8.9.3 · Data.Binary.ClassParsec a => Parsec (Identity a)Defined in Cabal-syntax-3.12.1.0 · Distribution.ParsecPretty a => Pretty (Identity a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Prettytype Rep (Identity a) = D1 ('MetaData "Identity"
"GHC.Internal.Data.Functor.Identity"
"ghc-internal"
'True) (C1 ('MetaCons "Identity"
'PrefixI 'True) (S1 ('MetaSel ('Just "runIdentity"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identitytype Rep1 Identity = D1 ('MetaData "Identity"
"GHC.Internal.Data.Functor.Identity"
"ghc-internal"
'True) (C1 ('MetaCons "Identity"
'PrefixI 'True) (S1 ('MetaSel ('Just "runIdentity"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityProxy is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).
Historically, Proxy :: Proxy a is a safer alternative to the
undefined :: a idiom.
Proxy :: Proxy (Void, Int -> Int)Proxy
Proxy can even hold types of higher kinds,
Proxy :: Proxy EitherProxy
Proxy :: Proxy FunctorProxy
Proxy :: Proxy complicatedStructureProxy
Generic1 ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsMonad ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyFunctor ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyApplicative ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyFoldable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableAlternative ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyMonadPlus ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyMonadZip ProxyDefined in base-4.20.2.0 · Control.Monad.ZipEq1 ProxyDefined in base-4.20.2.0 · Data.Functor.ClassesOrd1 ProxyDefined in base-4.20.2.0 · Data.Functor.ClassesRead1 ProxyDefined in base-4.20.2.0 · Data.Functor.ClassesShow1 ProxyDefined in base-4.20.2.0 · Data.Functor.ClassesContravariant ProxyDefined in base-4.20.2.0 · Data.Functor.ContravariantNFData1 ProxyDefined in deepseq-1.5.0.0 · Control.DeepSeqBounded (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyEnum (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyEq (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyData t => Data (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataOrd (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyRead (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyShow (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyIx (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyGeneric (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyMonoid (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.ProxyNFData (Proxy a)Defined in deepseq-1.5.0.0 · Control.DeepSeqtype Rep (Proxy t) = D1 ('MetaData "Proxy"
"GHC.Internal.Data.Proxy"
"ghc-internal"
'False) (C1 ('MetaCons "Proxy"
'PrefixI 'False) U1)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 Proxy = D1 ('MetaData "Proxy"
"GHC.Internal.Data.Proxy"
"ghc-internal"
'False) (C1 ('MetaCons "Proxy"
'PrefixI 'False) U1)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsThe Const functor.
fmap (++ "World") (Const "Hello")Const "Hello"
Because we ignore the second type parameter to Const,
the Applicative instance, which has
essentially turns into (<*>) :: Monoid m => Const m (a -> b) -> Const m a -> Const m bMonoid m => m -> m -> m, which is (<>)
Const [1, 2, 3] <*> Const [4, 5, 6]Const [1,2,3,4,5,6]
Generic1 (Const a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstBifoldable ConstDefined in base-4.20.2.0 · Data.BifoldableBifoldable1 ConstDefined in base-4.20.2.0 · Data.Bifoldable1Bifunctor ConstDefined in base-4.20.2.0 · Data.BifunctorBitraversable ConstDefined in base-4.20.2.0 · Data.BitraversableEq2 ConstDefined in base-4.20.2.0 · Data.Functor.ClassesOrd2 ConstDefined in base-4.20.2.0 · Data.Functor.ClassesRead2 ConstDefined in base-4.20.2.0 · Data.Functor.ClassesShow2 ConstDefined in base-4.20.2.0 · Data.Functor.ClassesNFData2 ConstDefined in deepseq-1.5.0.0 · Control.DeepSeqFunctor (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstMonoid m => Applicative (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstFoldable (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstTraversable (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableEq a => Eq1 (Const a)Defined in base-4.20.2.0 · Data.Functor.ClassesOrd a => Ord1 (Const a)Defined in base-4.20.2.0 · Data.Functor.ClassesRead a => Read1 (Const a)Defined in base-4.20.2.0 · Data.Functor.ClassesShow a => Show1 (Const a)Defined in base-4.20.2.0 · Data.Functor.ClassesContravariant (Const a)Defined in base-4.20.2.0 · Data.Functor.ContravariantNFData a => NFData1 (Const a)Defined in deepseq-1.5.0.0 · Control.DeepSeqBounded a => Bounded (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstEnum a => Enum (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstEq a => Eq (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstFloating a => Floating (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstFractional a => Fractional (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstIntegral a => Integral (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const(Typeable k, Data a, Typeable b) => Data (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum a => Num (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstOrd a => Ord (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstRead a => Read (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstReal a => Real (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstRealFloat a => RealFloat (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstRealFrac a => RealFrac (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstShow a => Show (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstIx a => Ix (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstIsString a => IsString (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.StringGeneric (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstSemigroup a => Semigroup (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstMonoid a => Monoid (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstBits a => Bits (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstFiniteBits a => FiniteBits (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstStorable a => Storable (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstNFData a => NFData (Const a b)Defined in deepseq-1.5.0.0 · Control.DeepSeqtype Rep (Const a b) = D1 ('MetaData "Const"
"GHC.Internal.Data.Functor.Const"
"ghc-internal"
'True) (C1 ('MetaCons "Const"
'PrefixI 'True) (S1 ('MetaSel ('Just "getConst"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Consttype Rep1 (Const a) = D1 ('MetaData "Const"
"GHC.Internal.Data.Functor.Const"
"ghc-internal"
'True) (C1 ('MetaCons "Const"
'PrefixI 'True) (S1 ('MetaSel ('Just "getConst"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstUninhabited data type
Eq VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseData VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataOrd VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseRead VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadShow VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowIx VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.IxGeneric VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseException VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeNFData VoidDefined in deepseq-1.5.0.0 · Control.DeepSeqBinary VoidDefined in binary-0.8.9.3 · Data.Binary.ClassLift VoidDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntaxtype Rep Void = D1 ('MetaData "Void"
"GHC.Internal.Base"
"ghc-internal"
'False) V1Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsPartitions a list of Either into two lists. All the Left elements are extracted, in order, to the first component of the output. Similarly the Right elements are extracted to the second component of the output.
Basic usage:
let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]partitionEithers list(["foo","bar","baz"],[3,7])
The pair returned by partitionEithers x should be the same
pair as (lefts x, rights x):
let list = [ Left "foo", Right 3, Left "bar", Right 7, Left "baz" ]partitionEithers list == (lefts list, rights list)True
The catMaybes function takes a list of Maybes and returns a list of all the Just values.
Basic usage:
catMaybes [Just 1, Nothing, Just 3][1,3]
When constructing a list of Maybe values, catMaybes can be used to return all of the "success" results (if the list is the result of a map, then mapMaybe would be more appropriate):
import GHC.Internal.Text.Read ( readMaybe )[readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ][Just 1,Nothing,Just 3]catMaybes $ [readMaybe x :: Maybe Int | x <- ["1", "Foo", "3"] ][1,3]
The mapMaybe function is a version of map which can throw
out elements. In particular, the functional argument returns
something of type Maybe b. If this is Nothing, no element
is added on to the result list. If it is Just b, then b is
included in the result list.
Using mapMaybe f x is a shortcut for catMaybes $ map f x
in most cases:
import GHC.Internal.Text.Read ( readMaybe )let readMaybeInt = readMaybe :: String -> Maybe IntmapMaybe readMaybeInt ["1", "Foo", "3"][1,3]catMaybes $ map readMaybeInt ["1", "Foo", "3"][1,3]
If we map the Just constructor, the entire list should be returned:
mapMaybe Just [1,2,3][1,2,3]
The fromMaybe function takes a default value and a Maybe value. If the Maybe is Nothing, it returns the default value; otherwise, it returns the value contained in the Maybe.
Basic usage:
fromMaybe "" (Just "Hello, World!")"Hello, World!"
fromMaybe "" Nothing""
Read an integer from a string using readMaybe. If we fail to
parse an integer, we want to return 0 by default:
import GHC.Internal.Text.Read ( readMaybe )fromMaybe 0 (readMaybe "5")5fromMaybe 0 (readMaybe "")0
The maybeToList function returns an empty list when given Nothing or a singleton list when given Just.
Basic usage:
maybeToList (Just 7)[7]
maybeToList Nothing[]
One can use maybeToList to avoid pattern matching when combined with a function that (safely) works on lists:
import GHC.Internal.Text.Read ( readMaybe )sum $ maybeToList (readMaybe "3")3sum $ maybeToList (readMaybe "")0
The listToMaybe function returns Nothing on an empty list
or Just a where a is the first element of the list.
Basic usage:
listToMaybe []Nothing
listToMaybe [9]Just 9
listToMaybe [1,2,3]Just 1
Composing maybeToList with listToMaybe should be the identity on singleton/empty lists:
maybeToList $ listToMaybe [5][5]maybeToList $ listToMaybe [][]
But not on lists with more than one element:
maybeToList $ listToMaybe [1,2,3][1]
The isNothing function returns True iff its argument is Nothing.
Basic usage:
isNothing (Just 3)False
isNothing (Just ())False
isNothing NothingTrue
Only the outer constructor is taken into consideration:
isNothing (Just Nothing)False
The isJust function returns True iff its argument is of the
form Just _.
Basic usage:
isJust (Just 3)True
isJust (Just ())True
isJust NothingFalse
Only the outer constructor is taken into consideration:
isJust (Just Nothing)True
The unfoldr function is a `dual' to foldr: while foldr
reduces a list to a summary value, unfoldr builds a list from
a seed value. The function takes the element and returns Nothing
if it is done producing the list or returns Just (a,b), in which
case, a is a prepended to the list and b is used as the next
element in a recursive call. For example,
iterate f == unfoldr (\x -> Just (x, f x))In some cases, unfoldr can undo a foldr operation:
unfoldr f' (foldr f z xs) == xsif the following holds:
f' (f x y) = Just (x,y)
f' z = Nothingtake 1 (unfoldr (\x -> Just (x, undefined)) 'a')"a"
unfoldr (\b -> if b == 0 then Nothing else Just (b, b-1)) 10[10,9,8,7,6,5,4,3,2,1]
take 10 $ unfoldr (\(x, y) -> Just (x, (y, x + y))) (0, 1)[0,1,1,2,3,5,8,13,21,54]
\mathcal{O}(\min(m,n)). The isPrefixOf function takes two lists and
returns True iff the first list is a prefix of the second.
"Hello" `isPrefixOf` "Hello World!"True
"Hello" `isPrefixOf` "Wello Horld!"False
For the result to be True, the first list must be finite; False, however, results from any mismatch:
[0..] `isPrefixOf` [1..]False
[0..] `isPrefixOf` [0..99]False
[0..99] `isPrefixOf` [0..]True
[0..] `isPrefixOf` [0..]* Hangs forever *
isPrefixOf shortcuts when the first argument is empty:
isPrefixOf [] undefinedTrue
The isSuffixOf function takes two lists and returns True iff the first list is a suffix of the second.
"ld!" `isSuffixOf` "Hello World!"True
"World" `isSuffixOf` "Hello World!"False
The second list must be finite; however the first list may be infinite:
[0..] `isSuffixOf` [0..99]False
[0..99] `isSuffixOf` [0..]* Hangs forever *
intercalate xs xss is equivalent to (concat (intersperse xs xss)).
It inserts the list xs in between the lists in xss and concatenates the
result.
intercalate has the following properties:
take 5 (intercalate undefined ("Lorem" : undefined))"Lorem"
take 6 (intercalate ", " ("Lorem" : undefined))"Lorem*** Exception: Prelude.undefined
intercalate ", " ["Lorem", "ipsum", "dolor"]"Lorem, ipsum, dolor"
intercalate [0, 1] [[2, 3], [4, 5, 6], []][2,3,0,1,4,5,6,0,1]
intercalate [1, 2, 3] [[], []][1,2,3]
\mathcal{O}(n). The intersperse function takes an element and a list
and `intersperses' that element between the elements of the list.
intersperse has the following properties
take 1 (intersperse undefined ('a' : undefined))"a"
take 2 (intersperse ',' ('a' : undefined))"a*** Exception: Prelude.undefined
intersperse ',' "abcde""a,b,c,d,e"
intersperse 1 [3, 4, 5][3,1,4,1,5]
The sort function implements a stable sorting algorithm. It is a special case of sortBy, which allows the programmer to supply their own comparison function.
Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input.
The argument must be finite.
sort [1,6,4,3,2,5][1,2,3,4,5,6]
sort "haskell""aehklls"
import Data.Semigroup(Arg(..))sort [Arg ":)" 0, Arg ":D" 0, Arg ":)" 1, Arg ":3" 0, Arg ":D" 1][Arg ":)" 0,Arg ":)" 1,Arg ":3" 0,Arg ":D" 0,Arg ":D" 1]
The sortBy function is the non-overloaded version of sort. The argument must be finite.
The supplied comparison relation is supposed to be reflexive and antisymmetric,
otherwise, e. g., for _ _ -> GT, the ordered list simply does not exist.
The relation is also expected to be transitive: if it is not then sortBy
might fail to find an ordered permutation, even if it exists.
sortBy (\(a,_) (b,_) -> compare a b) [(2, "world"), (4, "!"), (1, "Hello")][(1,"Hello"),(2,"world"),(4,"!")]
\mathcal{O}(n^2). The nub function removes duplicate elements from a
list. In particular, it keeps only the first occurrence of each element. (The
name nub means `essence'.) It is a special case of nubBy, which allows
the programmer to supply their own equality test.
If there exists instance Ord a, it's faster to use nubOrd from the containers package
(link to the latest online documentation),
which takes only \mathcal{O}(n \log d) time where d is the number of
distinct elements in the list.
Another approach to speed up nub is to use
map Data.List.NonEmpty.head . Data.List.NonEmpty.group . sort,
which takes \mathcal{O}(n \log n) time, requires instance Ord a and doesn't
preserve the order.
nub [1,2,3,4,3,2,1,2,4,3,5][1,2,3,4,5]
nub "hello, world!""helo, wrd!"
The nubBy function behaves just like nub, except it uses a
user-supplied equality predicate instead of the overloaded (==)
function.
nubBy (\x y -> mod x 3 == mod y 3) [1,2,4,5,6][1,2,6]
nubBy (/=) [2, 7, 1, 8, 2, 8, 1, 8, 2, 8][2,2,2]
nubBy (>) [1, 2, 3, 2, 1, 5, 4, 5, 3, 2][1,2,3,5,5]
The partition function takes a predicate and a list, and returns the pair of lists of elements which do and do not satisfy the predicate, respectively; i.e.,
partition p xs == (filter p xs, filter (not . p) xs)partition (`elem` "aeiou") "Hello World!"("eoo","Hll Wrld!")
partition even [1..10]([2,4,6,8,10],[1,3,5,7,9])
partition (< 5) [1..10]([1,2,3,4],[5,6,7,8,9,10])
The dropWhileEnd function drops the largest suffix of a list in which the given predicate holds for all elements.
This function is lazy in spine, but strict in elements,
which makes it different from reverse . dropWhile p . reverse,
which is strict in spine, but lazy in elements. For instance:
take 1 (dropWhileEnd (< 0) (1 : undefined))[1]
take 1 (reverse $ dropWhile (< 0) $ reverse (1 : undefined))*** Exception: Prelude.undefined
but on the other hand
last (dropWhileEnd (< 0) [undefined, 1])*** Exception: Prelude.undefined
last (reverse $ dropWhile (< 0) $ reverse [undefined, 1])1
dropWhileEnd isSpace "foo\n""foo"
dropWhileEnd isSpace "foo bar""foo bar"dropWhileEnd (> 10) [1..20][1,2,3,4,5,6,7,8,9,10]
Non-empty (and non-strict) list type.
a :| [a]infixr 5Monad NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFunctor NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseMonadFix NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.FixApplicative NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.BaseFoldable NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableMonadZip NonEmptyDefined in base-4.20.2.0 · Control.Monad.ZipFoldable1 NonEmptyDefined in base-4.20.2.0 · Data.Foldable1Eq1 NonEmptyDefined in base-4.20.2.0 · Data.Functor.ClassesOrd1 NonEmptyDefined in base-4.20.2.0 · Data.Functor.ClassesRead1 NonEmptyDefined in base-4.20.2.0 · Data.Functor.ClassesShow1 NonEmptyDefined in base-4.20.2.0 · Data.Functor.ClassesNFData1 NonEmptyDefined in deepseq-1.5.0.0 · Control.DeepSeqGeneric1 NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsLift a => Lift (NonEmpty a)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIsList (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.IsListEq a => Eq (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseData a => Data (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataOrd a => Ord (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseRead a => Read (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadShow a => Show (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ShowGeneric (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsSemigroup (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.BaseNFData a => NFData (NonEmpty a)Defined in deepseq-1.5.0.0 · Control.DeepSeqBinary a => Binary (NonEmpty a)Defined in binary-0.8.9.3 · Data.Binary.ClassStructured a => Structured (NonEmpty a)Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredNewtype (NonEmpty a) (NonEmpty' sep wrapper a)Defined in Cabal-syntax-3.12.1.0 · Distribution.FieldGrammar.Newtypestype Rep (NonEmpty a) = D1 ('MetaData "NonEmpty"
"GHC.Internal.Base"
"ghc-internal"
'False) (C1 ('MetaCons ":|"
('InfixI 'RightAssociative 5
) 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a) :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [a])))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 NonEmpty = D1 ('MetaData "NonEmpty"
"GHC.Internal.Base"
"ghc-internal"
'False) (C1 ('MetaCons ":|"
('InfixI 'RightAssociative 5
) 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1 :*: S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec1 [])))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Item (NonEmpty a) = aDefined in ghc-internal-9.1003.0 · GHC.Internal.IsListExtract the first element of the stream.
Extract the possibly-empty tail of the stream.
Extract the last element of the stream.
Extract everything except the last element of the stream.
The Foldable class represents data structures that can be reduced to a summary value one element at a time. Strict left-associative folds are a good fit for space-efficient reduction, while lazy right-associative folds are a good fit for corecursive iteration, or for folds that short-circuit after processing an initial subsequence of the structure's elements.
Instances can be derived automatically by enabling the DeriveFoldable
extension. For example, a derived instance for a binary tree might be:
{-# LANGUAGE DeriveFoldable #-}
data Tree a = Empty
| Leaf a
| Node (Tree a) a (Tree a)
deriving FoldableA more detailed description can be found in the Overview section of
Data.Foldable#overview.
For the class laws see the Laws section of Data.Foldable#laws.
Foldable GraphDefined in Cabal-syntax-3.12.1.0 · Distribution.Compat.GraphFoldable NonEmptySetDefined in Cabal-syntax-3.12.1.0 · Distribution.Compat.NonEmptySetFoldable PerCompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerFoldable FieldDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldFoldable FieldLineDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldFoldable NameDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldFoldable SectionArgDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldFoldable PrettyFieldDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.PrettyFoldable ConditionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionFoldable VersionRangeFDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalFoldable ComplexDefined in base-4.20.2.0 · Data.ComplexFoldable FirstDefined in base-4.20.2.0 · Data.SemigroupFoldable LastDefined in base-4.20.2.0 · Data.SemigroupFoldable MaxDefined in base-4.20.2.0 · Data.SemigroupFoldable MinDefined in base-4.20.2.0 · Data.SemigroupFoldable SCCDefined in containers-0.7 · Data.GraphFoldable IntMapDefined in containers-0.7 · Data.IntMap.InternalFolds in order of increasing key.
Foldable DigitDefined in containers-0.7 · Data.Sequence.InternalFoldable ElemDefined in containers-0.7 · Data.Sequence.InternalFoldable FingerTreeDefined in containers-0.7 · Data.Sequence.InternalFoldable NodeDefined in containers-0.7 · Data.Sequence.InternalFoldable SeqDefined in containers-0.7 · Data.Sequence.InternalFoldable ViewLDefined in containers-0.7 · Data.Sequence.InternalFoldable ViewRDefined in containers-0.7 · Data.Sequence.InternalFoldable SetDefined in containers-0.7 · Data.Set.InternalFolds in order of increasing key.
Foldable TreeDefined in containers-0.7 · Data.TreeFolds in preorder
Foldable MaybeSDefined in containers-0.7 · Utils.Containers.Internal.StrictMaybeFoldable NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.IdentityFoldable FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListFoldable Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable TyVarBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxFoldable []Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable UAddrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable UCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable UDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable UFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable UIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable UWordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable (Arg a)Defined in base-4.20.2.0 · Data.SemigroupFoldable (Map k)Defined in containers-0.7 · Data.Map.InternalFolds in order of increasing key.
Foldable (Array i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable f => Foldable (Lift f)Defined in transformers-0.6.1.1 · Control.Applicative.LiftFoldable f => Foldable (MaybeT f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeFoldable m => Foldable (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.PureFoldable (CondBranch v c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeFoldable (CondTree v c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeFoldable (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.ConstFoldable (Constant a)Defined in transformers-0.6.1.1 · Data.Functor.ConstantFoldable f => Foldable (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable f => Foldable (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable f => Foldable (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable f => Foldable (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsDerived instance.
Foldable f => Foldable (ExceptT e f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptFoldable f => Foldable (IdentityT f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityFoldable f => Foldable (WriterT w f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.LazyFoldable f => Foldable (WriterT w f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictFoldable f => Foldable (Reverse f)Defined in transformers-0.6.1.1 · Data.Functor.ReverseFold from right to left.
Foldable (K1 i c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable(Foldable f, Foldable g) => Foldable (Product f g)Defined in base-4.20.2.0 · Data.Functor.Product(Foldable f, Foldable g) => Foldable (Sum f g)Defined in base-4.20.2.0 · Data.Functor.Sum(Foldable f, Foldable g) => Foldable (f :*: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable(Foldable f, Foldable g) => Foldable (f :+: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableFoldable f => Foldable (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable(Foldable f, Foldable g) => Foldable (Compose f g)Defined in base-4.20.2.0 · Data.Functor.Compose(Foldable f, Foldable g) => Foldable (f :.: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableMap each element of the structure into a monoid, and combine the
results with (<>). This fold is right-associative and lazy in the
accumulator. For strict left-associative folds consider foldMap'
instead.
Basic usage:
foldMap Sum [1, 3, 5]Sum {getSum = 9}
foldMap Product [1, 3, 5]Product {getProduct = 15}
foldMap (replicate 3) [1, 2, 3][1,1,1,2,2,2,3,3,3]
When a Monoid's (<>) is lazy in its second argument, foldMap can
return a result even from an unbounded structure. For example, lazy
accumulation enables Data.ByteString.Builder to efficiently serialise
large data structures and produce the output incrementally:
import qualified Data.ByteString.Lazy as Limport qualified Data.ByteString.Builder as Blet bld :: Int -> B.Builder; bld i = B.intDec i <> B.word8 0x20let lbs = B.toLazyByteString $ foldMap bld [0..]L.take 64 lbs"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"
Right-associative fold of a structure, lazy in the accumulator.
In the case of lists, foldr, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:
foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)Note that since the head of the resulting expression is produced by an application of the operator to the first element of the list, given an operator lazy in its right argument, foldr can produce a terminating expression from an unbounded list.
For a general Foldable structure this should be semantically identical to,
foldr f z = foldr f z . toListBasic usage:
foldr (||) False [False, True, False]True
foldr (||) False []False
foldr (\c acc -> acc ++ [c]) "foo" ['a', 'b', 'c', 'd']"foodcba"
⚠️ Applying foldr to infinite structures usually doesn't terminate.
It may still terminate under one of the following conditions:
the folding function is short-circuiting
the folding function is lazy on its second argument
(||) short-circuits on True values, so the following terminates
because there is a True value finitely far from the left side:
foldr (||) False (True : repeat False)True
But the following doesn't terminate:
foldr (||) False (repeat False ++ [True])* Hangs forever *
Applying foldr to infinite structures terminates when the operator is
lazy in its second argument (the initial accumulator is never used in
this case, and so could be left undefined, but [] is more clear):
take 5 $ foldr (\i acc -> i : fmap (+3) acc) [] (repeat 1)[1,4,7,10,13]
Test whether the structure is empty. The default implementation is Left-associative and lazy in both the initial element and the accumulator. Thus optimised for structures where the first element can be accessed in constant time. Structures where this is not the case should have a non-default implementation.
Basic usage:
null []True
null [1]False
null is expected to terminate even for infinite structures. The default implementation terminates provided the structure is bounded on the left (there is a leftmost element).
null [1..]False
Returns the size/length of a finite structure as an Int. The default implementation just counts elements starting with the leftmost. Instances for structures that can compute the element count faster than via element-by-element counting, should provide a specialised implementation.
Basic usage:
length []0
length ['a', 'b', 'c']3length [1..]* Hangs forever *
Left-associative fold of a structure but with strict application of the operator.
This ensures that each step of the fold is forced to Weak Head Normal Form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite structure to a single strict result (e.g. sum).
For a general Foldable structure this should be semantically identical to,
foldl' f z = foldl' f z . toListMap each element of a structure to an Applicative action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see traverse.
traverse_ is just like mapM_, but generalised to Applicative actions.
Basic usage:
traverse_ print ["Hello", "world", "!"]"Hello""world""!"
for_ is traverse_ with its arguments flipped. For a version that doesn't ignore the results see for. This is forM_ generalised to Applicative actions.
for_ is just like forM_, but generalised to Applicative actions.
Basic usage:
for_ [1..4] print1234
Determines whether any element of the structure satisfies the predicate.
Basic usage:
any (> 3) []False
any (> 3) [1,2]False
any (> 3) [1,2,3,4,5]True
any (> 3) [1..]True
any (> 3) [0, -1..]* Hangs forever *
Determines whether all elements of the structure satisfy the predicate.
Basic usage:
all (> 3) []True
all (> 3) [1,2]False
all (> 3) [1,2,3,4,5]False
all (> 3) [1..]False
all (> 3) [4..]* Hangs forever *
List of elements of a structure, from left to right. If the entire list is intended to be reduced via a fold, just fold the structure directly bypassing the list.
Basic usage:
toList Nothing[]
toList (Just 42)[42]
toList (Left "foo")[]
toList (Node (Leaf 5) 17 (Node Empty 12 (Leaf 8)))[5,17,12,8]
For lists, toList is the identity:
toList [1, 2, 3][1,2,3]
Functors representing data structures that can be transformed to structures of the same shape by performing an Applicative (or, therefore, Monad) action on each element from left to right.
A more detailed description of what same shape means, the various methods,
how traversals are constructed, and example advanced use-cases can be found
in the Overview section of Data.Traversable#overview.
For the class laws see the Laws section of Data.Traversable#laws.
Traversable PerCompilerFlavorDefined in Cabal-syntax-3.12.1.0 · Distribution.CompilerTraversable FieldDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldTraversable FieldLineDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldTraversable NameDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldTraversable SectionArgDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.FieldTraversable PrettyFieldDefined in Cabal-syntax-3.12.1.0 · Distribution.Fields.PrettyTraversable ConditionDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.ConditionTraversable VersionRangeFDefined in Cabal-syntax-3.12.1.0 · Distribution.Types.VersionRange.InternalTraversable ComplexDefined in base-4.20.2.0 · Data.ComplexTraversable FirstDefined in base-4.20.2.0 · Data.SemigroupTraversable LastDefined in base-4.20.2.0 · Data.SemigroupTraversable MaxDefined in base-4.20.2.0 · Data.SemigroupTraversable MinDefined in base-4.20.2.0 · Data.SemigroupTraversable SCCDefined in containers-0.7 · Data.GraphTraversable IntMapDefined in containers-0.7 · Data.IntMap.InternalTraverses in order of increasing key.
Traversable DigitDefined in containers-0.7 · Data.Sequence.InternalTraversable ElemDefined in containers-0.7 · Data.Sequence.InternalTraversable FingerTreeDefined in containers-0.7 · Data.Sequence.InternalTraversable NodeDefined in containers-0.7 · Data.Sequence.InternalTraversable SeqDefined in containers-0.7 · Data.Sequence.InternalTraversable ViewLDefined in containers-0.7 · Data.Sequence.InternalTraversable ViewRDefined in containers-0.7 · Data.Sequence.InternalTraversable TreeDefined in containers-0.7 · Data.TreeTraversable NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipListTraversable Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable TyVarBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxTraversable []Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable UAddrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable UCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable UDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable UFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable UIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable UWordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable (Arg a)Defined in base-4.20.2.0 · Data.SemigroupTraversable (Map k)Defined in containers-0.7 · Data.Map.InternalTraverses in order of increasing key.
Traversable (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable f => Traversable (Lift f)Defined in transformers-0.6.1.1 · Control.Applicative.LiftTraversable f => Traversable (MaybeT f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.MaybeIx i => Traversable (Array i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable(Monad m, Traversable m) => Traversable (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.PureTraversable (CondBranch v c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeTraversable (CondTree v c)Defined in Cabal-syntax-3.12.1.0 · Distribution.Types.CondTreeTraversable (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable (Constant a)Defined in transformers-0.6.1.1 · Data.Functor.ConstantTraversable f => Traversable (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable f => Traversable (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable f => Traversable (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable f => Traversable (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.BackwardsDerived instance.
Traversable f => Traversable (ExceptT e f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.ExceptTraversable f => Traversable (IdentityT f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.IdentityTraversable f => Traversable (WriterT w f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.LazyTraversable f => Traversable (WriterT w f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.StrictTraversable f => Traversable (Reverse f)Defined in transformers-0.6.1.1 · Data.Functor.ReverseTraverse from right to left.
Traversable (K1 i c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable(Traversable f, Traversable g) => Traversable (Product f g)Defined in base-4.20.2.0 · Data.Functor.Product(Traversable f, Traversable g) => Traversable (Sum f g)Defined in base-4.20.2.0 · Data.Functor.Sum(Traversable f, Traversable g) => Traversable (f :*: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable(Traversable f, Traversable g) => Traversable (f :+: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableTraversable f => Traversable (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable(Traversable f, Traversable g) => Traversable (Compose f g)Defined in base-4.20.2.0 · Data.Functor.Compose(Traversable f, Traversable g) => Traversable (f :.: g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableMap each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see traverse_.
Basic usage:
In the first two examples we show each evaluated action mapping to the output structure.
traverse Just [1,2,3,4]Just [1,2,3,4]
traverse id [Right 1, Right 2, Right 3, Right 4]Right [1,2,3,4]
In the next examples, we show that Nothing and Left values short circuit the created structure.
traverse (const Nothing) [1,2,3,4]Nothing
traverse (\x -> if odd x then Just x else Nothing) [1,2,3,4]Nothing
traverse id [Right 1, Right 2, Right 3, Right 4, Left 0]Left 0
Evaluate each action in the structure from left to right, and collect the results. For a version that ignores the results see sequenceA_.
Basic usage:
For the first two examples we show sequenceA fully evaluating a a structure and collecting the results.
sequenceA [Just 1, Just 2, Just 3]Just [1,2,3]
sequenceA [Right 1, Right 2, Right 3]Right [1,2,3]
The next two example show Nothing and Just will short circuit the resulting structure if present in the input. For more context, check the Traversable instances for Either and Maybe.
sequenceA [Just 1, Just 2, Just 3, Nothing]Nothing
sequenceA [Right 1, Right 2, Right 3, Left 4]Left 4
on b u x y runs the binary function b on the results of applying
unary function u to two arguments x and y. From the opposite
perspective, it transforms two inputs and combines the outputs.
(op `on` f) x y = f x `op` f ysortBy (compare `on` length) [[0, 1, 2], [0, 1], [], [0]][[],[0],[0,1],[0,1,2]]
((+) `on` length) [1, 2, 3] [-1]4
((,) `on` (*2)) 2 3(4,6)
comparing p x y = compare (p x) (p y)Useful combinator for use in conjunction with the xxxBy family
of functions from Data.List, for example:
... sortBy (comparing fst) ...Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.
Promote a function to a monad. This is equivalent to fmap but specialised to Monads.
Promote a function to a monad, scanning the monadic arguments from left to right.
liftM2 (+) [0,1] [0,2][0,2,1,3]
liftM2 (+) (Just 1) NothingNothing
liftM2 (+) (+ 3) (* 2) 518
The reverse of when.
do x <- getLine unless (x == "hi") (putStrLn "hi!")comingupwithexamplesisdifficulthi!
unless (pi > exp 1) NothingJust ()
Conditional execution of Applicative expressions. For example,
when debug (putStrLn "Debugging")will output the string Debugging if the Boolean value debug
is True, and otherwise do nothing.
putStr "pi:" >> when False (print 3.14159)pi:
void value discards or ignores the result of evaluation, such
as the return value of an System.IO.IO action.
Replace the contents of a Maybe Int with unit:
void NothingNothing
void (Just 3)Just ()
Replace the contents of an Either Int Int
with unit, resulting in an Either Int :()
void (Left 8675309)Left 8675309
void (Right 8675309)Right ()
Replace every element of a list with unit:
void [1,2,3][(),(),()]
Replace the second element of a pair with unit:
void (1,2)(1,())
Discard the result of an System.IO.IO action:
mapM print [1,2]12[(),()]
void $ mapM print [1,2]12
The foldM function is analogous to foldl, except that its result is
encapsulated in a monad. Note that foldM works from left-to-right over
the list arguments. This could be an issue where (>>) and the `folded
function' are not commutative.
foldM f a1 [x1, x2, ..., xm]
==
do
a2 <- f a1 x1
a3 <- f a2 x2
...
f am xmIf right-to-left evaluation is required, the input list should be reversed.
This generalizes the list-based filter function.
runIdentity (filterM (Identity . p) xs) == filter p xsfilterM (\x -> do putStrLn ("Keep: " ++ show x ++ "?") answer <- getLine pure (answer == "y")) [1, 2, 3]Keep: 1?yKeep: 2?nKeep: 3?y[1,3]
filterM (\x -> do putStr (show x) x' <- readLn pure (x == x')) [1, 2, 3]122233[2,3]
The join function is the conventional monad join operator. It is used to remove one level of monadic structure, projecting its bound argument into the outer level.
'join bss' can be understood as the do expression
do bs <- bss
bs
join [[1, 2, 3], [4, 5, 6], [7, 8, 9]][1,2,3,4,5,6,7,8,9]
join (Just (Just 3))Just 3
A common use of join is to run an IO computation returned from
an GHC.Conc.STM transaction, since GHC.Conc.STM transactions
can't perform IO directly. Recall that
GHC.Internal.Conc.atomically :: STM a -> IO a
is used to run GHC.Conc.STM transactions atomically. So, by
specializing the types of GHC.Internal.Conc.atomically and join to
GHC.Internal.Conc.atomically :: STM (IO b) -> IO (IO b)
join :: IO (IO b) -> IO b
we can compose them as
join . GHC.Internal.Conc.atomically :: STM (IO b) -> IO b
to run an GHC.Conc.STM transaction and the IO action it
returns.
Conditional failure of Alternative computations. Defined by
guard True = pure ()
guard False = empty
Common uses of guard include conditionally signalling an error in an error monad and conditionally rejecting the current choice in an Alternative-based parser.
As an example of signalling an error in the error monad Maybe,
consider a safe division function safeDiv x y that returns
Nothing when the denominator y is zero and Just (x `div`
y) otherwise. For example:
safeDiv 4 0Nothing
safeDiv 4 2Just 2
A definition of safeDiv using guards, but not guard:
safeDiv :: Int -> Int -> Maybe Int
safeDiv x y | y /= 0 = Just (x `div` y)
| otherwise = Nothing
A definition of safeDiv using guard and Monad do-notation:
safeDiv :: Int -> Int -> Maybe Int
safeDiv x y = do
guard (y /= 0)
return (x `div` y)
catch This is the simplest of the exception-catching functions. It takes a single argument, runs it, and if an exception is raised the "handler" is executed, with the value of the exception passed as an argument. Otherwise, the result is returned as normal. For example:
catch (readFile f)
(\e -> do let err = show (e :: IOException)
hPutStr stderr ("Warning: Couldn't open " ++ f ++ ": " ++ err)
return "")Note that we have to give a type signature to e, or the program
will not typecheck as the type is ambiguous. While it is possible
to catch exceptions of any type, see the section "Catching all
exceptions" (in Control.Exception) for an explanation of the problems with doing so.
For catching exceptions in pure (non-IO) expressions, see the function evaluate.
Note that due to Haskell's unspecified evaluation order, an
expression may throw one of several possible exceptions: consider
the expression (error "urk") + (1 `div` 0). Does
the expression throw
ErrorCall "urk", or DivideByZero?
The answer is "it might throw either"; the choice is
non-deterministic. If you are catching any type of exception then you
might catch either. If you are calling catch with type
IO Int -> (ArithException -> IO Int) -> IO Int then the handler may
get run with DivideByZero as an argument, or an ErrorCall "urk"
exception may be propagated further up. If you call it again, you
might get the opposite behaviour. This is ok, because catch is an
IO computation.
A variant of throw that can only be used within the IO monad.
Although throwIO has a type that is an instance of the type of throw, the two functions are subtly different:
throw e `seq` () ===> throw e
throwIO e `seq` () ===> ()The first example will cause the exception e to be raised,
whereas the second one won't. In fact, throwIO will only cause
an exception to be raised when it is used within the IO monad.
The throwIO variant should be used in preference to throw to raise an exception within the IO monad because it guarantees ordering with respect to other operations, whereas throw does not. We say that throwIO throws *precise* exceptions and throw, error, etc. all throw *imprecise* exceptions. For example
throw e + error "boom" ===> error "boom"
throw e + error "boom" ===> throw eare both valid reductions and the compiler may pick any (loop, even), whereas
throwIO e >> error "boom" ===> throwIO ewill always throw e when executed.
See also the GHC wiki page on precise exceptions for a more technical introduction to how GHC optimises around precise vs. imprecise exceptions.
Evaluate the argument to weak head normal form.
evaluate is typically used to uncover any exceptions that a lazy value may contain, and possibly handle them.
evaluate only evaluates to weak head normal form. If deeper
evaluation is needed, the force function from Control.DeepSeq
may be handy:
evaluate $ force xThere is a subtle difference between evaluate x and return $! x,
analogous to the difference between throwIO and throw. If the lazy
value x throws an exception, return $! x will fail to return an
IO action and will throw an exception instead. evaluate x, on the
other hand, always produces an IO action; that action will throw an
exception upon execution iff x throws an exception upon evaluation.
The practical implication of this difference is that due to the imprecise exceptions semantics,
(return $! error "foo") >> error "bar"may throw either "foo" or "bar", depending on the optimizations
performed by the compiler. On the other hand,
evaluate (error "foo") >> error "bar"is guaranteed to throw "foo".
The rule of thumb is to use evaluate to force or handle exceptions in
lazy values. If, on the other hand, you are forcing a lazy value for
efficiency reasons only and do not care about exceptions, you may
use return $! x.
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 MyExceptionThe 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 = frontendExceptionFromExceptionWe 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
toException :: e -> SomeExceptiontoException should produce a SomeException with no attached ExceptionContext.
fromException :: SomeException -> Maybe edisplayException :: e -> StringRender this exception value in a human-friendly manner.
Default implementation: show.
backtraceDesired :: e -> BoolException TimeoutDefined in base-4.20.2.0 · System.TimeoutException SizeOverflowExceptionDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeException VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeException NestedAtomicallyDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException NoMatchingContinuationPromptDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException NoMethodErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException NonTerminationDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException PatternMatchFailDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException RecConErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException RecSelErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException RecUpdErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException TypeErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.BaseException DynamicDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DynamicException ErrorCallDefined in ghc-internal-9.1003.0 · GHC.Internal.ExceptionException ArithExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeException SomeExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeThis drops any attached ExceptionContext.
Exception AllocationLimitExceededDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException ArrayExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException AssertionFailedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException AsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException BlockedIndefinitelyOnMVarDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException BlockedIndefinitelyOnSTMDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException CompactionFailedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException DeadlockDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException FixIOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException IOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException SomeAsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException FileLockingNotSupportedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Lock.CommonException IOPortExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IOPortException EncodingExceptionDefined in os-string-2.0.7 · System.OsString.Encoding.InternalException ParseErrorDefined in parsec-3.1.18.0 · Text.Parsec.ErrorException UnicodeExceptionDefined in text-2.1.3 · Data.Text.Encoding.ErrorException a => Exception (ExceptionWithContext a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeException e => Exception (NoBacktrace e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeExceptions that occur in the IO monad.
An IOException records a more specific error type, a descriptive
string and maybe the handle that was used when the error was
flagged.
Eq IOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow IOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException IOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionMonadError IOException IODefined in mtl-2.3.1 · Control.Monad.Error.ClassThe 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.
forall e. (Exception e, HasExceptionContext) => SomeException eShow SomeExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeException SomeExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.TypeThis drops any attached ExceptionContext.
Try IOException.
Catch IOException.
Catch ExitCode
deepseq: fully evaluates the first argument, before returning the second.
The name deepseq is used to illustrate the relationship to seq: where seq is shallow in the sense that it only evaluates the top level of its argument, deepseq traverses the entire data structure evaluating it completely.
deepseq can be useful for forcing pending exceptions,
eradicating space leaks, or forcing lazy I/O to happen. It is
also useful in conjunction with parallel Strategies (see the
parallel package).
There is no guarantee about the ordering of evaluation. The
implementation may evaluate the components of the structure in
any order or in parallel. To impose an actual order on
evaluation, use pseq from Control.Parallel in the
parallel package.
a variant of deepseq that is useful in some circumstances:
force x = x `deepseq` xforce x fully evaluates x, and then returns it. Note that
force x only performs evaluation when the value of force x
itself is demanded, so essentially it turns shallow evaluation into
deep evaluation.
force can be conveniently used in combination with ViewPatterns:
{-# LANGUAGE BangPatterns, ViewPatterns #-}
import Control.DeepSeq
someFun :: ComplexData -> SomeResult
someFun (force -> !arg) = {- 'arg' will be fully evaluated -}Another useful application is to combine force with evaluate in order to force deep evaluation relative to other IO operations:
import Control.Exception (evaluate)
import Control.DeepSeq
main = do
result <- evaluate $ force $ pureComputation
{- 'result' will be fully evaluated at this point -}
return ()Finally, here's an exception safe variant of the readFile' example:
readFile' :: FilePath -> IO String
readFile' fn = bracket (openFile fn ReadMode) hClose $ \h ->
evaluate . force =<< hGetContents hReturns True for any Unicode space character, and the control
characters \t, \n, \r, \f, \v.
Selects ASCII digits, i.e. '0'..'9'.
Selects upper-case or title-case alphabetic Unicode characters (letters). Title case is used by a small number of letter ligatures like the single-character form of Lj.
Note: this predicate does not work for letter-like characters such as:
'Ⓐ' (U+24B6 circled Latin capital letter A) and
'Ⅳ' (U+2163 Roman numeral four). This is due to selecting only
characters with the GeneralCategory UppercaseLetter or TitlecaseLetter.
See isUpperCase for a more intuitive predicate. Note that
unlike isUpperCase, isUpper does select title-case characters such as
'Dž' (U+01C5 Latin capital letter d with small letter z with caron) or
'ᾯ' (U+1FAF Greek capital letter omega with dasia and perispomeni and
prosgegrammeni).
Selects alphabetic Unicode characters (lower-case, upper-case and title-case letters, plus letters of caseless scripts and modifiers letters). This function is equivalent to isLetter.
This function returns True if its argument has one of the following GeneralCategorys, or False otherwise:
These classes are defined in the Unicode Character Database, part of the Unicode standard. The same document defines what is and is not a "Letter".
Selects alphabetic or numeric Unicode characters.
Note that numeric digits outside the ASCII range, as well as numeric
characters which aren't digits, are selected by this function but not by
isDigit. Such characters may be part of identifiers but are not used by
the printer and reader to represent numbers, e.g., Roman numerals like ,
full-width digits like V'1' (aka '65297').
This function returns True if its argument has one of the following GeneralCategorys, or False otherwise:
The Prelude.toEnum method restricted to the type Char.
The Prelude.fromEnum method restricted to the type Char.
Convert a letter to the corresponding lower-case letter, if any. Any other character is returned unchanged.
Convert a letter to the corresponding upper-case letter, if any. Any other character is returned unchanged.
Since Void values logically don't exist, this witnesses the logical reasoning tool of "ex falso quodlibet".
let x :: Either Void Int; x = Right 5:{case x of Right r -> r Left l -> absurd l:}5
Bounded WordDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEnum WordDefined in ghc-internal-9.1003.0 · GHC.Internal.EnumEq WordDefined in ghc-prim-0.12.0 · GHC.ClassesIntegral WordDefined in ghc-internal-9.1003.0 · GHC.Internal.RealData WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum WordDefined in ghc-internal-9.1003.0 · GHC.Internal.NumOrd WordDefined in ghc-prim-0.12.0 · GHC.ClassesRead WordDefined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal WordDefined in ghc-internal-9.1003.0 · GHC.Internal.RealShow WordDefined in ghc-internal-9.1003.0 · GHC.Internal.ShowIx WordDefined in ghc-internal-9.1003.0 · GHC.Internal.IxBits WordDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsFiniteBits WordDefined in ghc-internal-9.1003.0 · GHC.Internal.BitsStorable WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg WordDefined in base-4.20.2.0 · Text.PrintfNFData WordDefined in deepseq-1.5.0.0 · Control.DeepSeqBinary WordDefined in binary-0.8.9.3 · Data.Binary.ClassStructured WordDefined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift WordDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray WordDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Word IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Word)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsFoldable UWordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.FoldableTraversable UWordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.TraversableMArray (STUArray s) Word (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Word)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsEq (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsOrd (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsShow (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.GenericsGeneric (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep (URec Word p) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UWord"
'PrefixI 'True) (S1 ('MetaSel ('Just "uWord#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UWord))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericstype Rep1 (URec Word) = D1 ('MetaData "URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons "UWord"
'PrefixI 'True) (S1 ('MetaSel ('Just "uWord#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UWord))Defined in ghc-internal-9.1003.0 · GHC.Internal.Genericsdata URec WordDefined in ghc-internal-9.1003.0 · GHC.Internal.GenericsUsed for marking occurrences of Word#
8-bit unsigned integer type
Bounded Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEnum Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEq Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIntegral Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordData Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordOrd Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordRead Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordShow Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIx Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordBits Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordFiniteBits Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.WordStorable Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg Word8Defined in base-4.20.2.0 · Text.PrintfNFData Word8Defined in deepseq-1.5.0.0 · Control.DeepSeqBinary Word8Defined in binary-0.8.9.3 · Data.Binary.ClassStructured Word8Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift Word8Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray Word8Defined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Word8 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Word8 (ST s)Defined in array-0.5.8.0 · Data.Array.Base16-bit unsigned integer type
Bounded Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEnum Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEq Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIntegral Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordData Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordOrd Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordRead Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordShow Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIx Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordBits Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordFiniteBits Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.WordStorable Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg Word16Defined in base-4.20.2.0 · Text.PrintfNFData Word16Defined in deepseq-1.5.0.0 · Control.DeepSeqBinary Word16Defined in binary-0.8.9.3 · Data.Binary.ClassStructured Word16Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift Word16Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray Word16Defined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Word16 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Word16 (ST s)Defined in array-0.5.8.0 · Data.Array.Base32-bit unsigned integer type
Bounded Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEnum Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEq Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIntegral Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordData Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordOrd Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordRead Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordShow Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIx Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordBits Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordFiniteBits Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.WordStorable Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg Word32Defined in base-4.20.2.0 · Text.PrintfNFData Word32Defined in deepseq-1.5.0.0 · Control.DeepSeqMantissa Word32Defined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.InternalBinary Word32Defined in binary-0.8.9.3 · Data.Binary.ClassStructured Word32Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift Word32Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray Word32Defined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Word32 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Word32 (ST s)Defined in array-0.5.8.0 · Data.Array.Base64-bit unsigned integer type
Bounded Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEnum Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordEq Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIntegral Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordData Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordOrd Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordRead Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.ReadReal Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordShow Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordIx Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordBits Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordFiniteBits Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.WordStorable Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg Word64Defined in base-4.20.2.0 · Text.PrintfNFData Word64Defined in deepseq-1.5.0.0 · Control.DeepSeqMantissa Word64Defined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.InternalBinary Word64Defined in binary-0.8.9.3 · Data.Binary.ClassStructured Word64Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift Word64Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray Word64Defined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Word64 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Word64 (ST s)Defined in array-0.5.8.0 · Data.Array.Base8-bit signed integer type
Bounded Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEnum Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEq Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIntegral Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntData Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntOrd Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntRead Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntReal Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntShow Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIx Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntBits Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntFiniteBits Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.IntStorable Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg Int8Defined in base-4.20.2.0 · Text.PrintfNFData Int8Defined in deepseq-1.5.0.0 · Control.DeepSeqBinary Int8Defined in binary-0.8.9.3 · Data.Binary.ClassStructured Int8Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift Int8Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray Int8Defined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Int8 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Int8 (ST s)Defined in array-0.5.8.0 · Data.Array.Base16-bit signed integer type
Bounded Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEnum Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEq Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIntegral Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntData Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntOrd Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntRead Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntReal Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntShow Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIx Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntBits Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntFiniteBits Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.IntStorable Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg Int16Defined in base-4.20.2.0 · Text.PrintfNFData Int16Defined in deepseq-1.5.0.0 · Control.DeepSeqBinary Int16Defined in binary-0.8.9.3 · Data.Binary.ClassStructured Int16Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift Int16Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray Int16Defined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Int16 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Int16 (ST s)Defined in array-0.5.8.0 · Data.Array.Base32-bit signed integer type
Bounded Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEnum Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEq Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIntegral Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntData Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntOrd Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntRead Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntReal Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntShow Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIx Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntBits Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntFiniteBits Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.IntStorable Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg Int32Defined in base-4.20.2.0 · Text.PrintfNFData Int32Defined in deepseq-1.5.0.0 · Control.DeepSeqBinary Int32Defined in binary-0.8.9.3 · Data.Binary.ClassStructured Int32Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift Int32Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray Int32Defined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Int32 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Int32 (ST s)Defined in array-0.5.8.0 · Data.Array.Base64-bit signed integer type
Bounded Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEnum Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntEq Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIntegral Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntData Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.DataNum Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntOrd Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntRead Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntReal Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntShow Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntIx Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntBits Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntFiniteBits Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.IntStorable Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.StorablePrintfArg Int64Defined in base-4.20.2.0 · Text.PrintfNFData Int64Defined in deepseq-1.5.0.0 · Control.DeepSeqBinary Int64Defined in binary-0.8.9.3 · Data.Binary.ClassStructured Int64Defined in Cabal-syntax-3.12.1.0 · Distribution.Utils.StructuredLift Int64Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.SyntaxIArray UArray Int64Defined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Int64 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Int64 (ST s)Defined in array-0.5.8.0 · Data.Array.BaseNew name for <>
Defines the exit codes that a program can return.
ExitSuccessindicates successful termination;
ExitFailure Intindicates program failure with an exit code. The exact interpretation of the code is operating-system dependent. In particular, some values may be prohibited (e.g. 0 on a POSIX-compliant system).
Eq ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionOrd ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionRead ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionShow ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionGeneric ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionException ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionNFData ExitCodeDefined in deepseq-1.5.0.0 · Control.DeepSeqtype Rep ExitCode = D1 ('MetaData "ExitCode"
"GHC.Internal.IO.Exception"
"ghc-internal"
'False) (C1 ('MetaCons "ExitSuccess"
'PrefixI 'False) U1 :+: C1 ('MetaCons "ExitFailure"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))Defined in ghc-internal-9.1003.0 · GHC.Internal.IO.ExceptionComputation exitWith code throws ExitCode code.
Normally this terminates the program, returning code to the
program's caller.
On program termination, the standard Handles stdout and stderr are flushed automatically; any other buffered Handles need to be flushed manually, otherwise the buffered data will be discarded.
A program that fails in any other way is treated as if it had called exitFailure. A program that terminates successfully without calling exitWith explicitly is treated as if it had called exitWith ExitSuccess.
As an ExitCode is an Exception, it can be caught using the functions of Control.Exception. This means that cleanup computations added with bracket (from Control.Exception) are also executed properly on exitWith.
Note: in GHC, exitWith should be called from the main program thread in order to exit the process. When called from another thread, exitWith will throw an ExitCode as normal, but the exception will not cause the process itself to exit.
The computation exitSuccess is equivalent to exitWith ExitSuccess, It terminates the program successfully.
The computation exitFailure is equivalent to
exitWith (ExitFailure exitfail),
where exitfail is implementation-dependent.
Parse a string using the Read instance. Succeeds if there is exactly one valid result.
readMaybe "123" :: Maybe IntJust 123
readMaybe "hello" :: Maybe IntNothing
Deprecated. Don't leave me in the code
Deprecated. Don't leave me in the code
Deprecated. Don't leave me in the code
Deprecated. Don't leave me in the code
Deprecated. Don't leave me in the code