HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulerio-0.1.22.0Haskell2010

RIO.Prelude.Types

  • 50 types
  • 41 classes
  • Packagerio-0.1.22.0
  • Exports91
  • LanguageHaskell2010
  • LicenceMIT
  • SourceTypes.hs

base

0 declarations

Types

Bool

Re-exported from Data.Bool:

datadata Bool
#
Instances32Bounded, Enum, Eq, Data, Ord, Read, …
  • Bounded BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Eq BoolDefined in ghc-prim-0.12.0 · GHC.Classes
  • Data BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Ord BoolDefined in ghc-prim-0.12.0 · GHC.Classes
  • Read BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Show BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Ix BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Ix
  • Generic BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Bits BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Bits

    Interpret Bool as 1-bit bit-field

  • FiniteBits BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Bits
  • Storable BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • SingKind BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • NFData BoolDefined in deepseq-1.5.0.0 · Control.DeepSeq
  • Pretty BoolDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Pretty BoolDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Binary BoolDefined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable BoolDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Unbox BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Lift BoolDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • SingI 'FalseDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • SingI 'TrueDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • IArray UArray BoolDefined in array-0.5.8.0 · Data.Array.Base
  • Vector Vector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MVector MVector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Bool IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • MArray (STUArray s) Bool (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • type 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.Generics
  • type DemoteRep Bool = BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • data Sing
    • STrue :: R:SingBoola 'True
    • SFalse :: R:SingBoola 'False
    Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • data MVector s BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

Char (String)

Re-exported from Data.Char:

datadata Char
#

The 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

'\NUL'

'\0'

null character

'\SOH'

'\1'

start of heading

'\STX'

'\2'

start of text

'\ETX'

'\3'

end of text

'\EOT'

'\4'

end of transmission

'\ENQ'

'\5'

enquiry

'\ACK'

'\6'

acknowledge

'\BEL'

'\7'

,

'\a'

bell (alert)

'\BS'

'\8'

,

'\b'

backspace

'\HT'

'\9'

,

'\t'

horizontal tab

'\LF'

'\10'

,

'\n'

line feed (new line)

'\VT'

'\11'

,

'\v'

vertical tab

'\FF'

'\12'

,

'\f'

form feed

'\CR'

'\13'

,

'\r'

carriage return

'\SO'

'\14'

shift out

'\SI'

'\15'

shift in

'\DLE'

'\16'

data link escape

'\DC1'

'\17'

device control 1

'\DC2'

'\18'

device control 2

'\DC3'

'\19'

device control 3

'\DC4'

'\20'

device control 4

'\NAK'

'\21'

negative acknowledge

'\SYN'

'\22'

synchronous idle

'\ETB'

'\23'

end of transmission block

'\CAN'

'\24'

cancel

'\EM'

'\25'

end of medium

'\SUB'

'\26'

substitute

'\ESC'

'\27'

escape

'\FS'

'\28'

file separator

'\GS'

'\29'

group separator

'\RS'

'\30'

record separator

'\US'

'\31'

unit separator

'\SP'

'\32'

,

' '

space

'\DEL'

'\127'

delete

Data.Char provides utilities to work with Char.

Instances41Bounded, Enum, Data, Read, Ix, Storable, …

Re-exported from Data.String:

typetype String = [Char]
#

String 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.

Performance considerations

[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.

Re-exported from System.IO:

typetype FilePath = String
#

File 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.

Ordering

Re-exported from Data.Ord:

datadata Ordering
#
Instances17Bounded, Enum, Eq, Data, Ord, Read, …

Numbers

Int

Re-exported from Data.Int:

datadata Int
#

A 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 minBound and maxBound from the Bounded class.

Instances43Bounded, Enum, Integral, Data, Num, Read, …

Int8

datadata Int8
#

8-bit signed integer type

Instances29Bounded, Enum, Eq, Integral, Data, Num, …
  • Bounded Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Enum Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Eq Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Integral Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Data Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Num Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ord Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Read Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Real Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Show Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ix Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Bits Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • FiniteBits Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Storable Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • PrintfArg Int8Defined in base-4.20.2.0 · Text.Printf
  • NFData Int8Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • Binary Int8Defined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable Int8Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • Prim Int8Defined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox Int8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Display Int8Defined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift Int8Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • IArray UArray Int8Defined in array-0.5.8.0 · Data.Array.Base
  • Vector Vector Int8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MVector MVector Int8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Int8 IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • MArray (STUArray s) Int8 (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • data MVector s Int8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector Int8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

Int16

datadata Int16
#

16-bit signed integer type

Instances29Bounded, Enum, Eq, Integral, Data, Num, …
  • Bounded Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Enum Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Eq Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Integral Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Data Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Num Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ord Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Read Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Real Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Show Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ix Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Bits Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • FiniteBits Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Storable Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • PrintfArg Int16Defined in base-4.20.2.0 · Text.Printf
  • NFData Int16Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • Binary Int16Defined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable Int16Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • Prim Int16Defined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox Int16Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Display Int16Defined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift Int16Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • IArray UArray Int16Defined in array-0.5.8.0 · Data.Array.Base
  • Vector Vector Int16Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MVector MVector Int16Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Int16 IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • MArray (STUArray s) Int16 (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • data MVector s Int16Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector Int16Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

Int32

datadata Int32
#

32-bit signed integer type

Instances29Bounded, Enum, Eq, Integral, Data, Num, …
  • Bounded Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Enum Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Eq Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Integral Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Data Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Num Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ord Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Read Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Real Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Show Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ix Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Bits Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • FiniteBits Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Storable Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • PrintfArg Int32Defined in base-4.20.2.0 · Text.Printf
  • NFData Int32Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • Binary Int32Defined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable Int32Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • Prim Int32Defined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox Int32Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Display Int32Defined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift Int32Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • IArray UArray Int32Defined in array-0.5.8.0 · Data.Array.Base
  • Vector Vector Int32Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MVector MVector Int32Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Int32 IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • MArray (STUArray s) Int32 (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • data MVector s Int32Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector Int32Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

Int64

datadata Int64
#

64-bit signed integer type

Instances29Bounded, Enum, Eq, Integral, Data, Num, …
  • Bounded Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Enum Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Eq Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Integral Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Data Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Num Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ord Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Read Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Real Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Show Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ix Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Bits Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • FiniteBits Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Storable Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • PrintfArg Int64Defined in base-4.20.2.0 · Text.Printf
  • NFData Int64Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • Binary Int64Defined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable Int64Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • Prim Int64Defined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox Int64Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Display Int64Defined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift Int64Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • IArray UArray Int64Defined in array-0.5.8.0 · Data.Array.Base
  • Vector Vector Int64Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MVector MVector Int64Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Int64 IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • MArray (STUArray s) Int64 (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • data MVector s Int64Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector Int64Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

Word

Re-exported from Data.Word:

datadata Word
#

A Word is an unsigned integral type, with the same size as Int.

Instances40Bounded, Enum, Integral, Data, Num, Read, …

Word8

datadata Word8
#

8-bit unsigned integer type

Instances29Bounded, Enum, Eq, Integral, Data, Num, …
  • Bounded Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Enum Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Eq Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Integral Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Data Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Num Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Ord Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Read Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Real Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Show Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Ix Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Bits Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • FiniteBits Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Storable Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • PrintfArg Word8Defined in base-4.20.2.0 · Text.Printf
  • NFData Word8Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • Binary Word8Defined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable Word8Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • Prim Word8Defined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox Word8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Display Word8Defined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift Word8Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • IArray UArray Word8Defined in array-0.5.8.0 · Data.Array.Base
  • Vector Vector Word8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MVector MVector Word8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Word8 IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • MArray (STUArray s) Word8 (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • data MVector s Word8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector Word8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

Word16

datadata Word16
#

16-bit unsigned integer type

Instances29Bounded, Enum, Eq, Integral, Data, Num, …

Word32

datadata Word32
#

32-bit unsigned integer type

Instances30Bounded, Enum, Eq, Integral, Data, Num, …

Word64

datadata Word64
#

64-bit unsigned integer type

Instances30Bounded, Enum, Eq, Integral, Data, Num, …

Integer

Re-exported from Prelude.Integer:

datadata Integer
#

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.

Instances21Enum, Eq, Integral, Data, Num, Ord, …
  • Enum IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Eq IntegerDefined in ghc-bignum-1.3 · GHC.Num.Integer
  • Integral IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Data IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Num IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Num
  • Ord IntegerDefined in ghc-bignum-1.3 · GHC.Num.Integer
  • Read IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Real IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Show IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Ix IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Ix
  • Bits IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Bits
  • PrintfArg IntegerDefined in base-4.20.2.0 · Text.Printf
  • NFData IntegerDefined in deepseq-1.5.0.0 · Control.DeepSeq
  • Pretty IntegerDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Pretty IntegerDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Binary IntegerDefined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable IntegerDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • DayPeriod YearDefined in time-1.12.2 · Data.Time.Calendar.Gregorian · orphan
  • ShowPadded IntegerDefined in time-1.12.2 · Data.Time.Calendar.Private
  • Display IntegerDefined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift IntegerDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax

Natural

Re-exported from Numeric.Natural:

datadata Natural
#

Natural number

Invariant: numbers <= 0xffffffffffffffff use the NS constructor

Instances19Enum, Eq, Integral, Data, Num, Ord, …
  • Enum NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Eq NaturalDefined in ghc-bignum-1.3 · GHC.Num.Natural
  • Integral NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Data NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Num NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Num

    Note that Natural's Num instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.

  • Ord NaturalDefined in ghc-bignum-1.3 · GHC.Num.Natural
  • Read NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Real NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Show NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Ix NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Ix
  • Bits NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Bits
  • PrintfArg NaturalDefined in base-4.20.2.0 · Text.Printf
  • NFData NaturalDefined in deepseq-1.5.0.0 · Control.DeepSeq
  • Binary NaturalDefined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable NaturalDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Lift NaturalDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • TestCoercion SNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • TestEquality SNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • type Compare a b = CmpNat a bDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Ord

Rational

Re-exported from Data.Ratio:

typetype Rational = Ratio Integer
#

Arbitrary-precision rational numbers, represented as a ratio of two Integer values. A rational number may be constructed using the % operator.

Float

Re-exported from Prelude:

datadata Float
#

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.

Instances41Enum, Floating, Fractional, Data, Num, Read, …
  • Enum FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    fromEnum just truncates its argument, beware of all sorts of overflows.

    List generators have extremely peculiar behavior, mandated by Haskell Report 2010:

    Example1 expression
    [0..1.5 :: Float][0.0,1.0,2.0]
  • Eq FloatDefined in ghc-prim-0.12.0 · GHC.Classes

    Note that due to the presence of NaN, Float's Eq instance does not satisfy reflexivity.

    Example1 expression
    0/0 == (0/0 :: Float)False

    Also note that Float's Eq instance does not satisfy extensionality:

    Example2 expressions
    0 == (-0 :: Float)Truerecip 0 == recip (-0 :: Float)False
  • Floating FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float
  • Fractional FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.

    Example4 expressions
    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.Data
  • Num FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:

    Example3 expressions
    (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.Classes

    See instance Ord Double for discussion of deviations from IEEE 754 standard.

  • Read FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Real FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    Beware that toRational generates garbage for non-finite arguments:

    Example2 expressions
    toRational (1/0 :: Float)340282366920938463463374607431768211456 % 1toRational (0/0 :: Float)510423550381407695195061911147652317184 % 1
  • RealFloat FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float
  • RealFrac FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    Beware that results for non-finite arguments are garbage:

    Example2 expressions
    [ 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 · orphan
  • Storable FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • PrintfArg FloatDefined in base-4.20.2.0 · Text.Printf
  • NFData FloatDefined in deepseq-1.5.0.0 · Control.DeepSeq
  • Pretty FloatDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Pretty FloatDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Binary FloatDefined in binary-0.8.9.3 · Data.Binary.Class

    Uses non-IEEE754 encoding. Does not round-trip NaN.

  • Hashable FloatDefined in hashable-1.4.7.0 · Data.Hashable.Class

    Note: prior to hashable-1.3.0.0, hash 0.0 /= hash (-0.0)

    The hash of NaN is not well defined.

  • Prim FloatDefined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Display FloatDefined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift FloatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • IArray UArray FloatDefined in array-0.5.8.0 · Data.Array.Base
  • Vector Vector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MVector MVector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Float IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • Generic1 (URec Float)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Foldable UFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Traversable UFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable
  • MArray (STUArray s) Float (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • Functor (URec Float)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type 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.Generics
  • type 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.Generics
  • data URec FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics

    Used for marking occurrences of Float#

  • data MVector s FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

Double

Re-exported from Prelude:

datadata Double
#

Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.

Instances41Enum, Floating, Fractional, Data, Num, Read, …
  • Enum DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    fromEnum just truncates its argument, beware of all sorts of overflows.

    List generators have extremely peculiar behavior, mandated by Haskell Report 2010:

    Example1 expression
    [0..1.5][0.0,1.0,2.0]
  • Eq DoubleDefined in ghc-prim-0.12.0 · GHC.Classes

    Note that due to the presence of NaN, Double's Eq instance does not satisfy reflexivity.

    Example1 expression
    0/0 == (0/0 :: Double)False

    Also note that Double's Eq instance does not satisfy substitutivity:

    Example2 expressions
    0 == (-0 :: Double)Truerecip 0 == recip (-0 :: Double)False
  • Floating DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float
  • Fractional DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.

    Example4 expressions
    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.Data
  • Num DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:

    Example3 expressions
    (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.Classes

    IEEE 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.Read
  • Real DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    Beware that toRational generates garbage for non-finite arguments:

    Example2 expressions
    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.Float
  • RealFrac DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    Beware that results for non-finite arguments are garbage:

    Example2 expressions
    [ 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 · orphan
  • Storable DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • PrintfArg DoubleDefined in base-4.20.2.0 · Text.Printf
  • NFData DoubleDefined in deepseq-1.5.0.0 · Control.DeepSeq
  • Pretty DoubleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Pretty DoubleDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Binary DoubleDefined in binary-0.8.9.3 · Data.Binary.Class

    Uses non-IEEE754 encoding. Does not round-trip NaN.

  • Hashable DoubleDefined in hashable-1.4.7.0 · Data.Hashable.Class

    Note: prior to hashable-1.3.0.0, hash 0.0 /= hash (-0.0)

    The hash of NaN is not well defined.

  • Prim DoubleDefined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Display DoubleDefined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift DoubleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • IArray UArray DoubleDefined in array-0.5.8.0 · Data.Array.Base
  • Vector Vector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MVector MVector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Double IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • Generic1 (URec Double)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Foldable UDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Traversable UDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable
  • MArray (STUArray s) Double (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • Functor (URec Double)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type 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.Generics
  • type 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.Generics
  • data URec DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics

    Used for marking occurrences of Double#

  • data MVector s DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

Maybe

Re-exported from Data.Maybe:

datadata Maybe a
#

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.

Constructors

Instances41Monad, Functor, MonadFix, MonadFail, Applicative, Foldable, …

Either

Re-exported from Data.Either:

datadata Either a b
#

The 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").

Examples

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:

Example6 expressions
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:

Example4 expressions
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.

Example3 expressions
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.

Example2 expressions
:{    let parseMultiple :: Either String Int        parseMultiple = do          x <- parseEither '1'          y <- parseEither '2'          return (x + y):}
Example1 expression
parseMultipleRight 3

But the following should fail overall, since the first operation where we attempt to parse 'm' as an Int will fail:

Example2 expressions
:{    let parseMultiple :: Either String Int        parseMultiple = do          x <- parseEither 'm'          y <- parseEither '2'          return (x + y):}
Example1 expression
parseMultipleLeft "parse error"

Constructors

Instances43Bifoldable, Bifoldable1, Bifunctor, Bitraversable, Eq2, Ord2, …

NonEmpty

Re-exported from Data.List.NonEmpty

datadata NonEmpty a
#

Non-empty (and non-strict) list type.

Constructors

  • a :| [a]infixr 5
Instances34Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …

Proxy

Re-exported from Data.Proxy:

datadata Proxy (t :: k)
#

Proxy 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.

Example1 expression
Proxy :: Proxy (Void, Int -> Int)Proxy

Proxy can even hold types of higher kinds,

Example1 expression
Proxy :: Proxy EitherProxy
Example1 expression
Proxy :: Proxy FunctorProxy
Example1 expression
Proxy :: Proxy complicatedStructureProxy
Instances31Generic1, Monad, Functor, Applicative, Foldable, Traversable, …
  • Generic1 ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monad ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Functor ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Applicative ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Foldable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Traversable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable
  • Alternative ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • MonadPlus ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • MonadZip ProxyDefined in base-4.20.2.0 · Control.Monad.Zip
  • Eq1 ProxyDefined in base-4.20.2.0 · Data.Functor.Classes
  • Ord1 ProxyDefined in base-4.20.2.0 · Data.Functor.Classes
  • Read1 ProxyDefined in base-4.20.2.0 · Data.Functor.Classes
  • Show1 ProxyDefined in base-4.20.2.0 · Data.Functor.Classes
  • Contravariant ProxyDefined in base-4.20.2.0 · Data.Functor.Contravariant
  • NFData1 ProxyDefined in deepseq-1.5.0.0 · Control.DeepSeq
  • Hashable1 ProxyDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Bounded (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Enum (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Eq (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Data t => Data (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Ord (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Read (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Show (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Ix (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Generic (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Semigroup (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Monoid (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • NFData (Proxy a)Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • Hashable (Proxy a)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • type 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.Generics
  • type 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.Generics

Void

Re-exported from Data.Void:

datadata Void
#

Uninhabited data type

Instances14Eq, Data, Ord, Read, Show, Ix, …
  • Eq VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Data VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Ord VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Read VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Read

    Reading a Void value is always a parse error, considering Void as a data type with no constructors.

  • Show VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Ix VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Ix
  • Generic VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Semigroup VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Exception VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Type
  • NFData VoidDefined in deepseq-1.5.0.0 · Control.DeepSeq

    Defined as rnf = absurd.

  • Binary VoidDefined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable VoidDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Lift VoidDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • type Rep Void = D1 ('MetaData "Void" "GHC.Internal.Base" "ghc-internal" 'False) V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics

Const

Re-exported from Data.Functor.Const:

newtypenewtype Const a (b :: k)
#

The Const functor.

Examples
Example1 expression
fmap (++ "World") (Const "Hello")Const "Hello"

Because we ignore the second type parameter to Const, the Applicative instance, which has (<*>) :: Monoid m => Const m (a -> b) -> Const m a -> Const m b essentially turns into Monoid m => m -> m -> m, which is (<>)

Example1 expression
Const [1, 2, 3] <*> Const [4, 5, 6]Const [1,2,3,4,5,6]

Constructors

Instances54Generic1, Bifoldable, Bifoldable1, Bifunctor, Bitraversable, Eq2, …

Identity

Re-exported from Data.Functor.Identity:

newtypenewtype Identity a
#

Identity functor and monad. (a non-strict monad)

Examples
Example1 expression
fmap (+1) (Identity 0)Identity 1
Example1 expression
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

Constructors

Instances50Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …

IO

Re-exported from System.IO:

newtypenewtype IO a
#

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 >> and >>= operations from the Monad class.

Instances43Monad, Functor, MonadFix, MonadFail, Applicative, GHCiSandboxIO, …

ST

Re-exported from Control.Monad.ST:

newtypenewtype ST s a
#

The strict ST monad. The ST monad allows for destructive updates, but is escapable (unlike IO). A computation of type ST s a returns a value of type a, and execute in "thread" s. The s parameter is either

  • an uninstantiated type variable (inside invocations of runST), or

  • RealWorld (inside invocations of stToIO).

It serves to keep the internal states of different invocations of runST separate from each other and from invocations of stToIO.

The >>= and >> operations are strict in the state (though not in values stored in the state). For example,

runST (writeSTRef _|_ v >>= f) = _|_
Instances29Monad, Functor, MonadFix, Applicative, MonadThrow, PrimBase, …

Type Classes

Eq

Re-exported from Data.Eq:

classclass Eq a where
#

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

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

Reflexivity

x == x

=

True

Symmetry

x == y

=

y == x

Transitivity

if

x == y && y == z

=

True

, then

x == z

=

True

Extensionality

if

x == y

=

True

and

f

is a function whose return type is an instance of

Eq

, then

f x == f y

=

True

Negation

x /= y

=

not (x == y)

Instances417Eq, …
  • Eq AsyncCancelledDefined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Eq ByteArrayDefined in base-4.20.2.0 · Data.Array.Byte
  • Eq TimeoutDefined in base-4.20.2.0 · System.Timeout
  • Eq FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.D2S
  • Eq FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.F2S
  • Eq ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Eq ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Eq ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Eq IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Eq FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Eq PermissionsDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Eq XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Eq XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Eq BigNatDefined in ghc-bignum-1.3 · GHC.Num.BigNat
  • Eq IntegerDefined in ghc-bignum-1.3 · GHC.Num.Integer
  • Eq NaturalDefined in ghc-bignum-1.3 · GHC.Num.Natural
  • Eq ForeignSrcLangDefined in ghc-boot-th-9.10.3 · GHC.ForeignSrcLang.Type
  • Eq ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.Type
  • Eq VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Eq ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrder
  • Eq ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypes
  • Eq BlockReasonDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Eq ThreadIdDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Eq ThreadStatusDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Eq ConstrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data

    Equality of constructors

  • Eq ConstrRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Eq DataRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Eq FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Eq AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq SomeTypeRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.Internal
  • Eq UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Unique
  • Eq VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Version
  • Eq ControlMessageDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Control
  • Eq EPollFdDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPoll
  • Eq EventTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPoll
  • Eq EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Eq EventLifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Eq LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Eq FdKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Manager
  • Eq StateDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Manager
  • Eq EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Poll
  • Eq TimeoutKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimeOut
  • Eq StateDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimerManager
  • Eq UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Unique
  • Eq ErrorCallDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception
  • Eq ArithExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Type
  • Eq SpecConstrAnnotationDefined in ghc-internal-9.1003.0 · GHC.Internal.Exts
  • Eq FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Fingerprint.Type
  • Eq ErrnoDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Error
  • Eq CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Eq IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Eq WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Eq AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq MaskingStateDefined in ghc-internal-9.1003.0 · GHC.Internal.IO
  • Eq BufferStateDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Buffer
  • Eq IODeviceTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Device
  • Eq SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Device
  • Eq CodingProgressDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Encoding.Types
  • Eq ArrayExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Eq AsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Eq ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Eq IOErrorTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Eq IOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Eq HandlePosnDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle
  • Eq BufferModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Eq HandleDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Eq NewlineDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Eq NewlineModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Eq IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOMode
  • Eq InfoProvDefined in ghc-internal-9.1003.0 · GHC.Internal.InfoProv.Types
  • Eq Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Eq Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Eq Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Eq Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Eq IoSubSystemDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Eq StackEntryDefined in ghc-internal-9.1003.0 · GHC.Internal.Stack.CloneStack
  • Eq SrcLocDefined in ghc-internal-9.1003.0 · GHC.Internal.Stack.Types
  • Eq CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CTimerDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Eq LexemeDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.Read.Lex
  • Eq NumberDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.Read.Lex
  • Eq SomeCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Eq SomeSymbolDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Eq SomeNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • Eq GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.Unicode
  • Eq Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Eq Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Eq Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Eq Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Eq BoolDefined in ghc-prim-0.12.0 · GHC.Classes
  • Eq CharDefined in ghc-prim-0.12.0 · GHC.Classes
  • Eq DoubleDefined in ghc-prim-0.12.0 · GHC.Classes

    Note that due to the presence of NaN, Double's Eq instance does not satisfy reflexivity.

    Example1 expression
    0/0 == (0/0 :: Double)False

    Also note that Double's Eq instance does not satisfy substitutivity:

    Example2 expressions
    0 == (-0 :: Double)Truerecip 0 == recip (-0 :: Double)False
  • Eq FloatDefined in ghc-prim-0.12.0 · GHC.Classes

    Note that due to the presence of NaN, Float's Eq instance does not satisfy reflexivity.

    Example1 expression
    0/0 == (0/0 :: Float)False

    Also note that Float's Eq instance does not satisfy extensionality:

    Example2 expressions
    0 == (-0 :: Float)Truerecip 0 == recip (-0 :: Float)False
  • Eq IntDefined in ghc-prim-0.12.0 · GHC.Classes
  • Eq ModuleDefined in ghc-prim-0.12.0 · GHC.Classes
  • Eq OrderingDefined in ghc-prim-0.12.0 · GHC.Classes
  • Eq TrNameDefined in ghc-prim-0.12.0 · GHC.Classes
  • Eq TyConDefined in ghc-prim-0.12.0 · GHC.Classes
  • Eq WordDefined in ghc-prim-0.12.0 · GHC.Classes
  • Eq EncodingExceptionDefined in os-string-2.0.7 · System.OsString.Encoding.Internal
  • Eq OsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types

    Byte equality of the internal representation.

  • Eq OsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types

    Byte equality of the internal representation.

  • Eq PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Eq PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Eq WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Eq WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Eq ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Eq StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Eq TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Eq PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Eq DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • Eq PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Eq CmdSpecDefined in process-1.6.26.1 · System.Process.Common
  • Eq CreateProcessDefined in process-1.6.26.1 · System.Process.Common
  • Eq StdStreamDefined in process-1.6.26.1 · System.Process.Common
  • Eq CommunicationHandleDefined in process-1.6.26.1 · System.Process.CommunicationHandle.Internal
  • Eq LogLevelDefined in rio-0.1.22.0 · RIO.Prelude.Logger
  • Eq ProcessExceptionDefined in rio-0.1.22.0 · RIO.Process
  • Eq TSemDefined in stm-2.5.3.1 · Control.Concurrent.STM.TSem
  • Eq AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq UnicodeExceptionDefined in text-2.1.3 · Data.Text.Encoding.Error
  • Eq I8Defined in text-2.1.3 · Data.Text.Foreign
  • Eq TextDefined in text-2.1.3 · Data.Text · orphan
  • Eq BuilderDefined in text-2.1.3 · Data.Text.Internal.Builder
  • Eq PartialUtf8CodePointDefined in text-2.1.3 · Data.Text.Internal.Encoding
  • Eq Utf8StateDefined in text-2.1.3 · Data.Text.Internal.Encoding
  • Eq DecoderStateDefined in text-2.1.3 · Data.Text.Internal.Encoding.Utf8
  • Eq SizeDefined in text-2.1.3 · Data.Text.Internal.Fusion.Size
  • Eq TextDefined in text-2.1.3 · Data.Text.Lazy · orphan
  • Eq CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDays
  • Eq DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Eq MonthDefined in time-1.12.2 · Data.Time.Calendar.Month
  • Eq QuarterDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Eq QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Eq DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.Week
  • Eq FirstWeekTypeDefined in time-1.12.2 · Data.Time.Calendar.WeekDate
  • Eq AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.AbsoluteTime
  • Eq DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Eq NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Eq SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTime
  • Eq UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Eq UniversalTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UniversalTime
  • Eq TimeLocaleDefined in time-1.12.2 · Data.Time.Format.Locale
  • Eq CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTime
  • Eq LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTime
  • Eq TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • Eq TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZone
  • Eq DirTypeDefined in unix-2.8.7.0 · System.Posix.Directory.Common
  • Eq AdviceDefined in unix-2.8.7.0 · System.Posix.Fcntl
  • Eq CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Eq StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Eq StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Eq OpenFileFlagsDefined in unix-2.8.7.0 · System.Posix.IO.Common
  • Eq OpenModeDefined in unix-2.8.7.0 · System.Posix.IO.Common
  • Eq ProcessStatusDefined in unix-2.8.7.0 · System.Posix.Process.Internals
  • Eq ResourceDefined in unix-2.8.7.0 · System.Posix.Resource
  • Eq ResourceLimitDefined in unix-2.8.7.0 · System.Posix.Resource
  • Eq ResourceLimitsDefined in unix-2.8.7.0 · System.Posix.Resource
  • Eq BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.Common
  • Eq GroupEntryDefined in unix-2.8.7.0 · System.Posix.User.Common
  • Eq UserEntryDefined in unix-2.8.7.0 · System.Posix.User.Common
  • Eq StringExceptionDefined in unliftio-0.2.25.1 · UnliftIO.Exception
  • Eq CAtDefined in unliftio-0.2.25.1 · UnliftIO.IO.File.Posix
  • Eq CFlagDefined in unliftio-0.2.25.1 · UnliftIO.IO.File.Posix
  • Eq ConcExceptionDefined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Eq SubHashPathDefined in unordered-containers-0.2.21 · Data.HashMap.Internal.Debug
  • Eq SizeDefined in vector-0.13.2.0 · Data.Vector.Fusion.Bundle.Size
  • Eq ChecksDefined in vector-0.13.2.0 · Data.Vector.Internal.Check
  • Eq ()Defined in ghc-prim-0.12.0 · GHC.Classes
  • Eq (Async a)Defined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Eq (Chan a)Defined in base-4.20.2.0 · Control.Concurrent.Chan
  • Eq (MutableByteArray s)Defined in base-4.20.2.0 · Data.Array.Byte
  • Eq (TVar a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Eq (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.ConstPtr
  • Eq (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ForeignPtr
  • Eq (IOPort a)Defined in ghc-internal-9.1003.0 · GHC.Internal.IOPort
  • Eq (IORef a)Defined in ghc-internal-9.1003.0 · GHC.Internal.IORef

    Pointer equality.

  • Eq (MVar a)Defined in ghc-internal-9.1003.0 · GHC.Internal.MVar

    Compares the underlying pointers.

  • Eq (FunPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Ptr
  • Eq (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Ptr
  • Eq (StablePtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Stable
  • Eq (StableName a)Defined in ghc-internal-9.1003.0 · GHC.Internal.StableName
  • Eq (SChar c)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Eq (SSymbol s)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Eq (SNat n)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • Eq (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Eq (TBQueue a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TBQueue
  • Eq (TChan a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TChan
  • Eq (TMVar a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TMVar
  • Eq (TQueue a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TQueue
  • Eq (TVar a)Defined in stm-2.5.3.1 · Control.Sequential.STM
  • Eq a => Eq (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Eq a => Eq (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Eq a => Eq (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Eq a => Eq (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Eq a => Eq (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Eq a => Eq (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Eq a => Eq (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Eq a => Eq (ViewL a)Defined in containers-0.7 · Data.Sequence.Internal
  • Eq a => Eq (ViewR a)Defined in containers-0.7 · Data.Sequence.Internal
  • Eq a => Eq (Intersection a)Defined in containers-0.7 · Data.Set.Internal
  • Eq a => Eq (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Eq a => Eq (Tree a)Defined in containers-0.7 · Data.Tree
  • Eq a => Eq (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Eq a => Eq (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Eq a => Eq (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Eq a => Eq (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Eq a => Eq (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Eq a => Eq (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Eq a => Eq (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Eq a => Eq (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Eq a => Eq (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Eq a => Eq (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq a => Eq (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq a => Eq (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq a => Eq (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Eq a => Eq (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Maybe
  • Eq a => Eq (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Eq a => Eq (Hashed a)Defined in hashable-1.4.7.0 · Data.Hashable.Class

    Uses precomputed hash to detect inequality faster

  • Eq a => Eq (AnnotDetails a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Eq a => Eq (Span a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Eq a => Eq (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • Eq a => Eq (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Eq a => Eq (Stream a)Defined in text-2.1.3 · Data.Text.Internal.Fusion.Types
  • Eq a => Eq (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal

    Note that, in the presence of hash collisions, equal HashSets may behave differently, i.e. extensionality may be violated:

    Example2 expressions
    data D = A | B deriving (Eq, Show)instance Hashable D where hashWithSalt salt _d = salt
    Example2 expressions
    x = fromList [A, B]y = fromList [B, A]
    Example3 expressions
    x == yTruetoList x[A,B]toList y[B,A]

    In general, the lack of extensionality can be observed with any function that depends on the key ordering, such as folds and traversals.

  • Eq a => Eq (Vector a)Defined in vector-0.13.2.0 · Data.Vector
  • Eq a => Eq (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Strict
  • Eq a => Eq (a)Defined in ghc-prim-0.12.0 · GHC.Classes
  • Eq a => Eq [a]Defined in ghc-prim-0.12.0 · GHC.Classes
  • Eq flag => Eq (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Eq k => Eq (Error k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal.Debug
  • Eq k => Eq (Validity k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal.Debug
  • Eq m => Eq (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Eq p => Eq (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq vertex => Eq (SCC vertex)Defined in containers-0.7 · Data.Graph
  • (Storable a, Eq a) => Eq (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Storable
  • (Eq a, Prim a) => Eq (PrimArray a)Defined in primitive-0.9.1.0 · Data.Primitive.PrimArray
  • (Prim a, Eq a) => Eq (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Primitive
  • (Unbox a, Eq a) => Eq (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed · orphan
  • Eq (IOUArray i e)Defined in array-0.5.8.0 · Data.Array.IO.Internals
  • Eq (Fixed a)Defined in base-4.20.2.0 · Data.Fixed
  • Eq (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Eq (TypeRep a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.Internal
  • Eq (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (IOArray i e)Defined in ghc-internal-9.1003.0 · GHC.Internal.IOArray
  • Eq (STRef s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.STRef

    Pointer equality.

  • Eq (MutableArray s a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • Eq (MVar s a)Defined in primitive-0.9.1.0 · Data.Primitive.MVar
  • Eq (MutVar s a)Defined in primitive-0.9.1.0 · Data.Primitive.MutVar
  • Eq (MutablePrimArray s a)Defined in primitive-0.9.1.0 · Data.Primitive.PrimArray
  • Eq (PrimVar s a)Defined in primitive-0.9.1.0 · Data.Primitive.PrimVar
  • Eq (SmallMutableArray s a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • 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 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.Internal
  • (Eq k, Eq v) => Eq (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal

    Note that, in the presence of hash collisions, equal HashMaps may behave differently, i.e. extensionality may be violated:

    Example2 expressions
    data D = A | B deriving (Eq, Show)instance Hashable D where hashWithSalt salt _d = salt
    Example2 expressions
    x = fromList [(A,1), (B,2)]y = fromList [(B,2), (A,1)]
    Example3 expressions
    x == yTruetoList x[(A,1),(B,2)]toList y[(B,2),(A,1)]

    In general, the lack of extensionality can be observed with any function that depends on the key ordering, such as folds and traversals.

  • (Eq k, Eq v) => Eq (Leaf k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (GEq (Rep1 f a), Generic1 f) => Eq (FunctorClassesDefault f a)Defined in transformers-compat-0.7.2 · Data.Functor.Classes.Generic.Internal
  • Eq (STUArray s i e)Defined in array-0.5.8.0 · Data.Array.Base
  • Eq (STArray s i e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Arr
  • Eq (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Coercion
  • Eq (OrderingI a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Ord
  • Eq (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (URec (Ptr ()) p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Eq (f a) => Eq (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Eq (f a) => Eq (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq (f p) => Eq (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq a => Eq (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Eq a => Eq (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Eq a => Eq (Bundle Id v a)Defined in vector-0.13.2.0 · Data.Vector.Fusion.Bundle · orphan
  • (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 e, Eq1 m, Eq a) => Eq (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • (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.Strict
  • Eq (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Eq 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.Classes
  • Eq (f (g a)) => Eq (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Eq (f (g p)) => Eq ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Eq (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.Classes

Ord

Re-exported from Data.Ord:

classclass Eq a => Ord a where
#

The 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:

Comparability

x <= y || y <= x

=

True

Transitivity

if

x <= y && y <= z

=

True

, then

x <= z

=

True

Reflexivity

x <= x

=

True

Antisymmetry

if

x <= y && y <= x

=

True

, then

x == y

=

True

The following operator interactions are expected to hold:

  1. x >= y = y <= x

  2. x < y = x <= y && x /= y

  3. x > y = y < x

  4. x < y = compare x y == LT

  5. x > y = compare x y == GT

  6. x == y = compare x y == EQ

  7. min x y == if x <= y then x else y = True

  8. 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.

Instances312Ord, …
  • Ord ByteArrayDefined in base-4.20.2.0 · Data.Array.Byte

    Non-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.Type
  • Ord ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Ord ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal

    Lexicographic order.

  • Ord IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Ord FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Ord PermissionsDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Ord XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Ord XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Ord BigNatDefined in ghc-bignum-1.3 · GHC.Num.BigNat
  • Ord IntegerDefined in ghc-bignum-1.3 · GHC.Num.Integer
  • Ord NaturalDefined in ghc-bignum-1.3 · GHC.Num.Natural
  • Ord ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.Type
  • Ord VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Ord ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrder
  • Ord ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypes
  • Ord BlockReasonDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Ord ThreadIdDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Ord ThreadStatusDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Ord AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Ord AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Ord SomeTypeRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.Internal
  • Ord UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Unique
  • Ord VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Version
  • Ord TimeoutKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimeOut
  • Ord UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Unique
  • Ord ErrorCallDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception
  • Ord ArithExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Type
  • Ord FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Fingerprint.Type
  • Ord CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Ord IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Ord WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Ord AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Device
  • Ord ArrayExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Ord AsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Ord ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Ord BufferModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Ord NewlineDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Ord NewlineModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Ord IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOMode
  • Ord Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ord Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ord Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ord Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Ord CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CTimerDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Ord SomeCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Ord SomeSymbolDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Ord SomeNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • Ord GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.Unicode
  • Ord Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Ord Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Ord Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Ord Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Ord BoolDefined in ghc-prim-0.12.0 · GHC.Classes
  • Ord CharDefined in ghc-prim-0.12.0 · GHC.Classes
  • Ord DoubleDefined in ghc-prim-0.12.0 · GHC.Classes

    IEEE 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.Classes

    See instance Ord Double for discussion of deviations from IEEE 754 standard.

  • Ord IntDefined in ghc-prim-0.12.0 · GHC.Classes
  • Ord OrderingDefined in ghc-prim-0.12.0 · GHC.Classes
  • Ord TyConDefined in ghc-prim-0.12.0 · GHC.Classes
  • Ord WordDefined in ghc-prim-0.12.0 · GHC.Classes
  • Ord OsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types

    Byte ordering of the internal representation.

  • Ord OsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types

    Byte ordering of the internal representation.

  • Ord PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Ord PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Ord WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Ord WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Ord PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Ord PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Ord CommunicationHandleDefined in process-1.6.26.1 · System.Process.CommunicationHandle.Internal
  • Ord LogLevelDefined in rio-0.1.22.0 · RIO.Prelude.Logger
  • Ord AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord I8Defined in text-2.1.3 · Data.Text.Foreign
  • Ord TextDefined in text-2.1.3 · Data.Text · orphan
  • Ord BuilderDefined in text-2.1.3 · Data.Text.Internal.Builder
  • Ord TextDefined in text-2.1.3 · Data.Text.Lazy · orphan
  • Ord DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Ord MonthDefined in time-1.12.2 · Data.Time.Calendar.Month
  • Ord QuarterDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Ord QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Ord DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.Week
  • Ord AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.AbsoluteTime
  • Ord DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Ord NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Ord SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTime
  • Ord UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Ord UniversalTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UniversalTime
  • Ord TimeLocaleDefined in time-1.12.2 · Data.Time.Format.Locale
  • Ord LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTime
  • Ord TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • Ord TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZone
  • Ord DirTypeDefined in unix-2.8.7.0 · System.Posix.Directory.Common
  • Ord CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Ord StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Ord StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Ord OpenFileFlagsDefined in unix-2.8.7.0 · System.Posix.IO.Common
  • Ord OpenModeDefined in unix-2.8.7.0 · System.Posix.IO.Common
  • Ord ProcessStatusDefined in unix-2.8.7.0 · System.Posix.Process.Internals
  • Ord BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.Common
  • Ord ConcExceptionDefined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Ord ()Defined in ghc-prim-0.12.0 · GHC.Classes
  • Integral a => Ord (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Ord (Async a)Defined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Ord (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.ConstPtr
  • Ord (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ForeignPtr
  • Ord (FunPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Ptr
  • Ord (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Ptr
  • Ord (SChar c)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Ord (SSymbol s)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Ord (SNat n)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • Ord a => Ord (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Ord a => Ord (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Ord a => Ord (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Ord a => Ord (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Ord a => Ord (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Ord a => Ord (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Ord a => Ord (ViewL a)Defined in containers-0.7 · Data.Sequence.Internal
  • Ord a => Ord (ViewR a)Defined in containers-0.7 · Data.Sequence.Internal
  • Ord a => Ord (Intersection a)Defined in containers-0.7 · Data.Set.Internal
  • Ord a => Ord (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Ord a => Ord (Tree a)Defined in containers-0.7 · Data.Tree
  • Ord a => Ord (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Ord a => Ord (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Ord a => Ord (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Ord a => Ord (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Ord a => Ord (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Ord a => Ord (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Ord a => Ord (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Ord a => Ord (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Ord a => Ord (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Ord a => Ord (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Maybe
  • Ord a => Ord (Hashed a)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • Ord a => Ord (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.Array

    Lexicographic ordering. Subject to change between major versions.

  • Ord a => Ord (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray

    Lexicographic ordering. Subject to change between major versions.

  • Ord a => Ord (Stream a)Defined in text-2.1.3 · Data.Text.Internal.Fusion.Types
  • Ord a => Ord (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Ord a => Ord (Vector a)Defined in vector-0.13.2.0 · Data.Vector
  • Ord a => Ord (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Strict
  • Ord a => Ord (a)Defined in ghc-prim-0.12.0 · GHC.Classes
  • Ord a => Ord [a]Defined in ghc-prim-0.12.0 · GHC.Classes
  • Ord flag => Ord (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Ord m => Ord (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Ord p => Ord (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • (Storable a, Ord a) => Ord (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Storable
  • (Ord a, Prim a) => Ord (PrimArray a)Defined in primitive-0.9.1.0 · Data.Primitive.PrimArray

    Lexicographic ordering. Subject to change between major versions.

  • (Prim a, Ord a) => Ord (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Primitive
  • (Unbox a, Ord a) => Ord (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed · orphan
  • Ord (Fixed a)Defined in base-4.20.2.0 · Data.Fixed
  • Ord (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Ord (TypeRep a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.Internal
  • Ord (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord 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.Internal
  • (Ord k, Ord v) => Ord (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal

    The ordering is total and consistent with the Eq instance. However, nothing else about the ordering is specified, and it may change from version to version of either this package or of hashable.

  • (GOrd (Rep1 f a), Generic1 f) => Ord (FunctorClassesDefault f a)Defined in transformers-compat-0.7.2 · Data.Functor.Classes.Generic.Internal
  • Ord (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Coercion
  • Ord (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (URec (Ptr ()) p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Ord (f a) => Ord (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Ord (f a) => Ord (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Ord (f p) => Ord (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord a => Ord (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Ord a => Ord (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Ord a => Ord (Bundle Id v a)Defined in vector-0.13.2.0 · Data.Vector.Fusion.Bundle · orphan
  • (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.Strict
  • Ord (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Ord 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.Classes
  • Ord (f (g a)) => Ord (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Ord (f (g p)) => Ord ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Ord (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.Classes

Bounded

Re-exported from Prelude:

classclass Bounded a where
#

The 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.

Instances111Bounded, …

Enum

Re-exported from Prelude:

classclass Enum a where
#

Class 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:

   enumFrom     x   = enumFromTo     x maxBound
   enumFromThen x y = enumFromThenTo x y bound
     where
       bound | fromEnum y >= fromEnum x = maxBound
             | otherwise                = minBound
Instances124Enum, …
  • Enum FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Enum XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Enum XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Enum IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.Type
  • Enum ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrder
  • Enum ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypes
  • Enum CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Enum IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Enum WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Enum AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Enum DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Enum SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Enum SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Enum SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Device
  • Enum IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOMode
  • Enum Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Enum Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Enum Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Enum Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Enum DoCostCentresDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Enum DoHeapProfileDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Enum DoTraceDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Enum GiveGCStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Enum IoSubSystemDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Enum CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Enum GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.Unicode
  • Enum Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Enum Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Enum Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Enum Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Enum BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    fromEnum just truncates its argument, beware of all sorts of overflows.

    List generators have extremely peculiar behavior, mandated by Haskell Report 2010:

    Example1 expression
    [0..1.5][0.0,1.0,2.0]
  • Enum FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    fromEnum just truncates its argument, beware of all sorts of overflows.

    List generators have extremely peculiar behavior, mandated by Haskell Report 2010:

    Example1 expression
    [0..1.5 :: Float][0.0,1.0,2.0]
  • Enum IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum LevityDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum VecCountDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum VecElemDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum I8Defined in text-2.1.3 · Data.Text.Foreign
  • Enum FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Enum DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Enum MonthDefined in time-1.12.2 · Data.Time.Calendar.Month
  • Enum QuarterDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Enum QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.Quarter

    maps Q1..Q4 to 1..4

  • Enum DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.Week

    "Circular", so for example [Tuesday ..] gives an endless sequence. Also: fromEnum gives [1 .. 7] for [Monday .. Sunday], and toEnum performs mod 7 to give a cycle of days.

  • Enum DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Enum NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Enum StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Enum StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Enum BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.Common
  • Enum ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Enum a => Enum (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Enum a => Enum (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Enum a => Enum (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Enum a => Enum (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Enum a => Enum (WrappedMonoid a)Defined in base-4.20.2.0 · Data.Semigroup
  • Enum a => Enum (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Enum a => Enum (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Enum a => Enum (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Enum a => Enum (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Enum a => Enum (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Enum a => Enum (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Enum
  • Integral 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.Ord

    Swaps succ and pred of the underlying type.

  • Enum (Fixed a)Defined in base-4.20.2.0 · Data.Fixed

    Recall 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,

    Example1 expression
    succ (0.000 :: Milli)0.001

    and likewise

    Example1 expression
    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

    Example1 expression
    succ (0.000000000000 :: Pico)0.000000000001

    and similarly

    Example1 expression
    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.Proxy
  • Enum (f a) => Enum (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Enum (f a) => Enum (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Enum a => Enum (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Coercible a b => Enum (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Coercion
  • a ~ b => Enum (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • a ~~ b => Enum (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Enum (f (g a)) => Enum (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose

Strings

Show

Re-exported from Text.Show:

classclass Show a where
#

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 a

the 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 = 5

Note that right-associativity of :^: is ignored. For example,

  • show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)".

Instances459Show, …
  • Show AsyncCancelledDefined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Show ExceptionInLinkedThreadDefined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Show ByteArrayDefined in base-4.20.2.0 · Data.Array.Byte
  • Show TimeoutDefined in base-4.20.2.0 · System.Timeout
  • Show BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphan
  • Show FormatModeDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat
  • Show FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.D2S
  • Show FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.F2S
  • Show ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Show SizeOverflowExceptionDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Show ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Show ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Show IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Show BitQueueDefined in containers-0.7 · Utils.Containers.Internal.BitQueue
  • Show BitQueueBDefined in containers-0.7 · Utils.Containers.Internal.BitQueue
  • Show FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Show PermissionsDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Show XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Show XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Show IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show ForeignSrcLangDefined in ghc-boot-th-9.10.3 · GHC.ForeignSrcLang.Type
  • Show ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.Type
  • Show VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrder
  • Show ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypes
  • Show BlockReasonDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Show ThreadIdDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Show ThreadStatusDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Show NestedAtomicallyDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show NoMatchingContinuationPromptDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show NoMethodErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show NonTerminationDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show PatternMatchFailDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show RecConErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show RecSelErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show RecUpdErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show TypeErrorDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception.Base
  • Show ConstrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Show ConstrRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Show DataRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Show DataTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Show FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Show DynamicDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Dynamic
  • Show AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Show AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Show SomeTypeRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.Internal
  • Show VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Version
  • Show ControlMessageDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Control
  • Show EPollFdDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPoll
  • Show EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPoll
  • Show EventTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPoll
  • Show EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Show EventLifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Show LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Show TimeoutDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Show FdKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Manager
  • Show StateDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Manager
  • Show EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Poll
  • Show PollFdDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Poll
  • Show StateDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.TimerManager
  • Show UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Unique
  • Show ErrorCallDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception
  • Show ArithExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Type
  • Show SomeExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Type
  • Show FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Fingerprint.Type
  • Show CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Show IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Show WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Show AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show MaskingStateDefined in ghc-internal-9.1003.0 · GHC.Internal.IO
  • Show SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Device
  • Show CodingFailureModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Encoding.Failure
  • Show CodingProgressDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Encoding.Types
  • Show TextEncodingDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Encoding.Types
  • Show AllocationLimitExceededDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show ArrayExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show AssertionFailedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show AsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show BlockedIndefinitelyOnMVarDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show BlockedIndefinitelyOnSTMDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show CompactionFailedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show DeadlockDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show FixIOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show IOErrorTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show IOExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show SomeAsyncExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Show FDDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.FD
  • Show HandlePosnDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle
  • Show FileLockingNotSupportedDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Lock.Common
  • Show BufferModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Show HandleDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Show HandleTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Show NewlineDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Show NewlineModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Show IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOMode
  • Show IOPortExceptionDefined in ghc-internal-9.1003.0 · GHC.Internal.IOPort
  • Show InfoProvDefined in ghc-internal-9.1003.0 · GHC.Internal.InfoProv.Types
  • Show Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Show Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Show Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Show Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Show CCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show ConcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show DebugFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show DoCostCentresDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show DoHeapProfileDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show DoTraceDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show GCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show GiveGCStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show HpcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show IoSubSystemDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show MiscFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show ParFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show ProfFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show RTSFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show TickyFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show TraceFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Show FractionalExponentBaseDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Show StackEntryDefined in ghc-internal-9.1003.0 · GHC.Internal.Stack.CloneStack
  • Show CallStackDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show SrcLocDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show StaticPtrInfoDefined in ghc-internal-9.1003.0 · GHC.Internal.StaticPtr
  • Show GCDetailsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Show RTSStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Show CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CTimerDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Show LexemeDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.Read.Lex
  • Show NumberDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.Read.Lex
  • Show SomeCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Show SomeSymbolDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Show SomeNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • Show GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.Unicode
  • Show Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Show Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Show Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Show Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Show BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan
  • Show FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan
  • Show IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show KindRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show LevityDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show ModuleDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show RuntimeRepDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show TrNameDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show TyConDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show TypeLitSortDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show VecCountDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show VecElemDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show EncodingExceptionDefined in os-string-2.0.7 · System.OsString.Encoding.Internal
  • Show OsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Show OsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types

    On windows, decodes as UCS-2. On unix prints the raw bytes without decoding.

  • Show PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Show PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.Types

    Prints the raw bytes without decoding.

  • Show WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Show WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types

    Decodes as UCS-2.

  • Show ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Show DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • Show PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Show CmdSpecDefined in process-1.6.26.1 · System.Process.Common
  • Show CreateProcessDefined in process-1.6.26.1 · System.Process.Common
  • Show StdStreamDefined in process-1.6.26.1 · System.Process.Common
  • Show CommunicationHandleDefined in process-1.6.26.1 · System.Process.CommunicationHandle.Internal
  • Show LogLevelDefined in rio-0.1.22.0 · RIO.Prelude.Logger
  • Show ProcessExceptionDefined in rio-0.1.22.0 · RIO.Process
  • Show AsyncExceptionWrapperDefined in safe-exceptions-0.1.7.4 · Control.Exception.Safe
  • Show StringExceptionDefined in safe-exceptions-0.1.7.4 · Control.Exception.Safe
  • Show SyncExceptionWrapperDefined in safe-exceptions-0.1.7.4 · Control.Exception.Safe
  • Show ForallVisFlagDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Ppr
  • Show DocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.PprLib
  • Show AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show DecodingDefined in text-2.1.3 · Data.Text.Encoding
  • Show UnicodeExceptionDefined in text-2.1.3 · Data.Text.Encoding.Error
  • Show I8Defined in text-2.1.3 · Data.Text.Foreign
  • Show TextDefined in text-2.1.3 · Data.Text.Show · orphan
  • Show BuilderDefined in text-2.1.3 · Data.Text.Internal.Builder
  • Show PartialUtf8CodePointDefined in text-2.1.3 · Data.Text.Internal.Encoding
  • Show Utf8StateDefined in text-2.1.3 · Data.Text.Internal.Encoding
  • Show DecoderStateDefined in text-2.1.3 · Data.Text.Internal.Encoding.Utf8
  • Show SizeDefined in text-2.1.3 · Data.Text.Internal.Fusion.Size
  • Show TextDefined in text-2.1.3 · Data.Text.Lazy · orphan
  • Show FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Show IterDefined in text-2.1.3 · Data.Text.Unsafe
  • Show CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDays
  • Show DayDefined in time-1.12.2 · Data.Time.Calendar.Gregorian · orphan
  • Show MonthDefined in time-1.12.2 · Data.Time.Calendar.Month

    Show as yyyy-mm.

  • Show QuarterDefined in time-1.12.2 · Data.Time.Calendar.Quarter

    Show as yyyy-Qn.

  • Show QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Show DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.Week
  • Show AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.TAI · orphan
  • Show DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Show NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Show SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTime
  • Show UTCTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTime · orphan
  • Show UniversalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTime · orphan
  • Show TimeLocaleDefined in time-1.12.2 · Data.Time.Format.Locale
  • Show CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTime
  • Show LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTime
  • Show TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • Show TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZone

    This only shows the time zone name, or offset if the name is empty.

  • Show ZonedTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTime

    For the time zone, this only shows the name, or offset if the name is empty.

  • Show ByteStringOutputExceptionDefined in typed-process-0.2.13.0 · System.Process.Typed.Internal
  • Show ExitCodeExceptionDefined in typed-process-0.2.13.0 · System.Process.Typed.Internal
  • Show DirTypeDefined in unix-2.8.7.0 · System.Posix.Directory.Common
  • Show DLDefined in unix-2.8.7.0 · System.Posix.DynamicLinker.Prim
  • Show RTLDFlagsDefined in unix-2.8.7.0 · System.Posix.DynamicLinker.Prim
  • Show CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Show StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Show StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Show OpenFileFlagsDefined in unix-2.8.7.0 · System.Posix.IO.Common
  • Show OpenModeDefined in unix-2.8.7.0 · System.Posix.IO.Common
  • Show ProcessStatusDefined in unix-2.8.7.0 · System.Posix.Process.Internals
  • Show ResourceDefined in unix-2.8.7.0 · System.Posix.Resource
  • Show ResourceLimitDefined in unix-2.8.7.0 · System.Posix.Resource
  • Show ResourceLimitsDefined in unix-2.8.7.0 · System.Posix.Resource
  • Show BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.Common
  • Show GroupEntryDefined in unix-2.8.7.0 · System.Posix.User.Common
  • Show UserEntryDefined in unix-2.8.7.0 · System.Posix.User.Common
  • Show StringExceptionDefined in unliftio-0.2.25.1 · UnliftIO.Exception
  • Show CAtDefined in unliftio-0.2.25.1 · UnliftIO.IO.File.Posix
  • Show CFlagDefined in unliftio-0.2.25.1 · UnliftIO.IO.File.Posix
  • Show ConcExceptionDefined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Show SubHashPathDefined in unordered-containers-0.2.21 · Data.HashMap.Internal.Debug
  • Show SizeDefined in vector-0.13.2.0 · Data.Vector.Fusion.Bundle.Size
  • Show ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.ConstPtr
  • Show (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ForeignPtr
  • Show (FunPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Ptr
  • Show (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Ptr
  • Show (SChar c)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Show (SSymbol s)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Show (SNat n)Defined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • Show (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show (Memoized a)Defined in unliftio-0.2.25.1 · UnliftIO.Memoize
  • Show a => Show (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Show a => Show (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Show a => Show (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Show a => Show (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Show a => Show (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Show a => Show (Decoder a)Defined in binary-0.8.9.3 · Data.Binary.Get.Internal
  • Show a => Show (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Show a => Show (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Show a => Show (ViewL a)Defined in containers-0.7 · Data.Sequence.Internal
  • Show a => Show (ViewR a)Defined in containers-0.7 · Data.Sequence.Internal
  • Show a => Show (Intersection a)Defined in containers-0.7 · Data.Set.Internal
  • Show a => Show (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Show a => Show (Tree a)Defined in containers-0.7 · Data.Tree
  • Show a => Show (ExitCase a)Defined in exceptions-0.10.9 · Control.Monad.Catch
  • Show a => Show (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show a => Show (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Show a => Show (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Show a => Show (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Show a => Show (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Show a => Show (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity

    This 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.Monoid
  • Show a => Show (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Show a => Show (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord

    This instance would be equivalent to the derived instances of the Down newtype if the getDown field were removed

  • Show a => Show (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Show a => Show (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Show a => Show (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Show a => Show (ExceptionWithContext a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Type
  • Show a => Show (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Show a => Show (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show a => Show (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Show a => Show (Hashed a)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • Show a => Show (AnnotDetails a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show a => Show (Span a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show a => Show (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • Show a => Show (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Show a => Show (Array a)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal.Array
  • Show a => Show (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Show a => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector
  • Show a => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Strict
  • Show a => Show (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show a => Show [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Show
  • Show e => Show (NoBacktrace e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Type
  • Show flag => Show (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Show k => Show (Error k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal.Debug
  • Show k => Show (Validity k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal.Debug
  • Show m => Show (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Show p => Show (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show vertex => Show (SCC vertex)Defined in containers-0.7 · Data.Graph
  • (Show a, Storable a) => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Storable
  • (Show a, Prim a) => Show (PrimArray a)Defined in primitive-0.9.1.0 · Data.Primitive.PrimArray
  • (Show a, Prim a) => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Primitive
  • (Show a, Unbox a) => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed · orphan
  • HasResolution a => Show (Fixed a)Defined in base-4.20.2.0 · Data.Fixed
  • Show (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Show (TypeRep a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Typeable.Internal
  • Show (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (ST s a)Defined in ghc-internal-9.1003.0 · GHC.Internal.ST
  • Show (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 k, Show a) => Show (Map k a)Defined in containers-0.7 · Data.Map.Internal
  • (Show k, Show v) => Show (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (GShow (Rep1 f a), Generic1 f) => Show (FunctorClassesDefault f a)Defined in transformers-compat-0.7.2 · Data.Functor.Classes.Generic.Internal
  • Show (Coercion a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Coercion
  • Show (OrderingI a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Ord
  • Show (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (Process stdin stdout stderr)Defined in typed-process-0.2.13.0 · System.Process.Typed
  • Show (ProcessConfig stdin stdout stderr)Defined in typed-process-0.2.13.0 · System.Process.Typed.Internal
  • Show (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Show (f a) => Show (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Show (f a) => Show (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Show (f p) => Show (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show a => Show (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const

    This instance would be equivalent to the derived instances of the Const newtype if the getConst field were removed

  • Show 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 e, Show1 m, Show a) => Show (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • (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.Strict
  • Show (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Show 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.Show
  • Show (f (g a)) => Show (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Show (f (g p)) => Show ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Show (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.Show

Read

Re-exported from Text.Read:

classclass Read a where
#

Parsing 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 a

the 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 = 5

Note 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 = readListPrecDefault

Why 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
Instances215Read, …
  • Read ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Read ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Read ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Read IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Read FileTypeDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Read PermissionsDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Read XdgDirectoryDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Read XdgDirectoryListDefined in directory-1.3.8.5 · System.Directory.Internal.Common
  • Read IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Read

    Reading a Void value is always a parse error, considering Void as a data type with no constructors.

  • Read ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrder
  • Read AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Read AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Read VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Version
  • Read CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Read IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Read WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Read AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read SeekModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Device
  • Read ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Read BufferModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Read NewlineDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Read NewlineModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Types
  • Read IOModeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.IOMode
  • Read Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Read Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Read Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Read Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Read GCDetailsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Read RTSStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Read CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Read LexemeDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read SomeCharDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Read SomeSymbolDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeLits
  • Read SomeNatDefined in ghc-internal-9.1003.0 · GHC.Internal.TypeNats
  • Read GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read CommunicationHandleDefined in process-1.6.26.1 · System.Process.CommunicationHandle.Internal
  • Read LogLevelDefined in rio-0.1.22.0 · RIO.Prelude.Logger
  • Read I8Defined in text-2.1.3 · Data.Text.Foreign
  • Read TextDefined in text-2.1.3 · Data.Text · orphan
  • Read TextDefined in text-2.1.3 · Data.Text.Lazy · orphan
  • Read FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Read DayDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Read MonthDefined in time-1.12.2 · Data.Time.Calendar.Month

    Read as yyyy-mm.

  • Read QuarterDefined in time-1.12.2 · Data.Time.Calendar.Quarter

    Read as yyyy-Qn.

  • Read QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Read DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.Week
  • Read DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Read NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Read UTCTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Read UniversalTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Read LocalTimeDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Read TimeOfDayDefined in time-1.12.2 · Data.Time.Format.Parse · orphan
  • Read TimeZoneDefined in time-1.12.2 · Data.Time.Format.Parse · orphan

    This 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 · orphan

    This 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.Prim
  • Read CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Read StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Read StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Read OpenFileFlagsDefined in unix-2.8.7.0 · System.Posix.IO.Common
  • Read OpenModeDefined in unix-2.8.7.0 · System.Posix.IO.Common
  • Read GroupEntryDefined in unix-2.8.7.0 · System.Posix.User.Common
  • Read UserEntryDefined in unix-2.8.7.0 · System.Posix.User.Common
  • Read ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read a => Read (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Read a => Read (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Read a => Read (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Read a => Read (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Read a => Read (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Read a => Read (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Read a => Read (ViewL a)Defined in containers-0.7 · Data.Sequence.Internal
  • Read a => Read (ViewR a)Defined in containers-0.7 · Data.Sequence.Internal
  • Read a => Read (Tree a)Defined in containers-0.7 · Data.Tree
  • Read a => Read (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read a => Read (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Read a => Read (Iff a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Read a => Read (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Read a => Read (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Read a => Read (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity

    This 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.Monoid
  • Read a => Read (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Read a => Read (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord

    This instance would be equivalent to the derived instances of the Down newtype if the getDown field were removed

  • Read a => Read (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Read a => Read (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Read a => Read (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Read a => Read (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Read a => Read (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read a => Read (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • Read a => Read (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Read a => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector
  • Read a => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Strict
  • Read a => Read (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read a => Read [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • Read e => Read (IntMap e)Defined in containers-0.7 · Data.IntMap.Internal
  • Read m => Read (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Read p => Read (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read vertex => Read (SCC vertex)Defined in containers-0.7 · Data.Graph
  • (Read a, Storable a) => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Storable
  • (Read a, Ord a) => Read (Set a)Defined in containers-0.7 · Data.Set.Internal
  • (Read a, Prim a) => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Primitive
  • (Read a, Unbox a) => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed · orphan
  • (Integral a, Read a) => Read (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Read
  • (Hashable a, Read a) => Read (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • HasResolution a => Read (Fixed a)Defined in base-4.20.2.0 · Data.Fixed
  • Read (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Read (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read (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.Internal
  • (Hashable k, Read k, Read e) => Read (HashMap k e)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (GRead (Rep1 f a), Generic1 f) => Read (FunctorClassesDefault f a)Defined in transformers-compat-0.7.2 · Data.Functor.Classes.Generic.Internal
  • Read (f a) => Read (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Read (f a) => Read (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Read (f p) => Read (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read a => Read (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const

    This instance would be equivalent to the derived instances of the Const newtype if the getConst field were removed

  • Read a => Read (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Coercible 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.Strict
  • a ~ b => Read (a :~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Read 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.Read
  • a ~~ b => Read (a :~~: b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Type.Equality
  • Read (f (g a)) => Read (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Read (f (g p)) => Read ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Read (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.Read

IsString

Re-exported from Data.String:

classclass IsString a where
#

IsString 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.

Instances18IsString, …
  • IsString BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphan
  • IsString ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type

    Beware: 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.Internal

    Beware: 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.Internal

    Beware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�

  • IsString DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • IsString CmdSpecDefined in process-1.6.26.1 · System.Process.Common

    construct a ShellCommand from a string literal

  • IsString Utf8BuilderDefined in rio-0.1.22.0 · RIO.Prelude.Display
  • IsString TextDefined in text-2.1.3 · Data.Text · orphan

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedStrings"\55555" :: Text"\65533"
  • IsString BuilderDefined in text-2.1.3 · Data.Text.Internal.Builder

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedStrings"\55555" :: Builder"\65533"
  • IsString TextDefined in text-2.1.3 · Data.Text.Lazy · orphan

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedStrings"\55555" :: Data.Text.Lazy.Text"\65533"
  • IsString (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • IsString a => IsString (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.String
  • (IsString a, Hashable a) => IsString (Hashed a)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • a ~ Char => IsString (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • a ~ Char => IsString [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.String

    (a ~ Char) context was introduced in 4.9.0.0

  • (streamType ~ 'STInput, res ~ ()) => IsString (StreamSpec streamType res)Defined in typed-process-0.2.13.0 · System.Process.Typed.Internal

    This instance uses byteStringInput to convert a raw string into a stream of input for a child process.

  • IsString a => IsString (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.String
  • (stdin ~ (), stdout ~ (), stderr ~ ()) => IsString (ProcessConfig stdin stdout stderr)Defined in typed-process-0.2.13.0 · System.Process.Typed.Internal

Numeric

All numeric classes are re-exported from Prelude:

Num

classclass Num a where
#

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:

Associativity of (+)

(x + y) + z

=

x + (y + z)

Commutativity of (+)

x + y

=

y + x

fromInteger 0 is the additive identity

x + fromInteger 0

=

x

negate gives the additive inverse

x + negate x

=

fromInteger 0

Associativity of (*)

(x * y) * z

=

x * (y * z)

fromInteger 1 is the multiplicative identity

x * fromInteger 1

=

x

and

fromInteger 1 * x

=

x

Distributivity of (*) with respect to (+)

a * (b + c)

=

(a * b) + (a * c)

and

(b + c) * a

=

(b * a) + (c * a)

Coherence with toInteger

if the type also implements

GHC.Real.Integral

, then

fromInteger

is a left inverse for

toInteger

, 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.

Instances91Num, …
  • Num IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Num
  • Num NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Num

    Note that Natural's Num instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.

  • Num EventTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPoll
  • Num EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Poll
  • Num UniqueDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Unique
  • Num CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Num IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Num WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Num Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Num Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Num Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Num Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Num CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Num Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Num Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Num Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Num Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Num DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:

    Example3 expressions
    (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 · orphan

    This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:

    Example3 expressions
    (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.Num
  • Num WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Num
  • Num I8Defined in text-2.1.3 · Data.Text.Foreign
  • Num SizeDefined in text-2.1.3 · Data.Text.Internal.Fusion.Size
  • Num DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Num NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Num CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Num StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Num StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Num BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.Common
  • Num SizeDefined in vector-0.13.2.0 · Data.Vector.Fusion.Bundle.Size
  • RealFloat a => Num (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Num a => Num (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Num a => Num (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Num a => Num (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Num a => Num (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Num a => Num (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Num a => Num (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Integral a => Num (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • HasResolution a => Num (Fixed a)Defined in base-4.20.2.0 · Data.Fixed

    Multiplication is not associative or distributive:

    Example1 expression
    (0.2 * 0.6 :: Deci) * 0.9 == 0.2 * (0.6 * 0.9)False
    Example1 expression
    (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.Contravariant
  • Num (f a) => Num (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Num 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.Monoid

    Note 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:

    Example2 expressions
    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:

    Example2 expressions
    Ap [] + negate (Ap [])Ap {getAp = []}fromInteger 0 :: Ap [] IntAp {getAp = [0]}

    Distributivity:

    Example2 expressions
    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.Compose

Fractional

classclass Num a => Fractional a where
#

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:

recip gives the multiplicative inverse

x * recip x

=

recip x * x

=

fromInteger 1

Totality of toRational

toRational

is total

Coherence with toRational

if the type also implements

Real

, then

fromRational

is a left inverse for

toRational

, 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.

Instances14Fractional, …
  • Fractional CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Fractional CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Fractional DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.

    Example4 expressions
    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 · orphan

    This instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero.

    Example4 expressions
    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.DiffTime
  • Fractional NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • RealFloat a => Fractional (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Fractional a => Fractional (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Fractional a => Fractional (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Integral a => Fractional (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • HasResolution a => Fractional (Fixed a)Defined in base-4.20.2.0 · Data.Fixed
  • Fractional a => Fractional (Op a b)Defined in base-4.20.2.0 · Data.Functor.Contravariant
  • Fractional a => Fractional (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Fractional (f (g a)) => Fractional (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose

Floating

classclass Fractional a => Floating a where
#

Trigonometric and hyperbolic functions and related functions.

The Haskell Report defines no laws for Floating. However, (+), (*) and exp are customarily expected to define an exponential field and have the following properties:

  • exp (a + b) = exp a * exp b

  • exp (fromInteger 0) = fromInteger 1

Instances10Floating, …

Real

classclass (Num a, Ord a) => Real a where
#

Real numbers.

The Haskell report defines no laws for Real, however Real instances are customarily expected to adhere to the following law:

Coherence with fromRational

if the type also implements

Fractional

, then

fromRational

is a left inverse for

toRational

, 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.

Instances77Real, …
  • Real IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Real NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Real CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Real IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Real WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Real Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Real Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Real Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Real Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Real CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Real Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Real Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Real Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Real Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Real DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    Beware that toRational generates garbage for non-finite arguments:

    Example2 expressions
    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 · orphan

    Beware that toRational generates garbage for non-finite arguments:

    Example2 expressions
    toRational (1/0 :: Float)340282366920938463463374607431768211456 % 1toRational (0/0 :: Float)510423550381407695195061911147652317184 % 1
  • Real IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Real WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Real I8Defined in text-2.1.3 · Data.Text.Foreign
  • Real DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Real NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Real StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Real StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Real BaudRateDefined in unix-2.8.7.0 · System.Posix.Terminal.Common
  • Integral a => Real (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Real a => Real (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Real a => Real (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • HasResolution a => Real (Fixed a)Defined in base-4.20.2.0 · Data.Fixed
  • Real a => Real (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Real (f (g a)) => Real (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose

Integral

classclass (Real a, Enum a) => Integral a where
#

Integral 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.

Instances61Integral, …
  • Integral IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Integral NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Integral CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Integral IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Integral WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Integral Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Integral Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Integral Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Integral Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Int
  • Integral CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Integral Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Integral Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Integral Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Integral Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Word
  • Integral IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Integral WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • Integral I8Defined in text-2.1.3 · Data.Text.Foreign
  • Integral StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Integral StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Integral a => Integral (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Integral a => Integral (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Integral (f (g a)) => Integral (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose

RealFrac

classclass (Real a, Fractional a) => RealFrac a where
#

Extracting components of fractions.

Instances12RealFrac, …
  • RealFrac CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • RealFrac CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • RealFrac DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Float · orphan

    Beware that results for non-finite arguments are garbage:

    Example2 expressions
    [ 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 · orphan

    Beware that results for non-finite arguments are garbage:

    Example2 expressions
    [ 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.DiffTime
  • RealFrac NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Integral a => RealFrac (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Real
  • RealFrac a => RealFrac (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • RealFrac a => RealFrac (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • HasResolution a => RealFrac (Fixed a)Defined in base-4.20.2.0 · Data.Fixed
  • RealFrac a => RealFrac (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • RealFrac (f (g a)) => RealFrac (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose

RealFloat

classclass (RealFrac a, Floating a) => RealFloat a where
#

Efficient, machine-independent access to the components of a floating-point number.

Instances8RealFloat, …

Categories

Functor

Re-exported from Data.Functor:

classclass Functor (f :: Type -> Type) where
#

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:

Identity

fmap id == id

Composition

fmap (f . g) == fmap f . fmap g

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.

Instances152Functor, …
  • Functor AsyncDefined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Functor ConcurrentlyDefined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Functor ComplexDefined in base-4.20.2.0 · Data.Complex
  • Functor FirstDefined in base-4.20.2.0 · Data.Semigroup
  • Functor LastDefined in base-4.20.2.0 · Data.Semigroup
  • Functor MaxDefined in base-4.20.2.0 · Data.Semigroup
  • Functor MinDefined in base-4.20.2.0 · Data.Semigroup
  • Functor ArgDescrDefined in base-4.20.2.0 · System.Console.GetOpt
  • Functor ArgOrderDefined in base-4.20.2.0 · System.Console.GetOpt
  • Functor OptDescrDefined in base-4.20.2.0 · System.Console.GetOpt
  • Functor DecoderDefined in binary-0.8.9.3 · Data.Binary.Get.Internal
  • Functor GetDefined in binary-0.8.9.3 · Data.Binary.Get.Internal
  • Functor PutMDefined in binary-0.8.9.3 · Data.Binary.Put
  • Functor PutDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internal
  • Functor SCCDefined in containers-0.7 · Data.Graph
  • Functor IntMapDefined in containers-0.7 · Data.IntMap.Internal
  • Functor DigitDefined in containers-0.7 · Data.Sequence.Internal
  • Functor ElemDefined in containers-0.7 · Data.Sequence.Internal
  • Functor FingerTreeDefined in containers-0.7 · Data.Sequence.Internal
  • Functor NodeDefined in containers-0.7 · Data.Sequence.Internal
  • Functor SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Functor ViewLDefined in containers-0.7 · Data.Sequence.Internal
  • Functor ViewRDefined in containers-0.7 · Data.Sequence.Internal
  • Functor TreeDefined in containers-0.7 · Data.Tree
  • Functor NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor STMDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Functor HandlerDefined in ghc-internal-9.1003.0 · GHC.Internal.Control.Exception
  • Functor IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Functor FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Functor LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Functor DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Functor DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Functor ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Functor SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Functor ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Functor NoIODefined in ghc-internal-9.1003.0 · GHC.Internal.GHCi
  • Functor Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor PDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadP
  • Functor ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadP
  • Functor ReadPrecDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPrec
  • Functor SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor IODefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor AnnotDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Functor DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Functor SpanDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Functor ArrayDefined in primitive-0.9.1.0 · Data.Primitive.Array
  • Functor SmallArrayDefined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Functor STMDefined in stm-2.5.3.1 · Control.Sequential.STM
  • Functor PprMDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.PprLib
  • Functor QDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Functor TyVarBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Functor CleanupDefined in typed-process-0.2.13.0 · System.Process.Typed.Internal
  • Functor FlatDefined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Functor FlatAppDefined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Functor MemoizedDefined in unliftio-0.2.25.1 · UnliftIO.Memoize
  • Functor VectorDefined in vector-0.13.2.0 · Data.Vector
  • Functor IdDefined in vector-0.13.2.0 · Data.Vector.Fusion.Util
  • Functor VectorDefined in vector-0.13.2.0 · Data.Vector.Strict
  • Functor BoxDefined in vector-stream-0.1.0.1 · Data.Stream.Monadic
  • Functor []Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Functor U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor (ConcurrentlyE e)Defined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Functor (Arg a)Defined in base-4.20.2.0 · Data.Semigroup
  • Functor (SetM s)Defined in containers-0.7 · Data.Graph
  • Functor (Map k)Defined in containers-0.7 · Data.Map.Internal
  • Functor (State s)Defined in containers-0.7 · Utils.Containers.Internal.State
  • Functor (Array i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Arr
  • Functor (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.Imp
  • Functor (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either
  • Functor (StateL s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils
  • Functor (StateR s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils
  • Functor (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.ST
  • Functor (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor (RIO env)Defined in rio-0.1.22.0 · RIO.Prelude.RIO
  • Functor (IParser t)Defined in text-2.1.3 · Data.Text.Internal.Read
  • Functor (StreamSpec streamType)Defined in typed-process-0.2.13.0 · System.Process.Typed.Internal
  • Functor (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Functor (Step s)Defined in vector-stream-0.1.0.1 · Data.Stream.Monadic
  • Functor f => Functor (Lift f)Defined in transformers-0.6.1.1 · Control.Applicative.Lift
  • Functor m => Functor (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe
  • Functor m => Functor (Conc m)Defined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Monad m => Functor (WrappedMonad m)Defined in base-4.20.2.0 · Control.Applicative
  • Monad m => Functor (Handler m)Defined in exceptions-0.10.9 · Control.Monad.Catch
  • Monad m => Functor (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.Pure
  • Monad m => Functor (Concurrently m)Defined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Monad m => Functor (Stream m)Defined in vector-stream-0.1.0.1 · Data.Stream.Monadic
  • Arrow a => Functor (ArrowMonad a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Functor (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Functor (URec Char)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor (URec Double)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor (URec Float)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor (URec Int)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor (URec Word)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor (URec (Ptr ()))Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor (Tuple3 a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor (Bazaar a b)Defined in microlens-0.4.14.0 · Lens.Micro
  • Functor (Effect m r)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Functor (Constant a)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Functor (k (May s)) => Functor (FocusingMay k s)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Functor (t m) => Functor (LiftingAccum t m)Defined in mtl-2.3.1 · Control.Monad.Accum
  • Functor (t m) => Functor (LiftingSelect t m)Defined in mtl-2.3.1 · Control.Monad.Select
  • Functor f => Functor (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Functor f => Functor (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Functor f => Functor (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor f => Functor (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards

    Derived instance.

  • Functor f => Functor (Reverse f)Defined in transformers-0.6.1.1 · Data.Functor.Reverse

    Derived instance.

  • Functor m => Functor (Kleisli m a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Functor m => Functor (StateT s m)Defined in microlens-0.4.14.0 · Lens.Micro
  • Functor m => Functor (AccumT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum
  • Functor m => Functor (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • Functor m => Functor (IdentityT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity
  • Functor m => Functor (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Reader
  • Functor m => Functor (SelectT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Select
  • Functor m => Functor (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Lazy
  • Functor m => Functor (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Strict
  • Functor m => Functor (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPS
  • Functor m => Functor (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy
  • Functor m => Functor (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Strict
  • Monad m => Functor (StateT s m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils
  • Monad m => Functor (Focusing m s)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Monad m => Functor (Bundle m v)Defined in vector-0.13.2.0 · Data.Vector.Fusion.Bundle.Monadic
  • Arrow 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.Generics
  • Functor (K1 i c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor (Tuple4 a b c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor (ContT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Cont
  • Functor ((->) r)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor (k (Err e s)) => Functor (FocusingErr e k s)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Functor (k (f s)) => Functor (FocusingOn f k s)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Functor (k (s, w)) => Functor (FocusingPlus w k s)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Functor f => Functor (WhenMatched f x y)Defined in containers-0.7 · Data.IntMap.Internal
  • Monad m => Functor (FocusingWith w m s)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.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.Generics
  • Functor (Tuple5 a b c d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor (EffectRWS w st m s)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Functor f => Functor (WhenMatched f k x y)Defined in containers-0.7 · Data.Map.Internal
  • Functor f => Functor (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Functor m => Functor (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS
  • Functor m => Functor (RWST r w s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy
  • Functor 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.Generics
  • Functor (Tuple6 a b c d e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Functor (Tuple7 a b c d e f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base

Bifunctor

Re-exported from Data.Bifunctor:

classclass (forall a. Functor (p a)) => Bifunctor (p :: Type -> Type -> Type) where
#

A bifunctor is a type constructor that takes two type arguments and is a functor in both arguments. That is, unlike with Functor, a type constructor such as Either does not need to be partially applied for a Bifunctor instance, and the methods in this class permit mapping functions over the Left value or the Right value, or both at the same time.

Formally, the class Bifunctor represents a bifunctor from Hask -> Hask.

Intuitively it is a bifunctor where both the first and second arguments are covariant.

The class definition of a Bifunctor p uses the QuantifiedConstraints language extension to quantify over the first type argument a in its context. The context requires that p a must be a Functor for all a. In other words a partially applied Bifunctor must be a Functor. This makes Functor a superclass of Bifunctor such that a function with a Bifunctor constraint may use fmap in its implementation. Functor has been a quantified superclass of Bifunctor since base-4.18.0.0.

You can define a Bifunctor by either defining bimap or by defining both first and second. The second method must agree with fmap:

second ≡ fmap

From this it follows that:

second id ≡ id

If you supply bimap, you should ensure that:

bimap id id ≡ id

If you supply first and second, ensure:

first id ≡ id
second id ≡ id

If you supply both, you should also ensure:

bimap f g ≡ first f . second g

These ensure by parametricity:

bimap  (f . g) (h . i) ≡ bimap f h . bimap g i
first  (f . g) ≡ first  f . first  g
second (f . g) ≡ second f . second g
Instances12Bifunctor, …
  • Bifunctor ConcurrentlyEDefined in async-2.2.5 · Control.Concurrent.Async.Internal
  • Bifunctor ArgDefined in base-4.20.2.0 · Data.Semigroup
  • Bifunctor EitherDefined in base-4.20.2.0 · Data.Bifunctor
  • Bifunctor Tuple2Defined in base-4.20.2.0 · Data.Bifunctor

    Class laws for tuples hold only up to laziness. Both first id and second id are lazier than id (and fmap id):

    Example3 expressions
    first id (undefined :: (Int, Word)) `seq` ()()second id (undefined :: (Int, Word)) `seq` ()()id (undefined :: (Int, Word)) `seq` ()*** Exception: Prelude.undefined
  • Bifunctor ConstDefined in base-4.20.2.0 · Data.Bifunctor
  • Bifunctor ConstantDefined in transformers-0.6.1.1 · Data.Functor.Constant
  • Bifunctor (Tuple3 x1)Defined in base-4.20.2.0 · Data.Bifunctor
  • Bifunctor (K1 i)Defined in base-4.20.2.0 · Data.Bifunctor
  • Bifunctor (Tuple4 x1 x2)Defined in base-4.20.2.0 · Data.Bifunctor
  • Bifunctor (Tuple5 x1 x2 x3)Defined in base-4.20.2.0 · Data.Bifunctor
  • Bifunctor (Tuple6 x1 x2 x3 x4)Defined in base-4.20.2.0 · Data.Bifunctor
  • Bifunctor (Tuple7 x1 x2 x3 x4 x5)Defined in base-4.20.2.0 · Data.Bifunctor

Foldable

Re-exported from Data.Foldable:

classclass Foldable (t :: Type -> Type) where
#

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 Foldable

A 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.

Instances74Foldable, …
  • Foldable ComplexDefined in base-4.20.2.0 · Data.Complex
  • Foldable FirstDefined in base-4.20.2.0 · Data.Semigroup
  • Foldable LastDefined in base-4.20.2.0 · Data.Semigroup
  • Foldable MaxDefined in base-4.20.2.0 · Data.Semigroup
  • Foldable MinDefined in base-4.20.2.0 · Data.Semigroup
  • Foldable SCCDefined in containers-0.7 · Data.Graph
  • Foldable IntMapDefined in containers-0.7 · Data.IntMap.Internal

    Folds in order of increasing key.

  • Foldable DigitDefined in containers-0.7 · Data.Sequence.Internal
  • Foldable ElemDefined in containers-0.7 · Data.Sequence.Internal
  • Foldable FingerTreeDefined in containers-0.7 · Data.Sequence.Internal
  • Foldable NodeDefined in containers-0.7 · Data.Sequence.Internal
  • Foldable SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Foldable ViewLDefined in containers-0.7 · Data.Sequence.Internal
  • Foldable ViewRDefined in containers-0.7 · Data.Sequence.Internal
  • Foldable SetDefined in containers-0.7 · Data.Set.Internal

    Folds in order of increasing key.

  • Foldable TreeDefined in containers-0.7 · Data.Tree

    Folds in preorder

  • Foldable MaybeSDefined in containers-0.7 · Utils.Containers.Internal.StrictMaybe
  • Foldable NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Foldable FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable ZipListDefined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Foldable Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable HashedDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Foldable ArrayDefined in primitive-0.9.1.0 · Data.Primitive.Array
  • Foldable SmallArrayDefined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Foldable TyVarBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Foldable HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Foldable VectorDefined in vector-0.13.2.0 · Data.Vector
  • Foldable VectorDefined in vector-0.13.2.0 · Data.Vector.Strict
  • Foldable []Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable UAddrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable UCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable UDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable UFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable UIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable UWordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable V1Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable (Arg a)Defined in base-4.20.2.0 · Data.Semigroup
  • Foldable (Map k)Defined in containers-0.7 · Data.Map.Internal

    Folds in order of increasing key.

  • Foldable (Array i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable (Either a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Foldable f => Foldable (Lift f)Defined in transformers-0.6.1.1 · Control.Applicative.Lift
  • Foldable f => Foldable (MaybeT f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe
  • Foldable m => Foldable (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.Pure
  • Foldable (Const m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Foldable (Constant a)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Foldable f => Foldable (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable f => Foldable (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable f => Foldable (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Foldable f => Foldable (Backwards f)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards

    Derived instance.

  • Foldable f => Foldable (ExceptT e f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • Foldable f => Foldable (IdentityT f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity
  • Foldable f => Foldable (WriterT w f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy
  • Foldable f => Foldable (WriterT w f)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Strict
  • Foldable f => Foldable (Reverse f)Defined in transformers-0.6.1.1 · Data.Functor.Reverse

    Fold 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.Foldable
  • Foldable 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.Foldable

Bifoldable

Re-exported from Data.Bifoldable:

classclass Bifoldable (p :: Type -> Type -> Type) where
#

Bifoldable identifies foldable structures with two different varieties of elements (as opposed to Foldable, which has one variety of element). Common examples are Either and (,):

instance Bifoldable Either where
  bifoldMap f _ (Left  a) = f a
  bifoldMap _ g (Right b) = g b

instance Bifoldable (,) where
  bifoldr f g z (a, b) = f a (g b z)

Some examples below also use the following BiList to showcase empty Bifoldable behaviors when relevant (Either and (,) containing always exactly resp. 1 and 2 elements):

data BiList a b = BiList [a] [b]

instance Bifoldable BiList where
  bifoldr f g z (BiList as bs) = foldr f (foldr g z bs) as

A minimal Bifoldable definition consists of either bifoldMap or bifoldr. When defining more than this minimal set, one should ensure that the following identities hold:

bifold ≡ bifoldMap id id
bifoldMap f g ≡ bifoldr (mappend . f) (mappend . g) mempty
bifoldr f g z t ≡ appEndo (bifoldMap (Endo . f) (Endo . g) t) z

If the type is also an instance of Foldable, then it must satisfy (up to laziness):

bifoldl const ≡ foldl
bifoldr (flip const) ≡ foldr
bifoldMap (const mempty) ≡ foldMap

If the type is also a Bifunctor instance, it should satisfy:

bifoldMap f g ≡ bifold . bimap f g

which implies that

bifoldMap f g . bimap h i ≡ bifoldMap (f . h) (g . i)
Instances13Bifoldable, …
  • Bifoldable ArgDefined in base-4.20.2.0 · Data.Semigroup
  • Bifoldable MapDefined in containers-0.7 · Data.Map.Internal
  • Bifoldable EitherDefined in base-4.20.2.0 · Data.Bifoldable
  • Bifoldable Tuple2Defined in base-4.20.2.0 · Data.Bifoldable

    Class laws for tuples hold only up to laziness. The Bifoldable methods are lazier than their Foldable counterparts. For example the law bifoldr (flip const) ≡ foldr does not hold for tuples if laziness is exploited:

    Example2 expressions
    bifoldr (flip const) (:) [] (undefined :: (Int, Word)) `seq` ()()foldr (:) [] (undefined :: (Int, Word)) `seq` ()*** Exception: Prelude.undefined
  • Bifoldable HashMapDefined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Bifoldable ConstDefined in base-4.20.2.0 · Data.Bifoldable
  • Bifoldable ConstantDefined in transformers-0.6.1.1 · Data.Functor.Constant
  • Bifoldable (Tuple3 x)Defined in base-4.20.2.0 · Data.Bifoldable
  • Bifoldable (K1 i)Defined in base-4.20.2.0 · Data.Bifoldable
  • Bifoldable (Tuple4 x y)Defined in base-4.20.2.0 · Data.Bifoldable
  • Bifoldable (Tuple5 x y z)Defined in base-4.20.2.0 · Data.Bifoldable
  • Bifoldable (Tuple6 x y z w)Defined in base-4.20.2.0 · Data.Bifoldable
  • Bifoldable (Tuple7 x y z w v)Defined in base-4.20.2.0 · Data.Bifoldable

Semigroup

Re-exported from Data.Semigroup:

classclass Semigroup a where
#

The class of semigroups (types with an associative binary operation).

Instances should satisfy the following:

Associativity

x <> (y <> z) = (x <> y) <> z

You can alternatively define sconcat instead of (<>), in which case the laws are:

Unit

sconcat (pure x) = x

Multiplication

sconcat (join xss) = sconcat (fmap sconcat xss)

Instances114Semigroup, …

Monoid

Re-exported from Data.Monoid:

classclass Semigroup a => Monoid a where
#

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following:

Right identity

x <> mempty = x

Left identity

mempty <> x = x

Associativity

x <> (y <> z) = (x <> y) <> z

(

Semigroup

law)

Concatenation

mconcat = foldr (<>) mempty

You can alternatively define mconcat instead of mempty, in which case the laws are:

Unit

mconcat (pure x) = x

Multiplication

mconcat (join xss) = mconcat (fmap mconcat xss)

Subclass

mconcat (toList xs) = sconcat xs

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.

Instances104Monoid, …
  • Monoid ByteArrayDefined in base-4.20.2.0 · Data.Array.Byte
  • Monoid BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internal
  • Monoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Monoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Monoid ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Monoid IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Monoid AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Monoid EventLifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types
  • Monoid LifetimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Internal.Types

    mappend takes the longer of two lifetimes.

  • Monoid ExceptionContextDefined in ghc-internal-9.1003.0 · GHC.Internal.Exception.Context
  • Monoid OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid 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.Types
  • Monoid WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Monoid DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • Monoid Utf8BuilderDefined in rio-0.1.22.0 · RIO.Prelude.Display
  • Monoid LogFuncDefined in rio-0.1.22.0 · RIO.Prelude.Logger

    mempty peforms no logging.

  • Monoid TextDefined in text-2.1.3 · Data.Text · orphan
  • Monoid BuilderDefined in text-2.1.3 · Data.Text.Internal.Builder
  • Monoid TextDefined in text-2.1.3 · Data.Text.Lazy · orphan
  • Monoid StrictTextBuilderDefined in text-2.1.3 · Data.Text.Internal.StrictBuilder
  • Monoid CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDays

    Additive

  • Monoid CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTime

    Additive

  • Monoid StatxFlagsDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Monoid StatxMaskDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Monoid ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid (Comparison a)Defined in base-4.20.2.0 · Data.Functor.Contravariant

    mempty on comparisons always returns EQ. Without newtypes this equals pure (pure EQ).

    mempty :: Comparison a
    mempty = Comparison _ _ -> EQ
    
  • Monoid (Equivalence a)Defined in base-4.20.2.0 · Data.Functor.Contravariant

    mempty on equivalences always returns True. Without newtypes this equals pure (pure True).

    mempty :: Equivalence a
    mempty = Equivalence _ _ -> True
    
  • Monoid (Predicate a)Defined in base-4.20.2.0 · Data.Functor.Contravariant

    mempty on predicates always returns True. Without newtypes this equals pure True.

    mempty :: Predicate a
    mempty = _ -> True
    
  • Monoid (PutM ())Defined in binary-0.8.9.3 · Data.Binary.Put
  • Monoid (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Monoid (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Monoid (MergeSet a)Defined in containers-0.7 · Data.Set.Internal
  • Monoid (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Monoid (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Monoid (Endo a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Monoid (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • Monoid (PrimArray a)Defined in primitive-0.9.1.0 · Data.Primitive.PrimArray
  • Monoid (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Monoid (GLogFunc msg)Defined in rio-0.1.22.0 · RIO.Prelude.Logger

    mempty peforms no logging.

  • Monoid (Validity k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal.Debug
  • Monoid (Vector a)Defined in vector-0.13.2.0 · Data.Vector
  • Monoid (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Strict
  • Monoid [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid a => Monoid (STM a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Monoid a => Monoid (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Monoid a => Monoid (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Monoid a => Monoid (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid a => Monoid (IO a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid a => Monoid (May a)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Monoid a => Monoid (Q a)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Monoid a => Monoid (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid m => Monoid (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Monoid p => Monoid (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Semigroup a => Monoid (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base

    Lift 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.

  • Bits a => Monoid (Ior a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • Bits a => Monoid (Xor a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits
  • FiniteBits a => Monoid (And a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Bits

    This 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.Bits

    This constraint is arguably too strong. However, as some types (such as Natural) have undefined complement, this is the only safe choice.

  • Storable a => Monoid (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Storable
  • Num a => Monoid (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Num a => Monoid (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Ord a => Monoid (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Ord a => Monoid (Max a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils
  • Ord a => Monoid (Min a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils
  • Hashable a => Monoid (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal

    mempty = empty

    mappend = union

    O(n+m)

    To obtain good performance, the smaller set must be presented as the first argument.

    Examples
    Example1 expression
    mappend (fromList [1,2]) (fromList [2,3])fromList [1,2,3]
  • Prim a => Monoid (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Primitive
  • Unbox a => Monoid (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed · orphan
  • (Semigroup a, Monoid a) => Monoid (Concurrently a)Defined in async-2.2.5 · Control.Concurrent.Async.Internal
  • (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.Semigroup
  • Applicative f => Monoid (Traversed a f)Defined in microlens-0.4.14.0 · Lens.Micro
  • Monoid (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Monoid (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monoid a => Monoid (Op a b)Defined in base-4.20.2.0 · Data.Functor.Contravariant

    mempty @(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.ST
  • Monoid a => Monoid (Err e a)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • Monoid a => Monoid (RIO env a)Defined in rio-0.1.22.0 · RIO.Prelude.RIO
  • Monoid b => Monoid (a -> b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Ord k => Monoid (Map k v)Defined in containers-0.7 · Data.Map.Internal
  • Hashable k => Monoid (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal

    mempty = empty

    mappend = union

    If a key occurs in both maps, the mapping from the first will be the mapping in the result.

    Examples
    Example1 expression
    mappend (fromList [(1,'a'),(2,'b')]) (fromList [(2,'c'),(3,'d')])fromList [(1,'a'),(2,'b'),(3,'d')]
  • (Monoid a, Monoid b) => Monoid (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • (Monoid a, MonadUnliftIO m) => Monoid (Conc m a)Defined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • (Semigroup a, Monoid a) => Monoid (ConcurrentlyE e a)Defined in async-2.2.5 · Control.Concurrent.Async.Internal
  • (Semigroup a, Monoid a, MonadUnliftIO m) => Monoid (Concurrently m a)Defined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Alternative f => Monoid (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid (f p) => Monoid (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monoid a => Monoid (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Monoid 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
  • (Monad m, Monoid r) => Monoid (Effect m r a)Defined in microlens-mtl-0.2.1.0 · Lens.Micro.Mtl.Internal
  • (Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monoid 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 (f (g a)) => Monoid (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Monoid (f (g p)) => Monoid ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monoid (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

Applicative

Re-exported from Control.Applicative:

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

A functor with application, providing operations to

  • embed pure expressions (pure), and

  • sequence computations and combine their results (<*> and liftA2).

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

(<*>) = liftA2 id
liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

Identity
pure id <*> v = v
Composition
pure (.) <*> u <*> v <*> w = u <*> (v <*> w)
Homomorphism
pure f <*> pure x = pure (f x)
Interchange
u <*> pure y = pure ($ y) <*> u

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

As a consequence of these laws, the Functor instance for f will satisfy

It may be useful to note that supposing

forall x y. p (q x y) = f x . g y

it follows from the above that

liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v

If f is also a Monad, it should satisfy

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

Instances113Applicative, …

Alternative

Re-exported from Control.Applicative:

classclass Applicative f => Alternative (f :: Type -> Type) where
#

A monoid on applicative functors.

If defined, some and many should be the least solutions of the equations:

Examples
Example1 expression
Nothing <|> Just 42Just 42
Example1 expression
[1, 2] <|> [3, 4][1,2,3,4]
Example1 expression
empty <|> print (2^15)32768
Instances50Alternative, …

Traversable

Re-exported from Data.Traversable:

classclass (Functor t, Foldable t) => Traversable (t :: Type -> Type) where
#

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.

Instances70Traversable, …

Bitraversable

Re-exported from Data.Bitraversable:

classclass (Bifunctor t, Bifoldable t) => Bitraversable (t :: Type -> Type -> Type) where
#

Bitraversable identifies bifunctorial data structures whose elements can be traversed in order, performing Applicative or Monad actions at each element, and collecting a result structure with the same shape.

As opposed to Traversable data structures, which have one variety of element on which an action can be performed, Bitraversable data structures have two such varieties of elements.

A definition of bitraverse must satisfy the following laws:

Naturality

bitraverse (t . f) (t . g) ≡ t . bitraverse f g

for every applicative transformation

t

Identity

bitraverse Identity Identity ≡ Identity

Composition

Compose . fmap (bitraverse g1 g2) . bitraverse f1 f2 ≡ bitraverse (Compose . fmap g1 . f1) (Compose . fmap g2 . f2)

where an applicative transformation is a function

t :: (Applicative f, Applicative g) => f a -> g a

preserving the Applicative operations:

t (pure x) ≡ pure x
t (f <*> x) ≡ t f <*> t x

and the identity functor Identity and composition functors Compose are from Data.Functor.Identity and Data.Functor.Compose.

Some simple examples are Either and (,):

instance Bitraversable Either where
  bitraverse f _ (Left x) = Left <$> f x
  bitraverse _ g (Right y) = Right <$> g y

instance Bitraversable (,) where
  bitraverse f g (x, y) = (,) <$> f x <*> g y

Bitraversable relates to its superclasses in the following ways:

bimap f g ≡ runIdentity . bitraverse (Identity . f) (Identity . g)
bifoldMap f g ≡ getConst . bitraverse (Const . f) (Const . g)

These are available as bimapDefault and bifoldMapDefault respectively.

If the type is also an instance of Traversable, then it must satisfy (up to laziness):

traverse ≡ bitraverse pure
Instances11Bitraversable, …
  • Bitraversable ArgDefined in base-4.20.2.0 · Data.Semigroup
  • Bitraversable EitherDefined in base-4.20.2.0 · Data.Bitraversable
  • Bitraversable Tuple2Defined in base-4.20.2.0 · Data.Bitraversable

    Class laws for tuples hold only up to laziness. The Bitraversable methods are lazier than their Traversable counterparts. For example the law bitraverse pure ≡ traverse does not hold for tuples if laziness is exploited:

    Example2 expressions
    (bitraverse pure pure undefined :: IO (Int, Word)) `seq` ()()(traverse pure undefined :: IO (Int, Word)) `seq` ()*** Exception: Prelude.undefined
  • Bitraversable ConstDefined in base-4.20.2.0 · Data.Bitraversable
  • Bitraversable ConstantDefined in transformers-0.6.1.1 · Data.Functor.Constant
  • Bitraversable (Tuple3 x)Defined in base-4.20.2.0 · Data.Bitraversable
  • Bitraversable (K1 i)Defined in base-4.20.2.0 · Data.Bitraversable
  • Bitraversable (Tuple4 x y)Defined in base-4.20.2.0 · Data.Bitraversable
  • Bitraversable (Tuple5 x y z)Defined in base-4.20.2.0 · Data.Bitraversable
  • Bitraversable (Tuple6 x y z w)Defined in base-4.20.2.0 · Data.Bitraversable
  • Bitraversable (Tuple7 x y z w v)Defined in base-4.20.2.0 · Data.Bitraversable

Monad

Re-exported from Control.Monad:

classclass Applicative m => Monad (m :: Type -> Type) where
#

The Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions.

Instances of Monad should satisfy the following:

Left identity

return a >>= k = k a

Right identity

m >>= return = m

Associativity

m >>= (\x -> k x >>= h) = (m >>= k) >>= h

Furthermore, the Monad and Applicative operations should relate as follows:

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.

Instances85Monad, …
  • Monad ComplexDefined in base-4.20.2.0 · Data.Complex
  • Monad FirstDefined in base-4.20.2.0 · Data.Semigroup
  • Monad LastDefined in base-4.20.2.0 · Data.Semigroup
  • Monad MaxDefined in base-4.20.2.0 · Data.Semigroup
  • Monad MinDefined in base-4.20.2.0 · Data.Semigroup
  • Monad GetDefined in binary-0.8.9.3 · Data.Binary.Get.Internal
  • Monad PutMDefined in binary-0.8.9.3 · Data.Binary.Put
  • Monad PutDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internal
  • Monad SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Monad TreeDefined in containers-0.7 · Data.Tree
  • Monad NonEmptyDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monad STMDefined in ghc-internal-9.1003.0 · GHC.Internal.Conc.Sync
  • Monad IdentityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Monad FirstDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Monad LastDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Monad DownDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Monad DualDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monad ProductDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monad SumDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monad NoIODefined in ghc-internal-9.1003.0 · GHC.Internal.GHCi
  • Monad Par1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monad MaybeDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monad PDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadP
  • Monad ReadPDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadP
  • Monad ReadPrecDefined in ghc-internal-9.1003.0 · GHC.Internal.Text.ParserCombinators.ReadPrec
  • Monad SoloDefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monad IODefined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monad ArrayDefined in primitive-0.9.1.0 · Data.Primitive.Array
  • Monad SmallArrayDefined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Monad STMDefined in stm-2.5.3.1 · Control.Sequential.STM
  • Monad PprMDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.PprLib
  • Monad QDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Monad MemoizedDefined in unliftio-0.2.25.1 · UnliftIO.Memoize
  • Monad VectorDefined in vector-0.13.2.0 · Data.Vector
  • Monad IdDefined in vector-0.13.2.0 · Data.Vector.Fusion.Util
  • Monad VectorDefined in vector-0.13.2.0 · Data.Vector.Strict
  • Monad BoxDefined in vector-stream-0.1.0.1 · Data.Stream.Monadic
  • Monad []Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • Monad ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Monad U1Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monad (SetM s)Defined in containers-0.7 · Data.Graph
  • Monad (State s)Defined in containers-0.7 · Utils.Containers.Internal.State
  • Monad (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Monad.ST.Lazy.Imp
  • Monad (Either e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Either
  • Monad (ST s)Defined in ghc-internal-9.1003.0 · GHC.Internal.ST
  • Monad (RIO env)Defined in rio-0.1.22.0 · RIO.Prelude.RIO
  • Monad (IParser t)Defined in text-2.1.3 · Data.Text.Internal.Read
  • Monad m => Monad (WrappedMonad m)Defined in base-4.20.2.0 · Control.Applicative
  • Monad m => Monad (CatchT m)Defined in exceptions-0.10.9 · Control.Monad.Catch.Pure
  • Monad m => Monad (MaybeT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe
  • Monoid a => Monad (Tuple2 a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Base
  • ArrowApply a => Monad (ArrowMonad a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Monad (t m) => Monad (LiftingAccum t m)Defined in mtl-2.3.1 · Control.Monad.Accum
  • Monad (t m) => Monad (LiftingSelect t m)Defined in mtl-2.3.1 · Control.Monad.Select
  • Monad f => Monad (Ap f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Monad f => Monad (Alt f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Monad f => Monad (Rec1 f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monad m => Monad (Kleisli m a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Monad m => Monad (StateT s m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Utils
  • Monad m => Monad (StateT s m)Defined in microlens-0.4.14.0 · Lens.Micro
  • Monad m => Monad (ExceptT e m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • Monad m => Monad (IdentityT m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity
  • Monad m => Monad (ReaderT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Reader
  • Monad m => Monad (SelectT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Select
  • Monad m => Monad (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Lazy
  • Monad m => Monad (StateT s m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Strict
  • Monad m => Monad (WriterT w m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPS
  • Monad m => Monad (Reverse m)Defined in transformers-0.6.1.1 · Data.Functor.Reverse

    Derived instance.

  • (Applicative f, Monad f) => Monad (WhenMissing f x)Defined in containers-0.7 · Data.IntMap.Internal

    Equivalent 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.Strict
  • Monad (ContT r m)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Cont
  • Monad ((->) 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.Internal

    Equivalent to ReaderT k (ReaderT x (MaybeT f)) .

  • (Monad f, Applicative f) => Monad (WhenMatched f x y)Defined in containers-0.7 · Data.IntMap.Internal

    Equivalent 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.Base
  • Monad f => Monad (M1 i c f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monad 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.Internal

    Equivalent 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.Strict

MonadPlus

Re-exported from Control.Monad:

classclass (Alternative m, Monad m) => MonadPlus (m :: Type -> Type) where
#

Monads that also support choice and failure.

Instances39MonadPlus, …

Category

Re-exported from Control.Category:

classclass Category (cat :: k -> k -> Type) where
#

A class for categories. Instances should satisfy the laws

Right identity

f . id = f

Left identity

id . f = f

Associativity

f . (g . h) = (f . g) . h

Instances10Category, …

Arrow

Re-exported from Control.Arrow:

classclass Category a => Arrow (a :: Type -> Type -> Type) where
#

The basic arrow class.

Instances should satisfy the following laws:

where

assoc ((a,b),c) = (a,(b,c))

The other combinators have sensible default definitions, which may be overridden for efficiency.

Instances2Arrow
  • Monad m => Arrow (Kleisli m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Arrow (->)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow

MonadFail

Re-exported from Control.Monad.Fail:

classclass Monad m => MonadFail (m :: Type -> Type) where
#

When a value is bound in do-notation, the pattern on the left hand side of <- might not match. In this case, this class provides a function to recover.

A Monad without a MonadFail instance may only be used in conjunction with pattern that always match, such as newtypes, tuples, data types with only a single data constructor, and irrefutable patterns (~pat).

Instances of MonadFail should satisfy the following law: fail s should be a left zero for >>=,

fail s >>= f  =  fail s

If your Monad is also MonadPlus, a popular definition is

fail _ = mzero

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.

Instances31MonadFail, …

Data

Typeable

Re-exported from Control.Monad:

classclass Typeable (a :: k) where
#

The class Typeable allows a concrete representation of a type to be calculated.

Data

Re-exported from Data.Data:

classclass Typeable a => Data a where
#

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.

Methods

  • gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> a -> c a

    Left-associative fold operation for constructor applications.

    The type of gfoldl is a headache, but operationally it is a simple generalisation of a list fold.

    The default definition for gfoldl is const id, which is suitable for abstract datatypes with no substructures.

  • gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c a

    Unfolding constructor applications

  • toConstr :: a -> Constr

    Obtaining the constructor from a given datum. For proper terms, this is meant to be the top-level constructor. Primitive datatypes are here viewed as potentially infinite sets of values (i.e., constructors).

  • dataTypeOf :: a -> DataType

    The outer type constructor of the type

  • dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c a)

    Mediate types and unary type constructors.

    In Data instances of the form

        instance (Data a, ...) => Data (T a)
    

    dataCast1 should be defined as gcast1.

    The default definition is const Nothing, which is appropriate for instances of other forms.

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

    Mediate types and binary type constructors.

    In Data instances of the form

        instance (Data a, Data b, ...) => Data (T a b)
    

    dataCast2 should be defined as gcast2.

    The default definition is const Nothing, which is appropriate for instances of other forms.

  • gmapT :: (forall b. Data b => b -> b) -> a -> a

    A generic transformation that maps over the immediate subterms

    The default definition instantiates the type constructor c in the type of gfoldl to an identity datatype constructor, using the isomorphism pair as injection and projection.

  • gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r

    A generic query with a left-associative binary operator

  • gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r

    A generic query with a right-associative binary operator

  • gmapQ :: (forall d. Data d => d -> u) -> a -> [u]

    A generic query that processes the immediate subterms and returns a list of results. The list is given in the same order as originally specified in the declaration of the data constructors.

  • gmapQi :: Int -> (forall d. Data d => d -> u) -> a -> u

    A generic query that processes one child by index (zero-based)

  • gmapM :: Monad m => (forall d. Data d => d -> m d) -> a -> m a

    A generic monadic transformation that maps over the immediate subterms

    The default definition instantiates the type constructor c in the type of gfoldl to the monad datatype constructor, defining injection and projection using return and >>=.

  • gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a

    Transformation of at least one immediate subterm does not fail

  • gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a

    Transformation of one immediate subterm with success

Instances184Data, …
  • Data ByteArrayDefined in base-4.20.2.0 · Data.Array.Byte
  • Data ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Data ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Data ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Data IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Data IntegerDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data NaturalDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data SpecConstrAnnotationDefined in ghc-internal-9.1003.0 · GHC.Internal.Exts
  • Data IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data TextDefined in text-2.1.3 · Data.Text · orphan

    This 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 · orphan

    This 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.Text.Text

  • Data CalendarDiffDaysDefined in time-1.12.2 · Data.Time.Calendar.CalendarDiffDays
  • Data DayDefined in time-1.12.2 · Data.Time.Calendar.Days
  • Data MonthDefined in time-1.12.2 · Data.Time.Calendar.Month
  • Data QuarterDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Data QuarterOfYearDefined in time-1.12.2 · Data.Time.Calendar.Quarter
  • Data DayOfWeekDefined in time-1.12.2 · Data.Time.Calendar.Week
  • Data AbsoluteTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.AbsoluteTime
  • Data DiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.DiffTime
  • Data NominalDiffTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.NominalDiffTime
  • Data SystemTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.SystemTime
  • Data UTCTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UTCTime
  • Data UniversalTimeDefined in time-1.12.2 · Data.Time.Clock.Internal.UniversalTime
  • Data CalendarDiffTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.CalendarDiffTime
  • Data LocalTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.LocalTime
  • Data TimeOfDayDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeOfDay
  • Data TimeZoneDefined in time-1.12.2 · Data.Time.LocalTime.Internal.TimeZone
  • Data ZonedTimeDefined in time-1.12.2 · Data.Time.LocalTime.Internal.ZonedTime
  • Data ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Data a => Data (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Data a => Data (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Data a => Data (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Data a => Data (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Data a => Data (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Data a => Data (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Data a => Data (ViewL a)Defined in containers-0.7 · Data.Sequence.Internal
  • Data a => Data (ViewR a)Defined in containers-0.7 · Data.Sequence.Internal
  • Data a => Data (Tree a)Defined in containers-0.7 · Data.Tree
  • Data a => Data (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (ForeignPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Data a => Data (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • Data a => Data (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Data a => Data (Vector a)Defined in vector-0.13.2.0 · Data.Vector
  • Data a => Data (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Strict
  • Data a => Data (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data a => Data [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data

    For historical reasons, the constructor name used for (:) is "(:)". In a derived instance, it would be ":".

  • Data flag => Data (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Data m => Data (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Data p => Data (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data vertex => Data (SCC vertex)Defined in containers-0.7 · Data.Graph
  • Typeable s => Data (MutableByteArray s)Defined in base-4.20.2.0 · Data.Array.Byte
  • (Data a, Storable a) => Data (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Storable
  • (Data a, Integral a) => Data (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • (Data a, Ord a) => Data (Set a)Defined in containers-0.7 · Data.Set.Internal
  • (Data a, Hashable a) => Data (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • (Data a, Prim a) => Data (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Primitive
  • (Data a, Unbox a) => Data (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Data p => Data (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data p => Data (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Data 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 k, Data a, Ord k) => Data (Map k a)Defined in containers-0.7 · Data.Map.Internal
  • (Data k, Data v, Hashable k) => Data (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.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
  • (Typeable s, Typeable a) => Data (MutableArray s a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • (Typeable s, Typeable a) => Data (SmallMutableArray s a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • (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
  • (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.Data

Generic

Re-exported from GHC.Generics:

classclass Generic a where
#

Representable types of kind *. This class is derivable in GHC with the DeriveGeneric flag on.

A Generic instance must satisfy the following laws:

from . to ≡ id
to . from ≡ id
Instances193Generic, …
  • Generic ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Generic ForeignSrcLangDefined in ghc-boot-th-9.10.3 · GHC.ForeignSrcLang.Type
  • Generic ExtensionDefined in ghc-boot-th-9.10.3 · GHC.LanguageExtensions.Type
  • Generic VoidDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ByteOrderDefined in ghc-internal-9.1003.0 · GHC.Internal.ByteOrder
  • Generic ClosureTypeDefined in ghc-internal-9.1003.0 · GHC.Internal.ClosureTypes
  • Generic AllDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic AnyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic VersionDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Version
  • Generic FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic AssociativityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic DecidedStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic FixityDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic SourceStrictnessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic SourceUnpackednessDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ExitCodeDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Exception
  • Generic CCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ConcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DebugFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoCostCentresDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoHeapProfileDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic DoTraceDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic GCFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic GiveGCStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic HpcFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic MiscFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ParFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic ProfFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic RTSFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic TickyFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic TraceFlagsDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Generic SrcLocDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic GCDetailsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Generic RTSStatsDefined in ghc-internal-9.1003.0 · GHC.Internal.Stats
  • Generic GeneralCategoryDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic OrderingDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic OsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic OsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic PosixCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic PosixStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic WindowsCharDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic WindowsStringDefined in os-string-2.0.7 · System.OsString.Internal.Types
  • Generic ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • Generic AnnLookupDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic AnnTargetDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BangDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BndrVisDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BodyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic BytesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic CallconvDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ConDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DecDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DecidedStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DerivClauseDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DerivStrategyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic DocLocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ExpDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FamilyResultSigDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FixityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FixityDirectionDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ForeignDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic FunDepDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic GuardDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InjectivityAnnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic InlineDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic LitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic LocDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic MatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModuleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ModuleInfoDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameFlavourDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NameSpaceDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic NamespaceSpecifierDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic OccNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic OverlapDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatSynArgsDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PatSynDirDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PhasesDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PkgNameDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic PragmaDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RangeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RoleDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RuleBndrDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic RuleMatchDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SafetyDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SourceStrictnessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SourceUnpackednessDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic SpecificityDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic StmtDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TyLitDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TySynEqnDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TypeDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic TypeFamilyHeadDefined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic ConcExceptionDefined in unliftio-0.2.25.1 · UnliftIO.Internals.Async
  • Generic ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Generic (First a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Last a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Max a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Min a)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (WrappedMonoid m)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (SCC vertex)Defined in containers-0.7 · Data.Graph
  • Generic (Digit a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (Elem a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (FingerTree a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (Node a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (ViewL a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (ViewR a)Defined in containers-0.7 · Data.Sequence.Internal
  • Generic (Tree a)Defined in containers-0.7 · Data.Tree
  • Generic (NonEmpty a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Generic (First a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Last a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Dual a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Endo a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Product a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Sum a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (ZipList a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Functor.ZipList
  • Generic (Par1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Maybe a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Generic (TyVarBndr flag)Defined in template-haskell-2.22.0.0 · Language.Haskell.TH.Syntax
  • Generic (a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic [a]Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (WrappedMonad m a)Defined in base-4.20.2.0 · Control.Applicative
  • Generic (Arg a b)Defined in base-4.20.2.0 · Data.Semigroup
  • Generic (Either a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (U1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (V1 p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Lift f a)Defined in transformers-0.6.1.1 · Control.Applicative.Lift
  • Generic (MaybeT m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Maybe
  • Generic (a, b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (WrappedArrow a b c)Defined in base-4.20.2.0 · Control.Applicative
  • Generic (Kleisli m a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Control.Arrow
  • Generic (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const
  • Generic (Ap f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Monoid
  • Generic (Alt f a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic (Rec1 f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Char p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Double p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Float p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Int p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec Word p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (URec (Ptr ()) p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Backwards f a)Defined in transformers-0.6.1.1 · Control.Applicative.Backwards
  • Generic (AccumT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Accum
  • Generic (ExceptT e m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Except
  • Generic (IdentityT f a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Identity
  • Generic (ReaderT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Reader
  • Generic (SelectT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Select
  • Generic (StateT s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Lazy
  • Generic (StateT s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.State.Strict
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.CPS
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Lazy
  • Generic (WriterT w m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Writer.Strict
  • Generic (Constant a b)Defined in transformers-0.6.1.1 · Data.Functor.Constant
  • Generic (Reverse f a)Defined in transformers-0.6.1.1 · Data.Functor.Reverse
  • Generic (a, b, c)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Product f g a)Defined in base-4.20.2.0 · Data.Functor.Product
  • Generic (Sum f g a)Defined in base-4.20.2.0 · Data.Functor.Sum
  • Generic (K1 i c p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (ContT r m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.Cont
  • Generic ((:*:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic ((:+:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (Compose f g a)Defined in base-4.20.2.0 · Data.Functor.Compose
  • Generic (M1 i c f p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.CPS
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Lazy
  • Generic (RWST r w s m a)Defined in transformers-0.6.1.1 · Control.Monad.Trans.RWS.Strict
  • Generic ((:.:) f g p)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Generic (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics

Storable

Re-exported from Foreign.Storable:

classclass Storable a where
#

The member functions of this class facilitate writing values of primitive types to raw memory (which may have been allocated with the above mentioned routines) and reading values from blocks of raw memory. The class, furthermore, includes support for computing the storage requirements and alignment restrictions of storable types.

Memory addresses are represented as values of type Ptr a, for some a which is an instance of class Storable. The type argument to Ptr helps provide some valuable type safety in FFI code (you can't mix pointers of different types without an explicit cast), while helping the Haskell type system figure out which marshalling method is needed for a given pointer.

All marshalling between Haskell and a foreign language ultimately boils down to translating Haskell data structures into the binary representation of a corresponding data structure of the foreign language and vice versa. To code this marshalling in Haskell, it is necessary to manipulate primitive data types stored in unstructured memory blocks. The class Storable facilitates this manipulation on all types for which it is instantiated, which are the standard basic types of Haskell, the fixed size Int types (Int8, Int16, Int32, Int64), the fixed size Word types (Word8, Word16, Word32, Word64), StablePtr, all types from Foreign.C.Types, as well as Ptr.

Instances90Storable, …
  • Storable CTimeSpecDefined in directory-1.3.8.5 · System.Directory.Internal.C_utimensat
  • Storable EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.EPoll
  • Storable EventDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Poll
  • Storable PollFdDefined in ghc-internal-9.1003.0 · GHC.Internal.Event.Poll
  • Storable FingerprintDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable CBoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CClockDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CDoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CFloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CLLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CPtrdiffDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CSCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CSUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CSigAtomicDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CTimeDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUCharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUIntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUIntMaxDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUIntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CULLongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CULongDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUSecondsDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CUShortDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable CWcharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.C.Types
  • Storable IntPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Storable WordPtrDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Ptr
  • Storable FLockDefined in ghc-internal-9.1003.0 · GHC.Internal.IO.Handle.Lock.LinuxOFD
  • Storable Int16Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Int32Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Int64Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Int8Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable IoSubSystemDefined in ghc-internal-9.1003.0 · GHC.Internal.RTS.Flags
  • Storable CBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CBlkSizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CCcDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CClockIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CDevDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CFsBlkCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CFsFilCntDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CGidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CIdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CInoDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CKeyDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CModeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CNfdsDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CNlinkDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable COffDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CPidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CRLimDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CSocklenDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CSpeedDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CSsizeDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CTcflagDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CTimerDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable CUidDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable FdDefined in ghc-internal-9.1003.0 · GHC.Internal.System.Posix.Types
  • Storable Word16Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Word32Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Word64Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable Word8Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable BoolDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable CharDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable DoubleDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable FloatDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable IntDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable WordDefined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable CTimespecDefined in time-1.12.2 · Data.Time.Clock.Internal.CTimespec
  • Storable CTimevalDefined in time-1.12.2 · Data.Time.Clock.Internal.CTimeval
  • Storable DirEntDefined in unix-2.8.7.0 · System.Posix.Directory.Common
  • Storable CAttributesDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Storable CTimeSpecDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Storable CTimeValDefined in unix-2.8.7.0 · System.Posix.Files.Common
  • Storable ()Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable (ConstPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable (FunPtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable (Ptr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable (StablePtr a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable a => Storable (Complex a)Defined in base-4.20.2.0 · Data.Complex
  • Storable a => Storable (Identity a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Identity
  • Storable a => Storable (Down a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Ord
  • Prim a => Storable (PrimStorable a)Defined in primitive-0.9.1.0 · Data.Primitive.Types
  • (Storable a, Integral a) => Storable (Ratio a)Defined in ghc-internal-9.1003.0 · GHC.Internal.Foreign.Storable
  • Storable a => Storable (Const a b)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Functor.Const

Exceptions

Exception

Re-exported from Control.Exception.Base:

classclass (Typeable e, Show e) => Exception e where
#

Any type that you wish to throw or catch as an exception must be an instance of the Exception class. The simplest case is a new exception type directly below the root:

data MyException = ThisException | ThatException
    deriving Show

instance Exception MyException

The default method definitions in the Exception class do what we need in this case. You can now throw and catch ThisException and ThatException as exceptions:

*Main> throw ThisException `catch` \e -> putStrLn ("Caught " ++ show (e :: MyException))
Caught ThisException

In more complicated examples, you may wish to define a whole hierarchy of exceptions:

---------------------------------------------------------------------
-- Make the root exception type for all the exceptions in a compiler

data SomeCompilerException = forall e . Exception e => SomeCompilerException e

instance Show SomeCompilerException where
    show (SomeCompilerException e) = show e

instance Exception SomeCompilerException

compilerExceptionToException :: Exception e => e -> SomeException
compilerExceptionToException = toException . SomeCompilerException

compilerExceptionFromException :: Exception e => SomeException -> Maybe e
compilerExceptionFromException x = do
    SomeCompilerException a <- fromException x
    cast a

---------------------------------------------------------------------
-- Make a subhierarchy for exceptions in the frontend of the compiler

data SomeFrontendException = forall e . Exception e => SomeFrontendException e

instance Show SomeFrontendException where
    show (SomeFrontendException e) = show e

instance Exception SomeFrontendException where
    toException = compilerExceptionToException
    fromException = compilerExceptionFromException

frontendExceptionToException :: Exception e => e -> SomeException
frontendExceptionToException = toException . SomeFrontendException

frontendExceptionFromException :: Exception e => SomeException -> Maybe e
frontendExceptionFromException x = do
    SomeFrontendException a <- fromException x
    cast a

---------------------------------------------------------------------
-- Make an exception type for a particular frontend compiler exception

data MismatchedParentheses = MismatchedParentheses
    deriving Show

instance Exception MismatchedParentheses where
    toException   = frontendExceptionToException
    fromException = frontendExceptionFromException

We can now catch a MismatchedParentheses exception as MismatchedParentheses, SomeFrontendException or SomeCompilerException, but not other types, e.g. IOException:

*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: MismatchedParentheses))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeFrontendException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: SomeCompilerException))
Caught MismatchedParentheses
*Main> throw MismatchedParentheses `catch` \e -> putStrLn ("Caught " ++ show (e :: IOException))
*** Exception: MismatchedParentheses
Instances44Exception, …

HasCallStack

Re-exported from GHC.Stack:

typetype HasCallStack = IP "callStack" CallStack
#

Request a CallStack.

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

deepseq

0 declarations

NFData

Re-exported from Control.DeepSeq:

classclass NFData a where
#

A class of types that can be fully evaluated.

Instances173NFData, …

mtl

0 declarations

MonadTrans

Re-exported from Control.Monad.Reader:

classclass (forall (m :: Type -> Type). Monad m => Monad (t m)) => MonadTrans (t :: (Type -> Type) -> Type -> Type) where
#

The class of monad transformers. For any monad m, the result t m should also be a monad, and lift should be a monad transformation from m to t m, i.e. it should satisfy the following laws:

Since 0.6.0.0 and for GHC 8.6 and later, the requirement that t m be a Monad is enforced by the implication constraint forall m. Monad m => Monad (t m) enabled by the QuantifiedConstraints extension.

Ambiguity error with GHC 9.0 to 9.2.2

These versions of GHC have a bug (https://gitlab.haskell.org/ghc/ghc/-/issues/20582) which causes constraints like

(MonadTrans t, forall m. Monad m => Monad (t m)) => ...

to be reported as ambiguous. For transformers 0.6 and later, this can be fixed by removing the second constraint, which is implied by the first.

Instances16MonadTrans, …

MonadReader

classclass Monad m => MonadReader r (m :: Type -> Type) | m -> r where
#

See examples in Control.Monad.Reader. Note, the partially applied function type (->) r is a simple reader monad. See the instance declaration below.

Instances18MonadReader, …

ReaderT (Reader)

Re-exported from Control.Monad.Reader:

newtypenewtype ReaderT r (m :: Type -> Type) a
#

The reader monad transformer, which adds a read-only environment to the given monad.

The return function ignores the environment, while m >>= k passes the inherited environment to both subcomputations:

image: images/bind-ReaderT.svg

Constructors

Instances32Generic1, MonadAccum, MonadError, MonadReader, MonadState, MonadWriter, …

exceptions

0 declarations

MonadThrow

Re-exported from Control.Monad.Catch:

classclass Monad m => MonadThrow (m :: Type -> Type) where
#

A class for monads in which exceptions may be thrown.

Instances should obey the following law:

throwM e >> x = throwM e

In other words, throwing an exception short-circuits the rest of the monadic computation.

Instances20MonadThrow, …

bytestring

0 declarations

ByteString

Re-exported from Data.ByteString:

datadata ByteString
#

A space-efficient representation of a Word8 vector, supporting many efficient operations.

A ByteString contains 8-bit bytes, or by using the operations from Data.ByteString.Char8 it can be interpreted as containing 8-bit characters.

Instances14IsList, Eq, Data, Ord, Read, Show, …
  • IsList ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Eq ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Data ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Ord ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Read ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Show ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • IsString ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type

    Beware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�

  • Semigroup ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Monoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • NFData ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Binary ByteStringDefined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable ByteStringDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Lift ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • type Item ByteString = Word8Defined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type

LByteString

A synonym for lazy ByteString re-exported from Data.ByteString.Lazy:

Builder

Re-exported from Data.ByteString.Builder:

newtypenewtype Builder
#

Builders denote sequences of bytes. They are Monoids where mempty is the zero-length sequence and mappend is concatenation, which runs in O(1).

Instances6IsList, Show, IsString, Semigroup, Monoid, Item
  • IsList BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internal

    For long or infinite lists use fromList because it uses LazyByteString otherwise use fromListN which uses StrictByteString.

  • Show BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphan
  • IsString BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphan
  • Semigroup BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internal
  • Monoid BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internal
  • type Item Builder = Word8Defined in bytestring-0.12.2.0 · Data.ByteString.Builder.Internal

ShortByteString

Re-exported from Data.ByteString.Short:

newtypenewtype ShortByteString
#

A compact representation of a Word8 vector.

It has a lower memory overhead than a ByteString and does not contribute to heap fragmentation. It can be converted to or from a ByteString (at the cost of copying the string data). It supports very few other operations.

Instances16IsList, Eq, Data, Ord, Read, Show, …

text

0 declarations

Text

Re-exported from Data.Text:

datadata Text
#

A space efficient, packed, unboxed Unicode text type.

Instances16IsList, Eq, Data, Ord, Read, Show, …
  • IsList TextDefined in text-2.1.3 · Data.Text · orphan

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedLists['\55555'] :: Text"\65533"
  • Eq TextDefined in text-2.1.3 · Data.Text · orphan
  • Data TextDefined in text-2.1.3 · Data.Text · orphan

    This 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, ...

  • Ord TextDefined in text-2.1.3 · Data.Text · orphan
  • Read TextDefined in text-2.1.3 · Data.Text · orphan
  • Show TextDefined in text-2.1.3 · Data.Text.Show · orphan
  • IsString TextDefined in text-2.1.3 · Data.Text · orphan

    Performs replacement on invalid scalar values:

    Example2 expressions
    :set -XOverloadedStrings"\55555" :: Text"\65533"
  • Semigroup TextDefined in text-2.1.3 · Data.Text · orphan

    Beware: stimes will crash if the given number does not fit into an Int.

  • Monoid TextDefined in text-2.1.3 · Data.Text · orphan
  • PrintfArg TextDefined in text-2.1.3 · Data.Text · orphan
  • NFData TextDefined in text-2.1.3 · Data.Text · orphan
  • Binary TextDefined in text-2.1.3 · Data.Text · orphan
  • Hashable TextDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Display TextDefined in rio-0.1.22.0 · RIO.Prelude.Display
  • Lift TextDefined in text-2.1.3 · Data.Text · orphan
  • type Item Text = CharDefined in text-2.1.3 · Data.Text · orphan

LText

A synonym for lazy Text re-exported from Data.Text.Lazy:

UncodeException

Re-exported from Data.Text.Encoding.Error:

datadata UnicodeException
#

An exception type for representing Unicode encoding errors.

Constructors

  • DecodeError String (Maybe Word8)

    Could not decode a byte sequence because it was invalid under the given encoding, or ran out of input in mid-decode.

  • EncodeError String (Maybe Char)

    Tried to encode a character that could not be represented under the given encoding, or ran out of input in mid-encode.

Instances4Eq, Show, Exception, NFData

vector

0 declarations

Vector

Boxed vector re-exported from Data.Vector:

datadata Vector a
#
Instances27Monad, Functor, MonadFix, MonadFail, Applicative, Foldable, …

UVector

A synonym for unboxed Data.Vector.Unboxed.Vector re-exported from Data.Vector.Unboxed:

Unbox

classclass (Vector Vector a, MVector MVector a) => Unbox a
#
Instances40Unbox, …
  • Unbox AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox Int16Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox Int32Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox Int64Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox Int8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox Word16Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox Word32Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox Word64Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox Word8Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox CharDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox IntDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox WordDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox ()Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • NFData a => Unbox (DoNotUnboxNormalForm a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox (DoNotUnboxLazy a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox (DoNotUnboxStrict a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Complex a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (First a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Last a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Max a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Min a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (WrappedMonoid a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Identity a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Down a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Dual a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Product a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Sum a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • (Unbox a, Unbox b) => Unbox (Arg a b)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • (Unbox a, Unbox b) => Unbox (a, b)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox (f a) => Unbox (Alt f a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox a => Unbox (Const a b)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • (Unbox a, Unbox b, Unbox c) => Unbox (a, b, c)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • (Unbox a, Unbox b, Unbox c, Unbox d) => Unbox (a, b, c, d)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Unbox (f (g a)) => Unbox (Compose f g a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • (Unbox a, Unbox b, Unbox c, Unbox d, Unbox e) => Unbox (a, b, c, d, e)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • (Unbox a, Unbox b, Unbox c, Unbox d, Unbox e, Unbox f) => Unbox (a, b, c, d, e, f)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Base

SVector

A synonym for storable Vector re-exported from Data.Vector.Storable:

GVector

A synonym for generic Data.Vector.Generic.Vector re-exported from Data.Vector.Generic:

containers

0 declarations

IntMap

Re-exported from Data.IntMap.Strict:

datadata IntMap a
#

A map of integers to values a.

Instances21Functor, Foldable, Traversable, Eq1, Ord1, Read1, …
  • Functor IntMapDefined in containers-0.7 · Data.IntMap.Internal
  • Foldable IntMapDefined in containers-0.7 · Data.IntMap.Internal

    Folds in order of increasing key.

  • Traversable IntMapDefined in containers-0.7 · Data.IntMap.Internal

    Traverses in order of increasing key.

  • Eq1 IntMapDefined in containers-0.7 · Data.IntMap.Internal
  • Ord1 IntMapDefined in containers-0.7 · Data.IntMap.Internal
  • Read1 IntMapDefined in containers-0.7 · Data.IntMap.Internal
  • Show1 IntMapDefined in containers-0.7 · Data.IntMap.Internal
  • Hashable1 IntMapDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Lift a => Lift (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • IsList (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Eq a => Eq (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Data a => Data (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Ord a => Ord (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Read e => Read (IntMap e)Defined in containers-0.7 · Data.IntMap.Internal
  • Show a => Show (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Semigroup (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Monoid (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • NFData a => NFData (IntMap a)Defined in containers-0.7 · Data.IntMap.Internal
  • Binary e => Binary (IntMap e)Defined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable v => Hashable (IntMap v)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • type Item (IntMap a) = (Key, a)Defined in containers-0.7 · Data.IntMap.Internal

Map

Re-exported from Data.Map.Strict:

datadata Map k a
#

A Map from keys k to values a.

The Semigroup operation for Map is union, which prefers values from the left operand. If m1 maps a key k to a value a1, and m2 maps the same key to a different value a2, then their union m1 <> m2 maps k to a1.

Instances26Bifoldable, Eq2, Ord2, Show2, Hashable2, Lift, …
  • Bifoldable MapDefined in containers-0.7 · Data.Map.Internal
  • Eq2 MapDefined in containers-0.7 · Data.Map.Internal
  • Ord2 MapDefined in containers-0.7 · Data.Map.Internal
  • Show2 MapDefined in containers-0.7 · Data.Map.Internal
  • Hashable2 MapDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • (Lift k, Lift a) => Lift (Map k a)Defined in containers-0.7 · Data.Map.Internal
  • Functor (Map k)Defined in containers-0.7 · Data.Map.Internal
  • Foldable (Map k)Defined in containers-0.7 · Data.Map.Internal

    Folds in order of increasing key.

  • Traversable (Map k)Defined in containers-0.7 · Data.Map.Internal

    Traverses in order of increasing key.

  • Eq k => Eq1 (Map k)Defined in containers-0.7 · Data.Map.Internal
  • Ord 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.Internal
  • Show k => Show1 (Map k)Defined in containers-0.7 · Data.Map.Internal
  • Hashable k => Hashable1 (Map k)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • Ord 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.Internal
  • Ord k => Semigroup (Map k v)Defined in containers-0.7 · Data.Map.Internal
  • Ord 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
  • (Hashable k, Hashable v) => Hashable (Map k v)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • type Item (Map k v) = (k, v)Defined in containers-0.7 · Data.Map.Internal

IntSet

Re-exported from Data.IntSet:

datadata IntSet
#

A set of integers.

Instances13IsList, Eq, Data, Ord, Read, Show, …
  • IsList IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Eq IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Data IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Ord IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Read IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Show IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Semigroup IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Monoid IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • NFData IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • Binary IntSetDefined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable IntSetDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Lift IntSetDefined in containers-0.7 · Data.IntSet.Internal
  • type Item IntSet = KeyDefined in containers-0.7 · Data.IntSet.Internal

Set

Re-exported from Data.Set:

datadata Set a
#

A set of values a.

Instances18Foldable, Eq1, Ord1, Show1, Hashable1, Lift, …
  • Foldable SetDefined in containers-0.7 · Data.Set.Internal

    Folds in order of increasing key.

  • Eq1 SetDefined in containers-0.7 · Data.Set.Internal
  • Ord1 SetDefined in containers-0.7 · Data.Set.Internal
  • Show1 SetDefined in containers-0.7 · Data.Set.Internal
  • Hashable1 SetDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Lift a => Lift (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Ord a => IsList (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Eq 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.Internal
  • Ord 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.Internal
  • Show a => Show (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Ord a => Semigroup (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Ord a => Monoid (Set a)Defined in containers-0.7 · Data.Set.Internal
  • NFData a => NFData (Set a)Defined in containers-0.7 · Data.Set.Internal
  • Binary a => Binary (Set a)Defined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable v => Hashable (Set v)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • type Item (Set a) = aDefined in containers-0.7 · Data.Set.Internal

Seq

Re-exported from Data.Seq:

newtypenewtype Seq a
#

General-purpose finite sequences.

Instances29Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
  • Monad SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Functor SeqDefined in containers-0.7 · Data.Sequence.Internal
  • MonadFix SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Applicative SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Foldable SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Traversable SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Alternative SeqDefined in containers-0.7 · Data.Sequence.Internal
  • MonadPlus SeqDefined in containers-0.7 · Data.Sequence.Internal
  • MonadZip SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Eq1 SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Ord1 SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Read1 SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Show1 SeqDefined in containers-0.7 · Data.Sequence.Internal
  • UnzipWith SeqDefined in containers-0.7 · Data.Sequence.Internal
  • Hashable1 SeqDefined in hashable-1.4.7.0 · Data.Hashable.Class
  • Lift a => Lift (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • IsList (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Eq a => Eq (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Data a => Data (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Ord a => Ord (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Read a => Read (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Show a => Show (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • a ~ Char => IsString (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Semigroup (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Monoid (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • NFData a => NFData (Seq a)Defined in containers-0.7 · Data.Sequence.Internal
  • Binary e => Binary (Seq e)Defined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable v => Hashable (Seq v)Defined in hashable-1.4.7.0 · Data.Hashable.Class
  • type Item (Seq a) = aDefined in containers-0.7 · Data.Sequence.Internal

hashable

0 declarations

Hashable

classclass Eq a => Hashable a where
#

The class of types that can be converted to a hash value.

Minimal implementation: hashWithSalt.

Hashable is intended exclusively for use in in-memory data structures. . Hashable does not have a fixed standard. This allows it to improve over time. . Because it does not have a fixed standard, different computers or computers on different versions of the code will observe different hash values. As such, Hashable is not recommended for use other than in-memory datastructures. Specifically, Hashable is not intended for network use or in applications which persist hashed values. For stable hashing use named hashes: sha256, crc32, xxhash etc.

If you are looking for Hashable instance in time package, check time-compat

Instances76Hashable, …

unordered-containers

0 declarations

HashMap

Re-exported from Data.HashMap.Strict:

datadata HashMap k v
#

A map from keys to values. A map cannot contain duplicate keys; each key can map to at most one value.

Instances27Bifoldable, Eq2, Ord2, Show2, NFData2, Hashable2, …
  • Bifoldable HashMapDefined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Eq2 HashMapDefined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Ord2 HashMapDefined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Show2 HashMapDefined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • NFData2 HashMapDefined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Hashable2 HashMapDefined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (Lift k, Lift v) => Lift (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Functor (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Foldable (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Traversable (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Eq k => Eq1 (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Ord k => Ord1 (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (Hashable k, Read k) => Read1 (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Show k => Show1 (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • NFData k => NFData1 (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Hashable k => Hashable1 (HashMap k)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Hashable k => IsList (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (Eq k, Eq v) => Eq (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal

    Note that, in the presence of hash collisions, equal HashMaps may behave differently, i.e. extensionality may be violated:

    Example2 expressions
    data D = A | B deriving (Eq, Show)instance Hashable D where hashWithSalt salt _d = salt
    Example2 expressions
    x = fromList [(A,1), (B,2)]y = fromList [(B,2), (A,1)]
    Example3 expressions
    x == yTruetoList x[(A,1),(B,2)]toList y[(B,2),(A,1)]

    In general, the lack of extensionality can be observed with any function that depends on the key ordering, such as folds and traversals.

  • (Data k, Data v, Hashable k) => Data (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (Ord k, Ord v) => Ord (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal

    The ordering is total and consistent with the Eq instance. However, nothing else about the ordering is specified, and it may change from version to version of either this package or of hashable.

  • (Hashable k, Read k, Read e) => Read (HashMap k e)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (Show k, Show v) => Show (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • Hashable k => Semigroup (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal

    <> = union

    If a key occurs in both maps, the mapping from the first will be the mapping in the result.

    Examples
    Example1 expression
    fromList [(1,'a'),(2,'b')] <> fromList [(2,'c'),(3,'d')]fromList [(1,'a'),(2,'b'),(3,'d')]
  • Hashable k => Monoid (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal

    mempty = empty

    mappend = union

    If a key occurs in both maps, the mapping from the first will be the mapping in the result.

    Examples
    Example1 expression
    mappend (fromList [(1,'a'),(2,'b')]) (fromList [(2,'c'),(3,'d')])fromList [(1,'a'),(2,'b'),(3,'d')]
  • (NFData k, NFData v) => NFData (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • (Hashable k, Hashable v) => Hashable (HashMap k v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal
  • type Item (HashMap k v) = (k, v)Defined in unordered-containers-0.2.21 · Data.HashMap.Internal

HashSet

Re-exported from Data.HashSet:

newtypenewtype HashSet a
#

A set of values. A set cannot contain duplicate values.

Instances18Foldable, Eq1, Ord1, Show1, NFData1, Hashable1, …
  • Foldable HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Eq1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Ord1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Show1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • NFData1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Hashable1 HashSetDefined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Lift a => Lift (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Hashable a => IsList (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Eq a => Eq (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal

    Note that, in the presence of hash collisions, equal HashSets may behave differently, i.e. extensionality may be violated:

    Example2 expressions
    data D = A | B deriving (Eq, Show)instance Hashable D where hashWithSalt salt _d = salt
    Example2 expressions
    x = fromList [A, B]y = fromList [B, A]
    Example3 expressions
    x == yTruetoList x[A,B]toList y[B,A]

    In general, the lack of extensionality can be observed with any function that depends on the key ordering, such as folds and traversals.

  • (Data a, Hashable a) => Data (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Ord a => Ord (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • (Hashable a, Read a) => Read (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Show a => Show (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Hashable a => Semigroup (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal

    <> = union

    O(n+m)

    To obtain good performance, the smaller set must be presented as the first argument.

    Examples
    Example1 expression
    fromList [1,2] <> fromList [2,3]fromList [1,2,3]
  • Hashable a => Monoid (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal

    mempty = empty

    mappend = union

    O(n+m)

    To obtain good performance, the smaller set must be presented as the first argument.

    Examples
    Example1 expression
    mappend (fromList [1,2]) (fromList [2,3])fromList [1,2,3]
  • NFData a => NFData (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • Hashable a => Hashable (HashSet a)Defined in unordered-containers-0.2.21 · Data.HashSet.Internal
  • type Item (HashSet a) = aDefined in unordered-containers-0.2.21 · Data.HashSet.Internal

primitive

0 declarations

PrimMonad

Re-exported from Control.Monad.Primitive:

classclass Monad m => PrimMonad (m :: Type -> Type) where
#

Class of monads which can perform primitive state-transformer actions.

Associated types

Instances19PrimMonad, …