A variant of foldlMap1 where the leftmost element maps to itself.
Moduleghc-10.0.0.20260917GHC2024
GHC.Prelude.Basic
Custom minimal GHC Prelude
This module serves as a replacement for the Prelude module and abstracts over differences between the bootstrapping GHC version, and may also provide a common default vocabulary.
- 17 types
- 25 classes
- 121 values
- Packageghc-10.0.0.20260917
- Exports163
- LanguageGHC2024
- LicenceBSD-3-Clause
- SourceBasic.hs
A variant of foldlMap1' where the leftmost element maps to itself.
Monadic fold over the elements of a non-empty structure, associating to the left, i.e. from left to right.
Map variant of foldlM1.
A variant of foldrMap1 where the rightmost element maps to itself.
A variant of foldrMap1' where the rightmost element maps to itself.
Monadic fold over the elements of a non-empty structure, associating to the right, i.e. from right to left.
Map variant of foldrM1.
Insert an m between each pair of t m.
intercalate1 ", " $ "hello" :| ["how", "are", "you"]"hello, how, are, you"
intercalate1 ", " $ "hello" :| []"hello"
intercalate1 mempty $ "I" :| ["Am", "Fine", "You?"]"IAmFineYou?"
The largest element of a non-empty structure with respect to the given comparison function. Structure order is used as a tie-breaker: if there are multiple largest elements, the rightmost of them is chosen.
The least element of a non-empty structure with respect to the given comparison function. Structure order is used as a tie-breaker: if there are multiple least elements, the leftmost of them is chosen.
is the function application operator.($)
Applying to a function ($)f and an argument x gives the same result as applying f to x directly. The definition is akin to this:
($) :: (a -> b) -> a -> b
($) f x = f x
This is id specialized from a -> a to (a -> b) -> (a -> b) which by the associativity of (->)
is the same as (a -> b) -> a -> b.
On the face of it, this may appear pointless! But it's actually one of the most useful and important operators in Haskell.
The order of operations is very different between ($) and normal function application. Normal function application has precedence 10 - higher than any operator - and associates to the left. So these two definitions are equivalent:
expr = min 5 1 + 5
expr = ((min 5) 1) + 5
($) has precedence 0 (the lowest) and associates to the right, so these are equivalent:
expr = min 5 $ 1 + 5
expr = (min 5) (1 + 5)
Examples
A common use cases of ($) is to avoid parentheses in complex expressions.
For example, instead of using nested parentheses in the following Haskell function:
-- | Sum numbers in a string: strSum "100 5 -7" == 98
strSum :: String -> Int
strSum s = sum (mapMaybe readMaybe (words s))
we can deploy the function application operator:
-- | Sum numbers in a string: strSum "100 5 -7" == 98
strSum :: String -> Int
strSum s = sum $ mapMaybe readMaybe $ words s
($) is also used as a section (a partially applied operator), in order to indicate that we wish to apply some yet-unspecified function to a given value. For example, to apply the argument 5 to a list of functions:
applyFive :: [Int]
applyFive = map ($ 5) [(+1), (2^)]
>>> [6, 32]
Technical Remark (Representation Polymorphism)
($) is fully representation-polymorphic. This allows it to also be used with arguments of unlifted and even unboxed kinds, such as unboxed integers:
fastMod :: Int -> Int -> Int
fastMod (I# x) (I# m) = I# $ remInt# x m
Strict (call-by-value) application operator. It takes a function and an argument, evaluates the argument to weak head normal form (WHNF), then calls the function with that value.
(++) appends two lists, i.e.,
[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]If the first list is not finite, the result is the first list.
Performance considerations
This function takes linear time in the number of elements of the
first list. Thus it is better to associate repeated
applications of (++) to the right (which is the default behaviour):
xs ++ (ys ++ zs) or simply xs ++ ys ++ zs, but not (xs ++ ys) ++ zs.
For the same reason GHC.Internal.Data.List.concat = GHC.Internal.Data.List.foldr (++) []
has linear performance, while GHC.Internal.Data.List.foldl (++) [] is prone
to quadratic slowdown
Examples
[1, 2, 3] ++ [4, 5, 6][1,2,3,4,5,6]
[] ++ [1, 2, 3][1,2,3]
[3, 2, 1] ++ [][3,2,1]
Right to left function composition.
(f . g) x = f (g x)f . id = f = id . fExamples
map ((*2) . length) [[], [0, 1, 2], [0]][0,6,2]
foldr (.) id [(+1), (*3), (^3)] 225
let (...) = (.).(.) in ((*2)...(+)) 5 1030
Same as >>=, but with the arguments interchanged.
as >>= f == f =<< asconst x y always evaluates to x, ignoring its second argument.
const x = \_ -> xThis function might seem useless at first glance, but it can be very useful in a higher order context.
Examples
const 42 "hello"42
map (const 42) [0..3][42,42,42,42]
flip f takes its (first) two arguments in the reverse order of f.
flip f x y = f y xflip . flip = idExamples
flip (++) "hello" "world""worldhello"
let (.>) = flip (.) in (+1) .> show $ 5"6"
Identity function.
id x = xThis function might seem useless at first glance, but it can be very useful in a higher order context.
Examples
length $ filter id [True, True, False, True]3
Just (Just 3) >>= idJust 3
foldr id 0 [(^3), (*5), (+2)]1000
\mathcal{O}(n). map f xs is the list obtained by applying f to
each element of xs, i.e.,
map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]this means that map id == id
Examples
map (+1) [1, 2, 3][2,3,4]
map id [1, 2, 3][1,2,3]
map (\n -> 3 * n + 1) [1, 2, 3][4,7,10]
until p f yields the result of applying f until p holds.
Boolean "and", lazy in the second argument
Boolean "not"
Boolean "or", lazy in the second argument
Case analysis for the Either type.
If the value is Left a, apply the first function to a;
if it is Right b, apply the second function to b.
Examples
We create two values of type Either , one using the
Left constructor and another using the Right constructor. Then
we apply "either" the String IntPrelude.length function (if we have a String)
or the "times-two" function (if we have an Int):
let s = Left "foo" :: Either String Intlet n = Right 3 :: Either String Inteither length (*2) s3either length (*2) n6
Determines whether all elements of the structure satisfy the predicate.
Examples
Basic usage:
all (> 3) []True
all (> 3) [1,2]False
all (> 3) [1,2,3,4,5]False
all (> 3) [1..]False
all (> 3) [4..]* Hangs forever *
and returns the conjunction of a container of Bools. For the result to be True, the container must be finite; False, however, results from a False value finitely far from the left end.
Examples
Basic usage:
and []True
and [True]True
and [False]False
and [True, True, False]False
and (False : repeat True) -- Infinite list [False,True,True,True,...False
and (repeat True)* Hangs forever *
Determines whether any element of the structure satisfies the predicate.
Examples
Basic usage:
any (> 3) []False
any (> 3) [1,2]False
any (> 3) [1,2,3,4,5]True
any (> 3) [1..]True
any (> 3) [0, -1..]* Hangs forever *
The concatenation of all the elements of a container of lists.
Examples
Basic usage:
concat (Just [1, 2, 3])[1,2,3]
concat (Left 42)[]
concat [[1, 2, 3], [4, 5], [6], []][1,2,3,4,5,6]
Map a function over all the elements of a container and concatenate the resulting lists.
Examples
Basic usage:
concatMap (take 3) [[1..], [10..], [100..], [1000..]][1,2,3,10,11,12,100,101,102,1000,1001,1002]
concatMap (take 3) (Just [1..])[1,2,3]
notElem is the negation of elem.
Examples
Basic usage:
3 `notElem` []True
3 `notElem` [1,2]True
3 `notElem` [1,2,3,4,5]False
For infinite structures, notElem terminates if the value exists at a finite distance from the left side of the structure:
3 `notElem` [1..]False
3 `notElem` ([4..] ++ [3])* Hangs forever *
or returns the disjunction of a container of Bools. For the result to be False, the container must be finite; True, however, results from a True value finitely far from the left end.
Examples
Basic usage:
or []False
or [True]True
or [False]False
or [True, True, False]True
or (True : repeat False) -- Infinite list [True,False,False,False,...True
or (repeat False)* Hangs forever *
Evaluate each monadic action in the structure from left to right,
and ignore the results. For a version that doesn't ignore the
results see Data.Traversable.sequence.
sequence_ is just like sequenceA_, but specialised to monadic actions.
An infix synonym for fmap.
The name of this operator is an allusion to Prelude.$.
Note the similarities between their types:
($) :: (a -> b) -> a -> b
(<$>) :: Functor f => (a -> b) -> f a -> f bWhereas Prelude.$ is function application, <$> is function
application lifted over a Functor.
Examples
Convert from a Maybe Int to a Maybe
String using show:
show <$> NothingNothing
show <$> Just 3Just "3"
Convert from an Either Int Int to an
Either Int String using show:
show <$> Left 17Left 17
show <$> Right 17Right "17"
Double each element of a list:
(*2) <$> [1,2,3][2,4,6]
Apply even to the second element of a pair:
even <$> (2,2)(2,True)
The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.
Examples
Basic usage:
maybe False odd (Just 3)True
maybe False odd NothingFalse
Read an integer from a string using readMaybe. If we succeed,
return twice the integer; that is, apply (*2) to it. If instead
we fail to parse an integer, return 0 by default:
import GHC.Internal.Text.Read ( readMaybe )maybe 0 (*2) (readMaybe "5")10maybe 0 (*2) (readMaybe "")0
Apply show to a Maybe Int. If we have Just n, we want to show
the underlying Int n. But if we have Nothing, we return the
empty string instead of (for example) "Nothing":
maybe "" show (Just 5)"5"maybe "" show Nothing""
Splits the argument into a list of lines stripped of their terminating
\n characters. The \n terminator is optional in a final non-empty
line of the argument string.
When the argument string is empty, or ends in a \n character, it can be
recovered by passing the result of lines to the unlines function.
Otherwise, unlines appends the missing terminating \n. This makes
unlines . lines idempotent:
(unlines . lines) . (unlines . lines) = (unlines . lines)Examples
lines "" -- empty input contains no lines[]
lines "\n" -- single empty line[""]
lines "one" -- single unterminated line["one"]
lines "one\n" -- single non-empty line["one"]
lines "one\n\n" -- second line is empty["one",""]
lines "one\ntwo" -- second line is unterminated["one","two"]
lines "one\ntwo\n" -- two non-empty lines["one","two"]
Appends a \n character to each input string, then concatenates the
results. Equivalent to .foldMap (s -> s ++ "\n")
Examples
unlines ["Hello", "World", "!"]"Hello\nWorld\n!\n"
Note that unlines . lines /= id when the input is not \n-terminated:
unlines . lines $ "foo\nbar""foo\nbar\n"
unwords joins words with separating spaces (U+0020 SPACE).
unwords is neither left nor right inverse of words:
words (unwords [" "])[]unwords (words "foo\nbar")"foo bar"
Examples
unwords ["Lorem", "ipsum", "dolor"]"Lorem ipsum dolor"
unwords ["foo", "bar", "", "baz"]"foo bar baz"
words breaks a string up into a list of words, which were delimited by white space (as defined by isSpace). This function trims any white spaces at the beginning and at the end.
Examples
words "Lorem ipsum\ndolor"["Lorem","ipsum","dolor"]
words " foo bar "["foo","bar"]
Convert an uncurried function to a curried function.
Examples
curry fst 1 21
Extract the first component of a pair.
Extract the second component of a pair.
uncurry converts a curried function to a function on pairs.
Examples
uncurry (+) (1,2)3
uncurry ($) (show, 1)"1"
map (uncurry max) [(1,2), (3,4), (6,8)][2,4,8]
error stops execution and displays an error message.
A variant of error that does not produce a stack trace.
List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type.
WARNING: This function is partial, and should only be used if you are
sure that the indexing will not fail. Otherwise, use Data.List.!?.
WARNING: This function takes linear time in the index.
Examples
['a', 'b', 'c'] !! 0'a'
['a', 'b', 'c'] !! 2'c'
['a', 'b', 'c'] !! 3*** Exception: Prelude.!!: index too large
['a', 'b', 'c'] !! (-1)*** Exception: Prelude.!!: negative index
break, applied to a predicate p and a list xs, returns a tuple where
first element is longest prefix (possibly empty) of xs of elements that
do not satisfy p and second element is the remainder of the list:
break p is equivalent to span (
and consequently to not . p)(takeWhile (,
even if not . p) xs, dropWhile (not . p) xs)p is _|_.
Laziness
break undefined []([],[])
fst (break (const True) undefined)*** Exception: Prelude.undefined
fst (break (const True) (undefined : undefined))[]
take 1 (fst (break (const False) (1 : undefined)))[1]
break produces the first component of the tuple lazily:
take 10 (fst (break (const False) [1..]))[1,2,3,4,5,6,7,8,9,10]
Examples
break (> 3) [1,2,3,4,1,2,3,4]([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3]([],[1,2,3])
break (> 9) [1,2,3]([1,2,3],[])
cycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.
Examples
cycle []*** Exception: Prelude.cycle: empty list
take 10 (cycle [42])[42,42,42,42,42,42,42,42,42,42]
take 10 (cycle [2, 5, 7])[2,5,7,2,5,7,2,5,7,2]
take 1 (cycle (42 : undefined))[42]
drop n xs returns the suffix of xs
after the first n elements, or [] if n >= length xs.
It is an instance of the more general genericDrop,
in which n may be of any integral type.
Examples
drop 6 "Hello World!""World!"
drop 3 [1,2,3,4,5][4,5]
drop 3 [1,2][]
drop 3 [][]
drop (-1) [1,2][1,2]
drop 0 [1,2][1,2]
\mathcal{O}(n). filter, applied to a predicate and a list, returns
the list of those elements that satisfy the predicate; i.e.,
filter p xs = [ x | x <- xs, p x]Examples
filter odd [1, 2, 3][1,3]
filter (\l -> length l > 3) ["Hello", ", ", "World", "!"]["Hello","World"]
filter (/= 3) [1, 2, 3, 4, 3, 2, 1][1,2,4,2,1]
iterate f x returns an infinite list of repeated applications
of f to x:
iterate f x == [x, f x, f (f x), ...]Laziness
Note that iterate is lazy, potentially leading to thunk build-up if the consumer doesn't force each element. See iterate' for a strict variant of this function.
let xs = iterate (\x -> if x == 0 then undefined else x - 1) 2xs[2,1,0,*** Exception: Prelude.undefinedlength (take 10 xs)10
In xs every element following 0 is bottom, but the list itself is
infinitely long because it is generated without forcing its elements.
Examples
take 10 $ iterate not True[True,False,True,False,True,False,True,False,True,False]
take 10 $ iterate (+3) 42[42,45,48,51,54,57,60,63,66,69]
iterate id == repeat:
take 10 $ iterate id 1[1,1,1,1,1,1,1,1,1,1]
\mathcal{O}(n). lookup key assocs looks up a key in an association
list.
For the result to be Nothing, the list must be finite.
Examples
lookup 2 []Nothing
lookup 2 [(1, "first")]Nothing
lookup 2 [(1, "first"), (2, "second"), (3, "third")]Just "second"
repeat x is an infinite list, with x the value of every element.
Examples
take 10 $ repeat 17[17,17,17,17,17,17,17,17,17, 17]
repeat undefined[*** Exception: Prelude.undefined
replicate n x is a list of length n with x the value of
every element.
It is an instance of the more general genericReplicate,
in which n may be of any integral type.
Examples
replicate 0 True[]
replicate (-1) True[]
replicate 4 True[True,True,True,True]
\mathcal{O}(n). reverse xs returns the elements of xs in reverse order.
xs must be finite.
Laziness
reverse is lazy in its elements.
head (reverse [undefined, 1])1
reverse (1 : 2 : undefined)*** Exception: Prelude.undefined
Examples
reverse [][]
reverse [42][42]
reverse [2,5,7][7,5,2]
reverse [1..]* Hangs forever *
\mathcal{O}(n). scanl is similar to foldl, but returns a list of
successive reduced values from the left:
scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]Note that
last (scanl f z xs) == foldl f z xsExamples
scanl (+) 0 [1..4][0,1,3,6,10]
scanl (+) 42 [][42]
scanl (-) 100 [1..4][100,99,97,94,90]
scanl (\reversedString nextChar -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']["foo","afoo","bafoo","cbafoo","dcbafoo"]
take 10 (scanl (+) 0 [1..])[0,1,3,6,10,15,21,28,36,45]
take 1 (scanl undefined 'a' undefined)"a"
\mathcal{O}(n). scanl1 is a variant of scanl that has no starting
value argument:
scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]Examples
scanl1 (+) [1..4][1,3,6,10]
scanl1 (+) [][]
scanl1 (-) [1..4][1,-1,-4,-8]
scanl1 (&&) [True, False, True, True][True,False,False,False]
scanl1 (||) [False, False, True, True][False,False,True,True]
take 10 (scanl1 (+) [1..])[1,3,6,10,15,21,28,36,45,55]
take 1 (scanl1 undefined ('a' : undefined))"a"
\mathcal{O}(n). scanr is the right-to-left dual of scanl. Note that the order of parameters on the accumulating function are reversed compared to scanl.
Also note that
head (scanr f z xs) == foldr f z xs.Examples
scanr (+) 0 [1..4][10,9,7,4,0]
scanr (+) 42 [][42]
scanr (-) 100 [1..4][98,-97,99,-96,100]
scanr (\nextChar reversedString -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']["abcdfoo","bcdfoo","cdfoo","dfoo","foo"]
force $ scanr (+) 0 [1..]*** Exception: stack overflow
\mathcal{O}(n). scanr1 is a variant of scanr that has no starting
value argument.
Examples
scanr1 (+) [1..4][10,9,7,4]
scanr1 (+) [][]
scanr1 (-) [1..4][-2,3,-1,4]
scanr1 (&&) [True, False, True, True][False,False,True,True]
scanr1 (||) [True, True, False, False][True,True,False,False]
force $ scanr1 (+) [1..]*** Exception: stack overflow
span, applied to a predicate p and a list xs, returns a tuple where
first element is the longest prefix (possibly empty) of xs of elements that
satisfy p and second element is the remainder of the list:
span p xs is equivalent to (takeWhile p xs, dropWhile p xs), even if p is _|_.
Laziness
span undefined []([],[])fst (span (const False) undefined)*** Exception: Prelude.undefinedfst (span (const False) (undefined : undefined))[]take 1 (fst (span (const True) (1 : undefined)))[1]
span produces the first component of the tuple lazily:
take 10 (fst (span (const True) [1..]))[1,2,3,4,5,6,7,8,9,10]
Examples
span (< 3) [1,2,3,4,1,2,3,4]([1,2],[3,4,1,2,3,4])
span (< 9) [1,2,3]([1,2,3],[])
span (< 0) [1,2,3]([],[1,2,3])
splitAt n xs returns a tuple where first element is xs prefix of
length n and second element is the remainder of the list:
splitAt is an instance of the more general genericSplitAt,
in which n may be of any integral type.
Laziness
It is equivalent to (take n xs, drop n xs)
unless n is _|_:
splitAt _|_ xs = _|_, not (_|_, _|_)).
The first component of the tuple is produced lazily:
fst (splitAt 0 undefined)[]
take 1 (fst (splitAt 10 (1 : undefined)))[1]
Examples
splitAt 6 "Hello World!"("Hello ","World!")
splitAt 3 [1,2,3,4,5]([1,2,3],[4,5])
splitAt 1 [1,2,3]([1],[2,3])
splitAt 3 [1,2,3]([1,2,3],[])
splitAt 4 [1,2,3]([1,2,3],[])
splitAt 0 [1,2,3]([],[1,2,3])
splitAt (-1) [1,2,3]([],[1,2,3])
take n, applied to a list xs, returns the prefix of xs
of length n, or xs itself if n >= length xs.
It is an instance of the more general genericTake,
in which n may be of any integral type.
Laziness
take 0 undefined[]take 2 (1 : 2 : undefined)[1,2]
Examples
take 5 "Hello World!""Hello"
take 3 [1,2,3,4,5][1,2,3]
take 3 [1,2][1,2]
take 3 [][]
take (-1) [1,2][]
take 0 [1,2][]
takeWhile, applied to a predicate p and a list xs, returns the
longest prefix (possibly empty) of xs of elements that satisfy p.
Laziness
takeWhile (const False) undefined*** Exception: Prelude.undefined
takeWhile (const False) (undefined : undefined)[]
take 1 (takeWhile (const True) (1 : undefined))[1]
Examples
takeWhile (< 3) [1,2,3,4,1,2,3,4][1,2]
takeWhile (< 9) [1,2,3][1,2,3]
takeWhile (< 0) [1,2,3][]
\mathcal{O}(\min(m,n)). zip takes two lists and returns a list of
corresponding pairs.
zip is right-lazy:
zip [] undefined[]zip undefined []*** Exception: Prelude.undefined...
zip is capable of list fusion, but it is restricted to its first list argument and its resulting list.
Examples
zip [1, 2, 3] ['a', 'b', 'c'][(1,'a'),(2,'b'),(3,'c')]
If one input list is shorter than the other, excess elements of the longer list are discarded, even if one of the lists is infinite:
zip [1] ['a', 'b'][(1,'a')]
zip [1, 2] ['a'][(1,'a')]
zip [] [1..][]
zip [1..] [][]
\mathcal{O}(\min(m,n)). zipWith generalises zip by zipping with the
function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys
zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]zipWith is right-lazy:
let f = undefinedzipWith f [] undefined[]
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.
Examples
zipWith can be applied to two lists to produce the list of
corresponding sums:(+)
zipWith (+) [1, 2, 3] [4, 5, 6][5,7,9]
zipWith (++) ["hello ", "foo"] ["world!", "bar"]["hello world!","foobar"]
\mathcal{O}(\min(l,m,n)). The zipWith3 function takes a function which combines three
elements, as well as three lists and returns a list of the function applied
to corresponding elements, analogous to zipWith.
It is capable of list fusion, but it is restricted to its
first list argument and its resulting list.
zipWith3 (,,) xs ys zs == zip3 xs ys zs
zipWith3 f [x1,x2,x3..] [y1,y2,y3..] [z1,z2,z3..] == [f x1 y1 z1, f x2 y2 z2, f x3 y3 z3..]Examples
zipWith3 (\x y z -> [x, y, z]) "123" "abc" "xyz"["1ax","2by","3cz"]
zipWith3 (\x y z -> (x * y) + z) [1, 2, 3] [4, 5, 6] [7, 8, 9][11,18,27]
The lex function reads a single lexeme from the input, discarding
initial white space, and returning the characters that constitute the
lexeme. If the input string contains only white space, lex returns a
single successful `lexeme' consisting of the empty string. (Thus
lex "" = [("","")].) If there is no legal lexeme at the
beginning of the input string, lex fails (i.e. returns []).
This lexer is not completely faithful to the Haskell lexical syntax in the following respects:
Qualified names are not handled properly
Octal and hexadecimal numerics are not recognized as a single token
Comments are not treated properly
raise a number to a non-negative integral power
raise a number to an integral power
General coercion from Integral types.
WARNING: This function performs silent truncation if the result type is not at least as big as the argument's type.
gcd x y is the non-negative factor of both x and y of which
every common factor of x and y is also a factor; for example
gcd 4 2 = 2, gcd (-4) 6 = 2, gcd 0 4 = 4. gcd 0 0 = 0.
(That is, the common divisor that is "greatest" in the divisibility
preordering.)
Note: Since for signed fixed-width integer types, abs minBound < 0,
the result may be negative if one of the arguments is minBound (and
necessarily is if the other is 0 or minBound) for such types.
lcm x y is the smallest positive integer that both x and y divide.
General coercion to Fractional types.
utility function converting a Char to a show function that simply prepends the character unchanged.
utility function that surrounds the inner show function with
parentheses when the Bool parameter is True.
utility function converting a String to a show function that simply prepends the string unchanged.
equivalent to showsPrec with a precedence of 0.
The computation appendFile file str function appends the string str,
to the file file.
Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first.
This operation may fail with the same errors as hPutStr and withFile.
Examples
The following example could be more efficently written by acquiring a handle instead with openFile and using the computations capable of writing to handles such as hPutStr.
let fn = "hello_world"in writeFile fn "hello" >> appendFile fn " world!" >> (readFile fn >>= putStrLn)"hello world!"
let fn = "foo"; output = readFile' fn >>= putStrLnin output >> appendFile fn (show [1,2,3]) >> outputthis is what's in the filethis is what's in the file[1,2,3]
The getContents operation returns all user input as a single string, which is read lazily as it is needed.
getContents is implemented as hGetContents stdin.
This operation may fail with the same errors as hGetContents.
Examples
getContents >>= putStr> aaabbbccc :Daaabbbccc :D> I hope you have a great dayI hope you have a great day> ^D
getContents >>= print . length> abc> <3> def ^D11
interact f takes the entire input from stdin and applies f to it.
The resulting string is written to the stdout device.
Note that this operation is lazy, which allows to produce output even before all input has been consumed.
This operation may fail with the same errors as getContents and putStr.
If it doesn't produce output the buffering settings may not be correct, use ^D (ctrl+D) to close stdin which forces the buffer to be consumed.
You may wish to set the buffering style appropriate to your program's needs before using this function, for example:
main :: IO ()
main = do
hSetBuffering stdin LineBuffering
hSetBuffering stdout NoBuffering
interact (concatMap (str -> str ++ str) . L.lines)
Examples
interact (\str -> str ++ str)> hi :)hi :)> ^Dhi :)
interact (const ":D"):D
interact (show . words)> hello world!> I hope you have a great day> ^D["hello","world!","I","hope","you","have","a","great","day"]
The print function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class Show; print converts values to strings for output using the show operation and adds a newline.
print is implemented as putStrLn . show
This operation may fail with the same errors, and has the same issues with concurrency, as hPutStr!
Examples
print [1, 2, 3][1,2,3]
Be careful when using print for outputting strings, as this will invoke show and cause strings to be printed with quotation marks and non-ascii symbols escaped.
print "λ :D""\995 :D"
A program to print the first 8 integers and their powers of 2 could be written as:
print [(n, 2^n) | n <- [0..8]][(0,1),(1,2),(2,4),(3,8),(4,16),(5,32),(6,64),(7,128),(8,256)]
Write a string to the standard output device
putStr is implemented as hPutStr stdout.
This operation may fail with the same errors, and has the same issues with concurrency, as hPutStr!
Examples
Note that the following do not put a newline.
putStr "Hello, World!"Hello, World!
putStr "\0052\0042\0050"4*2
The readFile function reads a file and returns the contents of the file as a string.
The file is read lazily, on demand, as with getContents.
This operation may fail with the same errors as hGetContents and openFile.
Examples
readFile "~/hello_world""Greetings!"
take 5 <$> readFile "/dev/zero""\NUL\NUL\NUL\NUL\NUL"
The readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program.
This operation may fail with:
isUserError if there is no unambiguous parse.
Examples
fmap (+ 1) (readIO "1")2
readIO "not quite ()" :: IO ()*** Exception: user error (Prelude.readIO: no parse)
The computation writeFile file str function writes the string str,
to the file file.
This operation may fail with the same errors as hPutStr and withFile.
Examples
writeFile "hello" "world" >> readFile "hello""world"
writeFile "~/" "D:"*** Exception: ~/: withFile: inappropriate type (Is a directory)
The read function reads input from a string, which must be
completely consumed by the input process. read fails with an error if the
parse is unsuccessful, and it is therefore discouraged from being used in
real applications. Use readMaybe or readEither for safe alternatives.
read "123" :: Int123
read "hello" :: Int*** Exception: Prelude.read: no parse
equivalent to readsPrec with a precedence of 0.
The value of is bottom if seq a ba is bottom, and
otherwise equal to b. In other words, it evaluates the first
argument a to weak head normal form (WHNF). seq is usually
introduced to improve performance by avoiding unneeded laziness.
A note on evaluation order: the expression does
not guarantee that seq a ba will be evaluated before b.
The only guarantee given by seq is that the both a
and b will be evaluated before seq returns a value.
In particular, this means that b may be evaluated before
a. If you need to guarantee a specific order of evaluation,
you must use the function pseq from the "parallel" package.
Non-empty data structures that can be folded.
Methods
fold1 :: Semigroup m => t m -> mfoldMap1 :: Semigroup m => (a -> m) -> t a -> mfoldMap1' :: Semigroup m => (a -> m) -> t a -> mtoNonEmpty :: t a -> NonEmpty aNonEmpty list of elements of a structure, from left to right.
Example1 expression toNonEmpty (Identity 2)2 :| []
maximum :: Ord a => t a -> aThe largest element of a non-empty structure. This function is equivalent to
foldr1 max, and its behavior on structures with multiple largest elements depends on the relevant implementation of max. For the default implementation of max (max x y = if x <= y then y else x), structure order is used as a tie-breaker: if there are multiple largest elements, the rightmost of them is chosen (this is equivalent tomaximumBy compare).Example1 expression maximum (32 :| [64, 8, 128, 16])128
minimum :: Ord a => t a -> aThe least element of a non-empty structure. This function is equivalent to
foldr1 min, and its behavior on structures with multiple largest elements depends on the relevant implementation of min. For the default implementation of min (min x y = if x <= y then x else y), structure order is used as a tie-breaker: if there are multiple least elements, the leftmost of them is chosen (this is equivalent tominimumBy compare).Example1 expression minimum (32 :| [64, 8, 128, 16])8
foldrMap1 :: (a -> b) -> (a -> b -> b) -> t a -> bRight-associative fold of a structure, lazy in the accumulator.
In case of NonEmpty lists, foldrMap1, when given a function
f, a binary operatorg, and a list, reduces the list usinggfrom right to left applyingfto the rightmost element:foldrMap1 f g (x1 :| [x2, ..., xn1, xn]) == x1 `g` (x2 `g` ... (xn1 `g` (f xn))...)Note that since the head of the resulting expression is produced by an application of
gto the first element of the list, ifgis lazy in its right argument, foldrMap1 can produce a terminating expression from an unbounded list.For a general Foldable1 structure this should be semantically identical to:
foldrMap1 f g = foldrMap1 f g . toNonEmptyfoldlMap1' :: (a -> b) -> (b -> a -> b) -> t a -> bLeft-associative fold of a structure but with strict application of the operator.
This ensures that each step of the fold is forced to Weak Head Normal Form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite structure to a single strict result.
For a general Foldable1 structure this should be semantically identical to:
foldlMap1' f z = foldlMap1' f z . toNonEmptyfoldlMap1 :: (a -> b) -> (b -> a -> b) -> t a -> bLeft-associative fold of a structure, lazy in the accumulator. This is rarely what you want, but can work well for structures with efficient right-to-left sequencing and an operator that is lazy in its left argument.
In case of NonEmpty lists, foldlMap1, when given a function
f, a binary operatorg, and a list, reduces the list usinggfrom left to right applyingfto the leftmost element:foldlMap1 f g (x1 :| [x2, ..., xn]) == (...(((f x1) `g` x2) `g`...) `g` xnNote that to produce the outermost application of the operator the entire input list must be traversed. This means that foldlMap1 will diverge if given an infinite list.
If you want an efficient strict left-fold, you probably want to use foldlMap1' instead of foldlMap1. The reason for this is that the latter does not force the inner results (e.g.
(f x1) `g` x2in the above example) before applying them to the operator (e.g. to(`g` x3)). This results in a thunk chainO(n)elements long, which then must be evaluated from the outside-in.For a general Foldable1 structure this should be semantically identical to:
foldlMap1 f g = foldlMap1 f g . toNonEmptyfoldrMap1' :: (a -> b) -> (a -> b -> b) -> t a -> bfoldrMap1' is a variant of foldrMap1 that performs strict reduction from right to left, i.e. starting with the right-most element. The input structure must be finite, otherwise foldrMap1' runs out of space (diverges).
If you want a strict right fold in constant space, you need a structure that supports faster than
O(n)access to the right-most element.This method does not run in constant space for structures such as NonEmpty lists that don't support efficient right-to-left iteration and so require
O(n)space to perform right-to-left reduction. Use of this method with such a structure is a hint that the chosen structure may be a poor fit for the task at hand. If the order in which the elements are combined is not important, use foldlMap1' instead.
Instances33Foldable1, …
Foldable1 ComplexDefined in base-4.23.0.0 · Data.Foldable1Foldable1 FirstDefined in base-4.23.0.0 · Data.Foldable1Foldable1 LastDefined in base-4.23.0.0 · Data.Foldable1Foldable1 MaxDefined in base-4.23.0.0 · Data.Foldable1Foldable1 MinDefined in base-4.23.0.0 · Data.Foldable1Foldable1 SCCDefined in containers-0.8 · Data.GraphFoldable1 PostOrderDefined in containers-0.8 · Data.TreeFoldable1 TreeDefined in containers-0.8 · Data.TreeFolds in pre-order.
Foldable1 PairDefined in ghc-10.0.0.20260917 · GHC.Data.PairFoldable1 NonEmptyDefined in base-4.23.0.0 · Data.Foldable1Foldable1 IdentityDefined in base-4.23.0.0 · Data.Foldable1Foldable1 DownDefined in base-4.23.0.0 · Data.Foldable1Foldable1 DualDefined in base-4.23.0.0 · Data.Foldable1Foldable1 ProductDefined in base-4.23.0.0 · Data.Foldable1Foldable1 SumDefined in base-4.23.0.0 · Data.Foldable1Foldable1 Par1Defined in base-4.23.0.0 · Data.Foldable1Foldable1 SoloDefined in base-4.23.0.0 · Data.Foldable1Foldable1 V1Defined in base-4.23.0.0 · Data.Foldable1Foldable1 (Tuple2 a)Defined in base-4.23.0.0 · Data.Foldable1Foldable1 f => Foldable1 (Lift f)Defined in transformers-0.6.3.0 · Control.Applicative.LiftFoldable1 f => Foldable1 (Ap f)Defined in base-4.23.0.0 · Data.Foldable1Foldable1 f => Foldable1 (Alt f)Defined in base-4.23.0.0 · Data.Foldable1Foldable1 f => Foldable1 (Rec1 f)Defined in base-4.23.0.0 · Data.Foldable1Foldable1 f => Foldable1 (Backwards f)Defined in transformers-0.6.3.0 · Control.Applicative.BackwardsDerived instance.
Foldable1 f => Foldable1 (Reverse f)Defined in transformers-0.6.3.0 · Data.Functor.ReverseFold from right to left.
Foldable1 m => Foldable1 (IdentityT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Identity(Foldable1 f, Foldable1 g) => Foldable1 (Product f g)Defined in base-4.23.0.0 · Data.Foldable1(Foldable1 f, Foldable1 g) => Foldable1 (Sum f g)Defined in base-4.23.0.0 · Data.Foldable1(Foldable1 f, Foldable1 g) => Foldable1 (f :*: g)Defined in base-4.23.0.0 · Data.Foldable1(Foldable1 f, Foldable1 g) => Foldable1 (f :+: g)Defined in base-4.23.0.0 · Data.Foldable1Foldable1 f => Foldable1 (M1 i c f)Defined in base-4.23.0.0 · Data.Foldable1(Foldable1 f, Foldable1 g) => Foldable1 (Compose f g)Defined in base-4.23.0.0 · Data.Foldable1(Foldable1 f, Foldable1 g) => Foldable1 (f :.: g)Defined in base-4.23.0.0 · Data.Foldable1
A type f is a Functor if it provides a function fmap which, given any types a and b
lets you apply any function from (a -> b) to turn an f a into an f b, preserving the
structure of f. Furthermore f needs to adhere to the following:
Note, that the second law follows from the free theorem of the type fmap and the first law, so you need only check that the former condition holds. See these articles by School of Haskell or David Luposchainsky for an explanation.
Methods
fmap :: (a -> b) -> f a -> f bfmap is used to apply a function of type
(a -> b)to a value of typef a, where f is a functor, to produce a value of typef b. Note that for any type constructor with more than one parameter (e.g.,Either), only the last type parameter can be modified with fmap (e.g.,binEither a b).Some type constructors with two parameters or more have a
Bifunctorinstance that allows both the last and the penultimate parameters to be mapped over.Examples
Convert from a
Maybe Intto aMaybe Stringusing show:Example2 expressions fmap show NothingNothingfmap show (Just 3)Just "3"
Convert from an
Either Int Intto anEither Int Stringusing show:Example2 expressions fmap show (Left 17)Left 17fmap show (Right 17)Right "17"
Double each element of a list:
Example1 expression fmap (*2) [1,2,3][2,4,6]
Apply even to the second element of a pair:
Example1 expression fmap even (2,2)(2,True)
It may seem surprising that the function is only applied to the last element of the tuple compared to the list example above which applies it to every element in the list. To understand, remember that tuples are type constructors with multiple type parameters: a tuple of 3 elements
(a,b,c)can also be written(,,) a b cand itsFunctorinstance is defined forFunctor ((,,) a b)(i.e., only the third parameter is free to be mapped over withfmap).It explains why
fmapcan be used with tuples containing values of different types as in the following example:Example1 expression fmap even ("hello", 1.0, 4)("hello",1.0,True)
(<$) :: a -> f b -> f ainfixl 4Replace all locations in the input with the same value. The default definition is
fmap . const, but this may be overridden with a more efficient version.Examples
Perform a computation with Maybe and replace the result with a constant value if it is Just:
Example2 expressions 'a' <$ Just 2Just 'a''a' <$ NothingNothing
Instances273Functor, …
Functor ComplexDefined in base-4.23.0.0 · Data.ComplexFunctor FirstDefined in base-4.23.0.0 · Data.SemigroupFunctor LastDefined in base-4.23.0.0 · Data.SemigroupFunctor MaxDefined in base-4.23.0.0 · Data.SemigroupFunctor MinDefined in base-4.23.0.0 · Data.SemigroupFunctor ArgDescrDefined in base-4.23.0.0 · System.Console.GetOptFunctor ArgOrderDefined in base-4.23.0.0 · System.Console.GetOptFunctor OptDescrDefined in base-4.23.0.0 · System.Console.GetOptFunctor DecoderDefined in binary-0.8.9.3 · Data.Binary.Get.InternalFunctor GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalFunctor PutMDefined in binary-0.8.9.3 · Data.Binary.PutFunctor PutDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalFunctor SCCDefined in containers-0.8 · Data.GraphFunctor IntMapDefined in containers-0.8 · Data.IntMap.InternalFunctor DigitDefined in containers-0.8 · Data.Sequence.InternalFunctor ElemDefined in containers-0.8 · Data.Sequence.InternalFunctor FingerTreeDefined in containers-0.8 · Data.Sequence.InternalFunctor NodeDefined in containers-0.8 · Data.Sequence.InternalFunctor SeqDefined in containers-0.8 · Data.Sequence.InternalFunctor ViewLDefined in containers-0.8 · Data.Sequence.InternalFunctor ViewRDefined in containers-0.8 · Data.Sequence.InternalFunctor PostOrderDefined in containers-0.8 · Data.TreeFunctor TreeDefined in containers-0.8 · Data.TreeFunctor InspectAsmDefined in ghc-10.0.0.20260917 · GHC.ByteCode.AsmFunctor OneOrTwoDefined in ghc-10.0.0.20260917 · GHC.ByteCode.AsmFunctor RunAsmDefined in ghc-10.0.0.20260917 · GHC.ByteCode.AsmFunctor GenBasicBlockDefined in ghc-10.0.0.20260917 · GHC.CmmFunctor ListGraphDefined in ghc-10.0.0.20260917 · GHC.CmmFunctor LabelMapDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelFunctor CmmOptMDefined in ghc-10.0.0.20260917 · GHC.Cmm.GenericOptFunctor CmmLintDefined in ghc-10.0.0.20260917 · GHC.Cmm.LintFunctor PDDefined in ghc-10.0.0.20260917 · GHC.Cmm.Parser.MonadFunctor NatMDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.MonadFunctor InstrSRDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.LivenessFunctor LiveInstrDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.LivenessFunctor WasmAsmMDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.AsmFunctor TEDefined in ghc-10.0.0.20260917 · GHC.CmmToCFunctor LlvmMDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.BaseFunctor NormaliseStepResultDefined in ghc-10.0.0.20260917 · GHC.Core.CoercionFunctor NormMDefined in ghc-10.0.0.20260917 · GHC.Core.FamInstEnvFunctor LintMDefined in ghc-10.0.0.20260917 · GHC.Core.LintFunctor AltMapDefined in ghc-10.0.0.20260917 · GHC.Core.Map.ExprFunctor CoreMapDefined in ghc-10.0.0.20260917 · GHC.Core.Map.ExprFunctor CoreMapXDefined in ghc-10.0.0.20260917 · GHC.Core.Map.ExprFunctor BndrMapDefined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeFunctor CoercionMapDefined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeFunctor CoercionMapXDefined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeFunctor LooseTypeMapDefined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeFunctor TyLitMapDefined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeFunctor TypeMapDefined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeFunctor TypeMapXDefined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeFunctor VarMapDefined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeFunctor RuleMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.ConstantFoldFunctor CoreMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.MonadFunctor SimplMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.Simplify.MonadFunctor RoughMapDefined in ghc-10.0.0.20260917 · GHC.Core.RoughMapFunctor UMDefined in ghc-10.0.0.20260917 · GHC.Core.UnifyFunctor UnifyResultMDefined in ghc-10.0.0.20260917 · GHC.Core.UnifyFunctor CtsMDefined in ghc-10.0.0.20260917 · GHC.CoreToStgFunctor BagDefined in ghc-10.0.0.20260917 · GHC.Data.BagFunctor FlatBagDefined in ghc-10.0.0.20260917 · GHC.Data.FlatBagFunctor NullCollapseVizDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.CollapseFunctor InfiniteDefined in ghc-10.0.0.20260917 · GHC.Data.List.InfiniteFunctor OrdListDefined in ghc-10.0.0.20260917 · GHC.Data.OrdListFunctor PairDefined in ghc-10.0.0.20260917 · GHC.Data.PairFunctor MaybeDefined in ghc-10.0.0.20260917 · GHC.Data.StrictFunctor Word64MapDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalFunctor KnotVarsDefined in ghc-10.0.0.20260917 · GHC.Driver.Env.KnotVarsFunctor HscDefined in ghc-10.0.0.20260917 · GHC.Driver.Env.TypesFunctor ModNodeMapDefined in ghc-10.0.0.20260917 · GHC.Driver.MakeFunctor ResultVarDefined in ghc-10.0.0.20260917 · GHC.Driver.MakeFunctor GhcDefined in ghc-10.0.0.20260917 · GHC.Driver.MonadFunctor HookedUseDefined in ghc-10.0.0.20260917 · GHC.Driver.Pipeline.ExecuteFunctor MatchResultDefined in ghc-10.0.0.20260917 · GHC.HsToCore.MonadFunctor CheckActionDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.CheckFunctor CheckResultDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.TypesFunctor TMDefined in ghc-10.0.0.20260917 · GHC.HsToCore.TicksFunctor HieASTDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFunctor HieASTsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFunctor HieArgsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFunctor HieTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFunctor IdentifierDetailsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFunctor NodeInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFunctor SourcedNodeInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFunctor EvidenceInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.UtilsFunctor MaybeValidatedDefined in ghc-10.0.0.20260917 · GHC.Iface.RecompFunctor DFFVDefined in ghc-10.0.0.20260917 · GHC.Iface.TidyFunctor LinkableWithDefined in ghc-10.0.0.20260917 · GHC.Linker.TypesFunctor EpAnnDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationFunctor PDefined in ghc-10.0.0.20260917 · GHC.Parser.LexerFunctor PVDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcessFunctor PV_ResultDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcessFunctor HdkADefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockFunctor HdkMDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockFunctor CpsRnDefined in ghc-10.0.0.20260917 · GHC.Rename.PatFunctor TPRnMDefined in ghc-10.0.0.20260917 · GHC.Rename.PatFunctor ConAppMapDefined in ghc-10.0.0.20260917 · GHC.Stg.CSEFunctor StgArgMapDefined in ghc-10.0.0.20260917 · GHC.Stg.CSEFunctor RMDefined in ghc-10.0.0.20260917 · GHC.Stg.EnforceEpt.RewriteFunctor LiftMDefined in ghc-10.0.0.20260917 · GHC.Stg.Lift.MonadFunctor LintMDefined in ghc-10.0.0.20260917 · GHC.Stg.LintFunctor StgMDefined in ghc-10.0.0.20260917 · GHC.Stg.PipelineFunctor BcMDefined in ghc-10.0.0.20260917 · GHC.StgToByteCodeFunctor CmmParseDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.ExtCodeFunctor FCodeDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.MonadFunctor BranchDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ExprFunctor KindRepMDefined in ghc-10.0.0.20260917 · GHC.Tc.Instance.TypeableFunctor SolverStageDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.MonadFunctor StopOrContinueDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.MonadFunctor TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.MonadFunctor RewriteMDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.RewriteFunctor RoleMDefined in ghc-10.0.0.20260917 · GHC.Tc.TyCl.UtilsFunctor SynCycleMDefined in ghc-10.0.0.20260917 · GHC.Tc.TyCl.UtilsFunctor TcPluginMDefined in ghc-10.0.0.20260917 · GHC.Tc.TypesFunctor ZonkMDefined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.MonadFunctor AnnTargetDefined in ghc-10.0.0.20260917 · GHC.Types.AnnotationsFunctor TyConFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.BasicFunctor MessagesDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorFunctor MsgEnvelopeDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorFunctor OccEnvDefined in ghc-10.0.0.20260917 · GHC.Types.Name.OccurrenceFunctor WithUserRdrDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderFunctor TaggedValDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.DFMFunctor UniqDSMDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSMFunctor UniqSMDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SupplyFunctor UnitEnvGraphDefined in ghc-10.0.0.20260917 · GHC.Unit.Home.GraphFunctor NodeMapDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphFunctor DefiniteDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesFunctor GenModuleDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesFunctor GenWithIsBootDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesFunctor BinaryReaderDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryFunctor FingerprintWithValueDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryFunctor Validity'Defined in ghc-10.0.0.20260917 · GHC.Utils.ErrorFunctor DataDefnConsDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.DeclsFunctor PprMDefined in ghc-boot-th-10.0.0.20260917 · GHC.Boot.TH.PprLibFunctor NonEmptyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.NonEmpty · orphanFunctor HandlerDefined in ghc-internal-10.0.0 · GHC.Internal.Control.ExceptionFunctor IdentityDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityFunctor FirstDefined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidFunctor LastDefined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidFunctor DownDefined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdFunctor DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFunctor ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFunctor SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFunctor ZipListDefined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListFunctor NoIODefined in ghc-internal-10.0.0 · GHC.Internal.GHCiFunctor Par1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor GenClosureDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresFunctor GenStackFieldDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresFunctor GenStackFrameDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresFunctor GenStgStackClosureDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresFunctor MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor STMDefined in ghc-internal-10.0.0 · GHC.Internal.STMFunctor QDefined in ghc-internal-10.0.0 · GHC.Internal.TH.MonadFunctor TyVarBndrDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxFunctor PDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPFunctor ReadPDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPFunctor ReadPrecDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPrecFunctor SoloDefined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor IODefined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor MDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.MonadFunctor GHCiQDefined in ghci-10.0.0.20260917 · GHCi.THFunctor AnnotDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJFunctor DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJFunctor SpanDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJFunctor STMDefined in stm-2.5.3.1 · Control.Sequential.STMFunctor []Defined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor ProxyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyFunctor U1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor V1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (Arg a)Defined in base-4.23.0.0 · Data.SemigroupFunctor (Map k)Defined in containers-0.8 · Data.Map.InternalFunctor (State s)Defined in containers-0.8 · Utils.Containers.Internal.StateFunctor (MaybeO ex)Defined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.BlockFunctor (RegAllocStats statics)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.StatsFunctor (RegM freeRegs)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.StateFunctor (WasmCodeGenM w)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesFunctor (Node key)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.DirectedFunctor (Gr a)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.PatriciaTreeFunctor (IOEnv env)Defined in ghc-10.0.0.20260917 · GHC.Data.IOEnvFunctor (MaybeErr err)Defined in ghc-10.0.0.20260917 · GHC.Data.MaybeFunctor (Pair a)Defined in ghc-10.0.0.20260917 · GHC.Data.StrictFunctor (CmdLineP s)Defined in ghc-10.0.0.20260917 · GHC.Driver.SessionFunctor (IfaceBindingX r)Defined in ghc-10.0.0.20260917 · GHC.Iface.SyntaxFunctor (PuResult a)Defined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifyFunctor (ZonkBndrT m)Defined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.EnvFunctor (CvtM' err)Defined in ghc-10.0.0.20260917 · GHC.ThToHsFunctor (GenLocated l)Defined in ghc-10.0.0.20260917 · GHC.Types.SrcLocFunctor (UniqMap k)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.MapFunctor (Codensity k)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.CodensityFunctor (State s)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.State.StrictFunctor (HsFieldBind lhs)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.PatFunctor (DbOpenMode mode)Defined in ghc-boot-10.0.0.20260917 · GHC.Unit.DatabaseFunctor (Array i)Defined in ghc-internal-10.0.0 · GHC.Internal.ArrFunctor (ST s)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpFunctor (Either a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.EitherFunctor (StateL s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsFunctor (StateR s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsFunctor (ST s)Defined in ghc-internal-10.0.0 · GHC.Internal.STFunctor (Tuple2 a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor (IParser t)Defined in text-2.1.4 · Data.Text.Internal.ReadFunctor f => Functor (Lift f)Defined in transformers-0.6.3.0 · Control.Applicative.LiftFunctor m => Functor (GenMap m)Defined in ghc-10.0.0.20260917 · GHC.Data.TrieMapFunctor m => Functor (ListMap m)Defined in ghc-10.0.0.20260917 · GHC.Data.TrieMapFunctor m => Functor (MaybeMap m)Defined in ghc-10.0.0.20260917 · GHC.Data.TrieMapFunctor m => Functor (EwM m)Defined in ghc-10.0.0.20260917 · GHC.Driver.CmdLineFunctor m => Functor (GhcT m)Defined in ghc-10.0.0.20260917 · GHC.Driver.MonadFunctor m => Functor (ZonkT m)Defined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.EnvFunctor m => Functor (UniqDSMT m)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSMFunctor m => Functor (MaybeT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.MaybeMonad m => Functor (WrappedMonad m)Defined in base-4.23.0.0 · Control.ApplicativeMonad m => Functor (Handler m)Defined in exceptions-0.10.12 · Control.Monad.CatchMonad m => Functor (CatchT m)Defined in exceptions-0.10.12 · Control.Monad.Catch.PureArrow a => Functor (ArrowMonad a)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.ArrowFunctor (GenCmmDecl d h)Defined in ghc-10.0.0.20260917 · GHC.CmmFunctor (S z s)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFG.DominatorsFunctor (Stream f a)Defined in ghc-10.0.0.20260917 · GHC.Data.StreamFunctor (UniqDFM key)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DFMFunctor (NonDetUniqFM key)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.FMFunctor (UniqFM key)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.FMFunctor (Const m)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstFunctor (URec Char)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (URec Double)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (URec Float)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (URec Int)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (URec Word)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (URec (Ptr ()))Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (Tuple3 a b)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor (Constant a)Defined in transformers-0.6.3.0 · Data.Functor.ConstantFunctor (t m) => Functor (LiftingAccum t m)Defined in mtl-2.3.2 · Control.Monad.AccumFunctor (t m) => Functor (LiftingSelect t m)Defined in mtl-2.3.2 · Control.Monad.SelectFunctor f => Functor (Ap f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidFunctor f => Functor (Alt f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFunctor f => Functor (Rec1 f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor f => Functor (Backwards f)Defined in transformers-0.6.3.0 · Control.Applicative.BackwardsDerived instance.
Functor f => Functor (Reverse f)Defined in transformers-0.6.3.0 · Data.Functor.ReverseDerived instance.
Functor m => Functor (StreamS m a)Defined in ghc-10.0.0.20260917 · GHC.Data.StreamFunctor m => Functor (Kleisli m a)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.ArrowFunctor m => Functor (AccumT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.AccumFunctor m => Functor (ExceptT e m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ExceptFunctor m => Functor (IdentityT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.IdentityFunctor m => Functor (ReaderT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ReaderFunctor m => Functor (SelectT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.SelectFunctor m => Functor (StateT s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.State.LazyFunctor m => Functor (StateT s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.State.StrictFunctor m => Functor (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.CPSFunctor m => Functor (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.LazyFunctor m => Functor (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.StrictMonad m => Functor (StateT s m)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsArrow a => Functor (WrappedArrow a b)Defined in base-4.23.0.0 · Control.Applicative(Applicative f, Monad f) => Functor (WhenMissing f x)Defined in containers-0.8 · Data.IntMap.Internal(Applicative f, Monad f) => Functor (WhenMissing f x)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.Internal(Generic1 f, Functor (Rep1 f)) => Functor (Generically1 f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (K1 i c)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (Tuple4 a b c)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor (ContT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ContFunctor ((->) r)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor f => Functor (WhenMatched f x y)Defined in containers-0.8 · Data.IntMap.InternalFunctor f => Functor (WhenMatched f x y)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.Internal(Applicative f, Monad f) => Functor (WhenMissing f k x)Defined in containers-0.8 · Data.Map.Internal(Functor f, Functor g) => Functor (Product f g)Defined in base-4.23.0.0 · Data.Functor.Product(Functor f, Functor g) => Functor (Sum f g)Defined in base-4.23.0.0 · Data.Functor.Sum(Functor f, Functor g) => Functor (f :*: g)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Functor f, Functor g) => Functor (f :+: g)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (Tuple5 a b c d)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor f => Functor (WhenMatched f k x y)Defined in containers-0.8 · Data.Map.InternalFunctor f => Functor (M1 i c f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor m => Functor (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.CPSFunctor m => Functor (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.LazyFunctor m => Functor (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.Strict(Functor f, Functor g) => Functor (Compose f g)Defined in base-4.23.0.0 · Data.Functor.Compose(Functor f, Functor g) => Functor (f :.: g)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFunctor (Tuple6 a b c d e)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor (Tuple7 a b c d e f)Defined in ghc-internal-10.0.0 · GHC.Internal.Base
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
- Right identity
- Associativity
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 List, Maybe and System.IO.IO
defined in the Prelude satisfy these laws.
Methods
(>>=) :: m a -> (a -> m b) -> m binfixl 1Sequentially compose two actions, passing any value produced by the first as an argument to the second.
'
as >>= bs' can be understood as thedoexpressiondo a <- as bs aAn alternative name for this function is 'bind', because it is used to introduce bindings in monadic contexts, but some people may refer to it as 'flatMap', which results from it being equivalent to
\x f -> join (fmap f x) :: Monad m => m a -> (a -> m b) -> m bwhich can be seen as mapping a value with
Monad m => m a -> m (m b)and then 'flattening'm (m b)tom busing join.(>>) :: m a -> m b -> m binfixl 1Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.
'
as >> bs' can be understood as thedoexpressiondo as bsor in terms of
as(>>=)as >>= const bsreturn :: a -> m aInject a value into the monadic type. This function should not be different from its default implementation as pure. The justification for the existence of this function is merely historic.
Instances141Monad, …
Monad ComplexDefined in base-4.23.0.0 · Data.ComplexMonad FirstDefined in base-4.23.0.0 · Data.SemigroupMonad LastDefined in base-4.23.0.0 · Data.SemigroupMonad MaxDefined in base-4.23.0.0 · Data.SemigroupMonad MinDefined in base-4.23.0.0 · Data.SemigroupMonad GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalMonad PutMDefined in binary-0.8.9.3 · Data.Binary.PutMonad PutDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalMonad SeqDefined in containers-0.8 · Data.Sequence.InternalMonad TreeDefined in containers-0.8 · Data.TreeMonad InspectAsmDefined in ghc-10.0.0.20260917 · GHC.ByteCode.AsmMonad RunAsmDefined in ghc-10.0.0.20260917 · GHC.ByteCode.AsmMonad CmmOptMDefined in ghc-10.0.0.20260917 · GHC.Cmm.GenericOptMonad CmmLintDefined in ghc-10.0.0.20260917 · GHC.Cmm.LintMonad PDDefined in ghc-10.0.0.20260917 · GHC.Cmm.Parser.MonadMonad NatMDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.MonadMonad WasmAsmMDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.AsmMonad TEDefined in ghc-10.0.0.20260917 · GHC.CmmToCMonad LlvmMDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.BaseMonad NormMDefined in ghc-10.0.0.20260917 · GHC.Core.FamInstEnvMonad LintMDefined in ghc-10.0.0.20260917 · GHC.Core.LintMonad RuleMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.ConstantFoldMonad CoreMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.MonadMonad SimplMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.Simplify.MonadMonad UMDefined in ghc-10.0.0.20260917 · GHC.Core.UnifyMonad UnifyResultMDefined in ghc-10.0.0.20260917 · GHC.Core.UnifyMonad CtsMDefined in ghc-10.0.0.20260917 · GHC.CoreToStgMonad NullCollapseVizDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.CollapseMonad InfiniteDefined in ghc-10.0.0.20260917 · GHC.Data.List.InfiniteMonad HscDefined in ghc-10.0.0.20260917 · GHC.Driver.Env.TypesMonad GhcDefined in ghc-10.0.0.20260917 · GHC.Driver.MonadMonad HookedUseDefined in ghc-10.0.0.20260917 · GHC.Driver.Pipeline.ExecuteMonad TMDefined in ghc-10.0.0.20260917 · GHC.HsToCore.TicksMonad DFFVDefined in ghc-10.0.0.20260917 · GHC.Iface.TidyMonad PDefined in ghc-10.0.0.20260917 · GHC.Parser.LexerMonad PVDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcessMonad HdkMDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockMonad CpsRnDefined in ghc-10.0.0.20260917 · GHC.Rename.PatMonad TPRnMDefined in ghc-10.0.0.20260917 · GHC.Rename.PatMonad RMDefined in ghc-10.0.0.20260917 · GHC.Stg.EnforceEpt.RewriteMonad LiftMDefined in ghc-10.0.0.20260917 · GHC.Stg.Lift.MonadMonad LintMDefined in ghc-10.0.0.20260917 · GHC.Stg.LintMonad StgMDefined in ghc-10.0.0.20260917 · GHC.Stg.PipelineMonad BcMDefined in ghc-10.0.0.20260917 · GHC.StgToByteCodeMonad CmmParseDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.ExtCodeMonad FCodeDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.MonadMonad KindRepMDefined in ghc-10.0.0.20260917 · GHC.Tc.Instance.TypeableMonad SolverStageDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.MonadMonad TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.MonadMonad RewriteMDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.RewriteMonad RoleMDefined in ghc-10.0.0.20260917 · GHC.Tc.TyCl.UtilsMonad SynCycleMDefined in ghc-10.0.0.20260917 · GHC.Tc.TyCl.UtilsMonad TcPluginMDefined in ghc-10.0.0.20260917 · GHC.Tc.TypesMonad ZonkMDefined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.MonadMonad UniqDSMDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSMMonad UniqSMDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SupplyMonad PprMDefined in ghc-boot-th-10.0.0.20260917 · GHC.Boot.TH.PprLibMonad NonEmptyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.NonEmpty · orphanMonad IdentityDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityMonad FirstDefined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidMonad LastDefined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidMonad DownDefined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdMonad DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonad ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonad SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonad NoIODefined in ghc-internal-10.0.0 · GHC.Internal.GHCiMonad Par1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonad MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonad STMDefined in ghc-internal-10.0.0 · GHC.Internal.STMMonad QDefined in ghc-internal-10.0.0 · GHC.Internal.TH.MonadMonad PDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPMonad ReadPDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPMonad ReadPrecDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPrecMonad SoloDefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonad IODefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonad MDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.MonadMonad GHCiQDefined in ghci-10.0.0.20260917 · GHCi.THMonad STMDefined in stm-2.5.3.1 · Control.Sequential.STMMonad []Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonad ProxyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyMonad U1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonad (State s)Defined in containers-0.8 · Utils.Containers.Internal.StateMonad (RegM freeRegs)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.StateMonad (WasmCodeGenM w)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesMonad (IOEnv m)Defined in ghc-10.0.0.20260917 · GHC.Data.IOEnvMonad (MaybeErr err)Defined in ghc-10.0.0.20260917 · GHC.Data.MaybeMonad (CmdLineP s)Defined in ghc-10.0.0.20260917 · GHC.Driver.SessionMonad (ZonkBndrT m)Defined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.EnvMonad (CvtM' err)Defined in ghc-10.0.0.20260917 · GHC.ThToHsMonad (Codensity f)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.CodensityMonad (State s)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.State.StrictMonad (ST s)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpMonad (Either e)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.EitherMonad (ST s)Defined in ghc-internal-10.0.0 · GHC.Internal.STMonad (IParser t)Defined in text-2.1.4 · Data.Text.Internal.ReadMonad m => Monad (WrappedMonad m)Defined in base-4.23.0.0 · Control.ApplicativeMonad m => Monad (CatchT m)Defined in exceptions-0.10.12 · Control.Monad.Catch.PureMonad m => Monad (EwM m)Defined in ghc-10.0.0.20260917 · GHC.Driver.CmdLineMonad m => Monad (GhcT m)Defined in ghc-10.0.0.20260917 · GHC.Driver.MonadMonad m => Monad (ZonkT m)Defined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.EnvMonad m => Monad (UniqDSMT m)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSMMonad m => Monad (MaybeT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.MaybeMonoid a => Monad (Tuple2 a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseArrowApply a => Monad (ArrowMonad a)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.ArrowMonad (S z s)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFG.DominatorsMonad (Stream m a)Defined in ghc-10.0.0.20260917 · GHC.Data.StreamMonad (t m) => Monad (LiftingAccum t m)Defined in mtl-2.3.2 · Control.Monad.AccumMonad (t m) => Monad (LiftingSelect t m)Defined in mtl-2.3.2 · Control.Monad.SelectMonad f => Monad (Ap f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidMonad f => Monad (Alt f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonad f => Monad (Rec1 f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonad m => Monad (StreamS m a)Defined in ghc-10.0.0.20260917 · GHC.Data.StreamMonad m => Monad (Kleisli m a)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.ArrowMonad m => Monad (StateT s m)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsMonad m => Monad (ExceptT e m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ExceptMonad m => Monad (IdentityT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.IdentityMonad m => Monad (ReaderT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ReaderMonad m => Monad (SelectT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.SelectMonad m => Monad (StateT s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.State.LazyMonad m => Monad (StateT s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.State.StrictMonad m => Monad (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.CPSMonad m => Monad (Reverse m)Defined in transformers-0.6.3.0 · Data.Functor.ReverseDerived instance.
(Applicative f, Monad f) => Monad (WhenMissing f x)Defined in containers-0.8 · Data.IntMap.InternalEquivalent to
ReaderT k (ReaderT x (MaybeT f)).(Applicative f, Monad f) => Monad (WhenMissing f x)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalEquivalent to
ReaderT k (ReaderT x (MaybeT f)).(Monoid a, Monoid b) => Monad (Tuple3 a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Base(Monoid w, Functor m, Monad m) => Monad (AccumT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Accum(Monoid w, Monad m) => Monad (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Lazy(Monoid w, Monad m) => Monad (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.StrictMonad (ContT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ContMonad ((->) r)Defined in ghc-internal-10.0.0 · GHC.Internal.Base(Applicative f, Monad f) => Monad (WhenMissing f k x)Defined in containers-0.8 · Data.Map.InternalEquivalent to
ReaderT k (ReaderT x (MaybeT f)).(Monad f, Applicative f) => Monad (WhenMatched f x y)Defined in containers-0.8 · Data.IntMap.InternalEquivalent to
ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))(Monad f, Applicative f) => Monad (WhenMatched f x y)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalEquivalent to
ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))(Monad f, Monad g) => Monad (Product f g)Defined in base-4.23.0.0 · Data.Functor.Product(Monad f, Monad g) => Monad (f :*: g)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Monoid a, Monoid b, Monoid c) => Monad (Tuple4 a b c)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonad f => Monad (M1 i c f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonad m => Monad (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.CPS(Monad f, Applicative f) => Monad (WhenMatched f k x y)Defined in containers-0.8 · Data.Map.InternalEquivalent to
ReaderT k (ReaderT x (ReaderT y (MaybeT f)))(Monoid w, Monad m) => Monad (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.Lazy(Monoid w, Monad m) => Monad (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.Strict
The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following:
- Right identity
- Left identity
- Associativity
(
law)
- Concatenation
You can alternatively define mconcat instead of mempty, in which case the laws are:
- Unit
- Multiplication
- Subclass
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.
Methods
mempty :: aIdentity of mappend
Examples
Example1 expression "Hello world" <> mempty"Hello world"
Example1 expression mempty <> [1, 2, 3][1,2,3]
mappend :: a -> a -> aAn associative operation
NOTE: This method is redundant and has the default implementation
mappend = (<>)since base-4.11.0.0. Should it be implemented manually, since mappend is a synonym for (<>), it is expected that the two functions are defined the same way. In a future GHC release mappend will be removed from Monoid.mconcat :: [a] -> aFold a list using the monoid.
For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.
Example1 expression mconcat ["Hello", " ", "Haskell", "!"]"Hello Haskell!"
Instances152Monoid, …
Monoid ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteMonoid BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalMonoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeMonoid ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalMonoid ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalMonoid IntSetDefined in containers-0.8 · Data.IntSet.Internalmempty= emptyMonoid UnitDefined in deepseq-1.5.2.0 · Control.DeepSeqMonoid LabelSetDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelMonoid LoadArgsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenMonoid LlvmAccumDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.CodeGenMonoid CoHoleSetDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepMonoid FastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringMonoid Word64SetDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Set.InternalMonoid PluginRecompileDefined in ghc-10.0.0.20260917 · GHC.Driver.PluginsMonoid HsTyPatRnBuilderDefined in ghc-10.0.0.20260917 · GHC.Hs.TypeMonoid CIRBDefined in ghc-10.0.0.20260917 · GHC.HsToCore.PmcMonoid NablasDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesMonoid PrecisionDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.TypesMonoid RecompileRequiredDefined in ghc-10.0.0.20260917 · GHC.Iface.RecompMonoid IfaceAppArgsDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeMonoid JStgStatDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxMonoid MultiplicityDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleMonoid VarUsageDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleMonoid VarValueDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleMonoid BlockOptDefined in ghc-10.0.0.20260917 · GHC.JS.OptimizerMonoid JStatDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxMonoid UnitLinkOptsDefined in ghc-10.0.0.20260917 · GHC.Linker.UnitMonoid ColumnBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockMonoid LocRangeDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockMonoid LowerLocBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockMonoid UpperLocBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockMonoid DisambigInfoDefined in ghc-10.0.0.20260917 · GHC.Rename.EnvMonoid IPEStatsDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.UtilsMonoid CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesMonoid ArchiveDefined in ghc-10.0.0.20260917 · GHC.SysTools.ArMonoid TcMBoolDefined in ghc-10.0.0.20260917 · GHC.Tc.Gen.AppMonoid TcMUnitDefined in ghc-10.0.0.20260917 · GHC.Tc.Gen.AppMonoid TcTyClGroupsAccumDefined in ghc-10.0.0.20260917 · GHC.Tc.TyClMonoid CheckTyEqResultDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintMonoid HasGivenEqsDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintMonoid WantedConstraintsDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintMonoid CtExplanationsDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.CtLocMonoid HsWrapperDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.EvidenceMonoid CandidatesQTvsDefined in ghc-10.0.0.20260917 · GHC.Tc.Utils.TcMTypeMonoid UnfilledCoercionHoleMonoidDefined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.TcTypeMonoid InsideLamDefined in ghc-10.0.0.20260917 · GHC.Types.BasicMonoid InterestingCxtDefined in ghc-10.0.0.20260917 · GHC.Types.BasicMonoid CHeaderDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignStubsMonoid CStubDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignStubsMonoid ShadowedFieldGREsDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderMonoid ShadowedGREsDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderMonoid NonCaffySetDefined in ghc-10.0.0.20260917 · GHC.Types.Name.SetMonoid UniqueSetDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SetMonoid ModuleOriginDefined in ghc-10.0.0.20260917 · GHC.Unit.External.ModuleOriginMonoid UnitVisibilityDefined in ghc-10.0.0.20260917 · GHC.Unit.External.VisibilityMonoid PprColourDefined in ghc-10.0.0.20260917 · GHC.Utils.Ppr.ColourMonoid ShortTextDefined in ghc-boot-10.0.0.20260917 · GHC.Data.ShortTextMonoid AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonoid AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonoid EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesMonoid EventLifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesMonoid LifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.Typesmappendtakes the longer of two lifetimes.Monoid ExceptionContextDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.ContextMonoid OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid OsStringDefined in os-string-2.0.11 · System.OsString.Internal.Types"String-Concatenation" for OsString. This is not the same as
(</>).Monoid PosixStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesMonoid WindowsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesMonoid DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJMonoid TextDefined in text-2.1.4 · Data.Text · orphanMonoid BuilderDefined in text-2.1.4 · Data.Text.Internal.BuilderMonoid TextDefined in text-2.1.4 · Data.Text.Lazy · orphanMonoid StrictTextBuilderDefined in text-2.1.4 · Data.Text.Internal.StrictBuilderMonoid CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysAdditive
Monoid CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeAdditive
Monoid StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonMonoid StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonMonoid ()Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid (Comparison a)Defined in base-4.23.0.0 · Data.Functor.ContravariantMonoid (Equivalence a)Defined in base-4.23.0.0 · Data.Functor.ContravariantMonoid (Predicate a)Defined in base-4.23.0.0 · Data.Functor.ContravariantMonoid (PutM ())Defined in binary-0.8.9.3 · Data.Binary.PutMonoid (IntMap a)Defined in containers-0.8 · Data.IntMap.Internalmempty= emptyMonoid (Seq a)Defined in containers-0.8 · Data.Sequence.Internalmempty= emptyMonoid (MergeSet a)Defined in containers-0.8 · Data.Set.InternalMonoid (EqM a)Defined in containers-0.8 · Utils.Containers.Internal.EqOrdUtilMonoid (OrdM a)Defined in containers-0.8 · Utils.Containers.Internal.EqOrdUtilMonoid (Bag a)Defined in ghc-10.0.0.20260917 · GHC.Data.BagMonoid (OrdList a)Defined in ghc-10.0.0.20260917 · GHC.Data.OrdListMonoid (Word64Map a)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalMonoid (IdentifierDetails a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesMonoid (AnnSortKey tag)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationMonoid (TyVarCheckResult m)Defined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifyMonoid (Messages e)Defined in ghc-10.0.0.20260917 · GHC.Types.ErrorMonoid (UniqDSet a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSetMonoid (UniqSet a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.SetMonoid (EndoOS a)Defined in ghc-10.0.0.20260917 · GHC.Utils.EndoOSMonoid (First a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidMonoid (Last a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidMonoid (Endo a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonoid (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJMonoid [a]Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid a => Monoid (WasmAsmM a)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.AsmMonoid a => Monoid (Pair a)Defined in ghc-10.0.0.20260917 · GHC.Data.PairMonoid a => Monoid (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityMonoid a => Monoid (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdMonoid a => Monoid (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonoid a => Monoid (STM a)Defined in ghc-internal-10.0.0 · GHC.Internal.STMMonoid a => Monoid (Q a)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.MonadMonoid a => Monoid (IO a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid a => Monoid (a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid m => Monoid (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupMonoid p => Monoid (Par1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup a => Monoid (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Data.StrictSemigroup a => Monoid (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseLift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup
Smay be turned into a monoid simply by adjoining an elementenot inSand defininge*e = eande*s = s = s*efor alls ∈ S."Since 4.11.0: constraint on inner
avalue generalised from Monoid to Semigroup.Bits a => Monoid (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBits a => Monoid (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsFiniteBits a => Monoid (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsThis constraint is arguably too strong. However, as some types (such as
Natural) have undefined complement, this is the only safe choice.FiniteBits a => Monoid (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsThis constraint is arguably too strong. However, as some types (such as
Natural) have undefined complement, this is the only safe choice.Ord a => Monoid (Set a)Defined in containers-0.8 · Data.Set.Internalmempty= emptyOrd a => Monoid (Max a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsOrd a => Monoid (Min a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsNum a => Monoid (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNum a => Monoid (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.Internal(Ord a, Bounded a) => Monoid (Max a)Defined in base-4.23.0.0 · Data.Semigroup(Ord a, Bounded a) => Monoid (Min a)Defined in base-4.23.0.0 · Data.Semigroup(Generic a, Monoid (Rep a ())) => Monoid (Generically a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonoid (EnumSet a)Defined in ghc-10.0.0.20260917 · GHC.Data.EnumSetMonoid (UniqMap k a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.MapMonoid (Proxy s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyMonoid (U1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonoid a => Monoid (Op a b)Defined in base-4.23.0.0 · Data.Functor.Contravariantmempty @(Op a b)without newtypes ismempty @(b->a)=_ -> mempty.mempty :: Op a b mempty = Op _ -> memptyMonoid a => Monoid (FV env a)Defined in ghc-10.0.0.20260917 · GHC.Types.Var.FVMonoid a => Monoid (ST s a)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpMonoid a => Monoid (ST s a)Defined in ghc-internal-10.0.0 · GHC.Internal.STMonoid b => Monoid (a -> b)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseOrd k => Monoid (Map k v)Defined in containers-0.8 · Data.Map.Internalmempty= empty(Monoid a, Monoid b) => Monoid (a, b)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseAlternative f => Monoid (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonoid (UniqFM key a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.FMMonoid (f p) => Monoid (Rec1 f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonoid a => Monoid (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstMonoid a => Monoid (Constant a b)Defined in transformers-0.6.3.0 · Data.Functor.Constant(Applicative f, Monoid a) => Monoid (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Monoid(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid c => Monoid (K1 i c p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Monoid (f a), Monoid (g a)) => Monoid (Product f g a)Defined in base-4.23.0.0 · Data.Functor.Product(Monoid (f p), Monoid (g p)) => Monoid ((:*:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid (f (g a)) => Monoid (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.ComposeMonoid (f (g p)) => Monoid ((:.:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonoid (f p) => Monoid (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)Defined in ghc-internal-10.0.0 · GHC.Internal.Base
Instances175Semigroup, …
Semigroup ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteSemigroup BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalSemigroup ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeSemigroup ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalSemigroup ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalSemigroup IntSetDefined in containers-0.8 · Data.IntSet.Internal(<>)= unionSemigroup IntersectionDefined in containers-0.8 · Data.IntSet.InternalSemigroup UnitDefined in deepseq-1.5.2.0 · Control.DeepSeqSemigroup LabelSetDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelSemigroup CmmSuperDefined in ghc-10.0.0.20260917 · GHC.Cmm.ReducibilitySemigroup LoadArgsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenSemigroup LlvmAccumDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.CodeGenSemigroup PotentialUnifiersDefined in ghc-10.0.0.20260917 · GHC.Core.InstEnvSemigroup CoHoleSetDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepSemigroup MaybeApartReasonDefined in ghc-10.0.0.20260917 · GHC.Core.UnifySemigroup FastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringSemigroup Word64SetDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Set.InternalSemigroup PluginRecompileDefined in ghc-10.0.0.20260917 · GHC.Driver.PluginsSemigroup HsTyPatRnBuilderDefined in ghc-10.0.0.20260917 · GHC.Hs.TypeSemigroup CIRBDefined in ghc-10.0.0.20260917 · GHC.HsToCore.PmcSemigroup NablasDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesSemigroup PrecisionDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.TypesSemigroup RecompileRequiredDefined in ghc-10.0.0.20260917 · GHC.Iface.RecompSemigroup IfaceAppArgsDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeSemigroup JStgStatDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxSemigroup MultiplicityDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleSemigroup VarDeclDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleSemigroup VarUsageDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleSemigroup VarValueDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleSemigroup BlockOptDefined in ghc-10.0.0.20260917 · GHC.JS.OptimizerTo merge two BlockOpt we first run the left-hand side optimization and capture the right-hand side in the continuation
Semigroup JStatDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxSemigroup UnitLinkOptsDefined in ghc-10.0.0.20260917 · GHC.Linker.UnitSemigroup AnnListItemDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationSemigroup EpAnnCommentsDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationSemigroup EpaLocationDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationSemigroup ColumnBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockSemigroup LocRangeDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockSemigroup LowerLocBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockSemigroup UpperLocBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockSemigroup DisambigInfoDefined in ghc-10.0.0.20260917 · GHC.Rename.EnvSemigroup IPEStatsDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.UtilsSemigroup JSOptionsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectSemigroup CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesSemigroup ArchiveDefined in ghc-10.0.0.20260917 · GHC.SysTools.ArSemigroup TcMBoolDefined in ghc-10.0.0.20260917 · GHC.Tc.Gen.AppSemigroup TcMUnitDefined in ghc-10.0.0.20260917 · GHC.Tc.Gen.AppSemigroup TcTyClGroupsAccumDefined in ghc-10.0.0.20260917 · GHC.Tc.TyClSemigroup CheckTyEqResultDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintSemigroup HasGivenEqsDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintSemigroup WantedConstraintsDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintSemigroup CtExplanationsDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.CtLocSemigroup HsWrapperDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.EvidenceThe Semigroup instance is a bit fishy, since
WpCompose, as a data constructor, is "syntactic" and not associative. Concretely, ifa,b, andcaren'tWpHole:(a <> b) <> c ?= a <> (b <> c)>
(a `WpCompose` b) `WpCompose` c /= @ a `WpCompose` (b `WpCompose` c)However these two associations are are "semantically equal" in the sense that they produce equal functions when passed to
GHC.HsToCore.Binds.dsHsWrapper.Semigroup CandidatesQTvsDefined in ghc-10.0.0.20260917 · GHC.Tc.Utils.TcMTypeSemigroup SimpleUnifyResultDefined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifySemigroup UnfilledCoercionHoleMonoidDefined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.TcTypeSemigroup InsideLamDefined in ghc-10.0.0.20260917 · GHC.Types.BasicIf any occurrence of an identifier is inside a lambda, then the occurrence info of that identifier marks it as occurring inside a lambda
Semigroup InterestingCxtDefined in ghc-10.0.0.20260917 · GHC.Types.BasicIf there is any
interestingidentifier occurrence, then the aggregated occurrence info of that identifier is considered interesting.Semigroup SuccessFlagDefined in ghc-10.0.0.20260917 · GHC.Types.BasicSemigroup CHeaderDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignStubsSemigroup CStubDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignStubsSemigroup ShadowedFieldGREsDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderSemigroup ShadowedGREsDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderSemigroup NonCaffySetDefined in ghc-10.0.0.20260917 · GHC.Types.Name.SetSemigroup BufSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocSemigroup UniqueSetDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SetSemigroup ModuleOriginDefined in ghc-10.0.0.20260917 · GHC.Unit.External.ModuleOriginSemigroup UnitVisibilityDefined in ghc-10.0.0.20260917 · GHC.Unit.External.VisibilitySemigroup PprColourDefined in ghc-10.0.0.20260917 · GHC.Utils.Ppr.ColourSemigroup ShortTextDefined in ghc-boot-10.0.0.20260917 · GHC.Data.ShortTextSemigroup VoidDefined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalSemigroup AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalSemigroup EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesSemigroup EventLifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesSemigroup LifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesSemigroup ExceptionContextDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.ContextSemigroup OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup OsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesSemigroup PosixStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesSemigroup WindowsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesSemigroup DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJSemigroup TextDefined in text-2.1.4 · Data.Text · orphanBeware:
stimeswill crash if the given number does not fit into anInt.Semigroup BuilderDefined in text-2.1.4 · Data.Text.Internal.BuilderSemigroup TextDefined in text-2.1.4 · Data.Text.Lazy · orphanSemigroup StrictTextBuilderDefined in text-2.1.4 · Data.Text.Internal.StrictBuilderConcatenation of StrictBuilder is right-biased: the right builder will be run first. This allows a builder to run tail-recursively when it was accumulated left-to-right.
Semigroup CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysAdditive
Semigroup CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeAdditive
Semigroup StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonORs the flags.
Semigroup StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonORs the masks.
Semigroup ()Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid m => Semigroup (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupSemigroup (FromMaybe b)Defined in base-4.23.0.0 · Data.Foldable1Semigroup (NonEmptyDList a)Defined in base-4.23.0.0 · Data.Foldable1Semigroup (Comparison a)Defined in base-4.23.0.0 · Data.Functor.ContravariantSemigroup (Equivalence a)Defined in base-4.23.0.0 · Data.Functor.ContravariantSemigroup (Predicate a)Defined in base-4.23.0.0 · Data.Functor.ContravariantSemigroup (First a)Defined in base-4.23.0.0 · Data.SemigroupSemigroup (Last a)Defined in base-4.23.0.0 · Data.SemigroupSemigroup (PutM ())Defined in binary-0.8.9.3 · Data.Binary.PutSemigroup (IntMap a)Defined in containers-0.8 · Data.IntMap.Internal(<>)= unionSemigroup (Seq a)Defined in containers-0.8 · Data.Sequence.Internal(<>)=(><)Semigroup (MergeSet a)Defined in containers-0.8 · Data.Set.InternalSemigroup (EqM a)Defined in containers-0.8 · Utils.Containers.Internal.EqOrdUtilComposes left-to-right, short-circuits on False
Semigroup (OrdM a)Defined in containers-0.8 · Utils.Containers.Internal.EqOrdUtilComposes left-to-right, short-circuits on non-EQ
Semigroup (Bag a)Defined in ghc-10.0.0.20260917 · GHC.Data.BagSemigroup (OrdList a)Defined in ghc-10.0.0.20260917 · GHC.Data.OrdListSemigroup (Word64Map a)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalSemigroup (IdentifierDetails a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesSemigroup (AnnSortKey tag)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationSemigroup (TyVarCheckResult m)Defined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifySemigroup (Messages e)Defined in ghc-10.0.0.20260917 · GHC.Types.ErrorSemigroup (UniqDSet a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSetSemigroup (UniqSet a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.SetSemigroup (EndoOS a)Defined in ghc-10.0.0.20260917 · GHC.Utils.EndoOSSemigroup (NonEmpty a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.NonEmpty · orphanSemigroup (First a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidSemigroup (Last a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidSemigroup (Endo a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalSemigroup (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJSemigroup [a]Defined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup a => Semigroup (JoinWith a)Defined in base-4.23.0.0 · Data.Foldable1Semigroup a => Semigroup (WasmAsmM a)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.AsmSemigroup a => Semigroup (Pair a)Defined in ghc-10.0.0.20260917 · GHC.Data.PairSemigroup a => Semigroup (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Data.StrictSemigroup a => Semigroup (EpAnn a)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationSemigroup a => Semigroup (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentitySemigroup a => Semigroup (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdSemigroup a => Semigroup (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalSemigroup a => Semigroup (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup a => Semigroup (STM a)Defined in ghc-internal-10.0.0 · GHC.Internal.STMSemigroup a => Semigroup (Q a)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.MonadSemigroup a => Semigroup (IO a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup a => Semigroup (a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup p => Semigroup (Par1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsBits a => Semigroup (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBits a => Semigroup (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBits a => Semigroup (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsFiniteBits a => Semigroup (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsThis constraint is arguably too strong. However, as some types (such as
Natural) have undefined complement, this is the only safe choice.Ord a => Semigroup (Max a)Defined in base-4.23.0.0 · Data.SemigroupOrd a => Semigroup (Min a)Defined in base-4.23.0.0 · Data.SemigroupOrd a => Semigroup (Intersection a)Defined in containers-0.8 · Data.Set.InternalOrd a => Semigroup (Set a)Defined in containers-0.8 · Data.Set.Internal(<>)= unionOrd a => Semigroup (Max a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsOrd a => Semigroup (Min a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsNum a => Semigroup (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNum a => Semigroup (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.Internal(Generic a, Semigroup (Rep a ())) => Semigroup (Generically a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup (EnumSet a)Defined in ghc-10.0.0.20260917 · GHC.Data.EnumSetSemigroup (UniqMap k a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.MapSemigroup (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.EitherSemigroup (Proxy s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxySemigroup (U1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup (V1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup a => Semigroup (Op a b)Defined in base-4.23.0.0 · Data.Functor.ContravariantSemigroup a => Semigroup (FV env a)Defined in ghc-10.0.0.20260917 · GHC.Types.Var.FVSemigroup a => Semigroup (ST s a)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpSemigroup a => Semigroup (ST s a)Defined in ghc-internal-10.0.0 · GHC.Internal.STSemigroup b => Semigroup (a -> b)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseOrd k => Semigroup (Map k v)Defined in containers-0.8 · Data.Map.Internal(<>)= union(Semigroup a, Semigroup b) => Semigroup (a, b)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseAlternative f => Semigroup (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalSemigroup (UniqFM key a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.FMSemigroup (f p) => Semigroup (Rec1 f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup a => Semigroup (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstSemigroup a => Semigroup (Constant a b)Defined in transformers-0.6.3.0 · Data.Functor.Constant(Applicative f, Semigroup a) => Semigroup (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Monoid(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup c => Semigroup (K1 i c p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Semigroup (f a), Semigroup (g a)) => Semigroup (Product f g a)Defined in base-4.23.0.0 · Data.Functor.Product(Semigroup (f p), Semigroup (g p)) => Semigroup ((:*:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup (f (g a)) => Semigroup (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.ComposeSemigroup (f (g p)) => Semigroup ((:.:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup (f p) => Semigroup (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e)Defined in ghc-internal-10.0.0 · GHC.Internal.Base
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:
Instances1064Eq, …
Eq ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteEq IoManagerFlagDefined in base-4.23.0.0 · GHC.RTS.FlagsEq TimeoutDefined in base-4.23.0.0 · System.TimeoutEq FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.D2SEq FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.F2SEq ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeEq ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalEq ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalEq IntSetDefined in containers-0.8 · Data.IntSet.InternalEq IntersectionDefined in containers-0.8 · Data.IntSet.InternalEq PrefixDefined in containers-0.8 · Data.IntSet.Internal.IntTreeCommonsEq FileTypeDefined in directory-1.3.11.0 · System.Directory.Internal.CommonEq PermissionsDefined in directory-1.3.11.0 · System.Directory.Internal.CommonEq XdgDirectoryDefined in directory-1.3.11.0 · System.Directory.Internal.CommonEq XdgDirectoryListDefined in directory-1.3.11.0 · System.Directory.Internal.CommonEq PrimOpDefined in ghc-10.0.0.20260917 · GHC.Builtin.PrimOpsEq PrimOpEffectDefined in ghc-10.0.0.20260917 · GHC.Builtin.PrimOpsEq InternalBreakLocDefined in ghc-10.0.0.20260917 · GHC.ByteCode.BreakpointsEq InternalBreakpointIdDefined in ghc-10.0.0.20260917 · GHC.ByteCode.BreakpointsEq LocalLabelDefined in ghc-10.0.0.20260917 · GHC.ByteCode.InstrEq BCOIxDefined in ghc-10.0.0.20260917 · GHC.ByteCode.LinkerEq ByteOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEq HalfWordDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEq NativeCallTypeDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEq RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEq WordOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEq CmmInfoTableDefined in ghc-10.0.0.20260917 · GHC.CmmEq ProfilingInfoDefined in ghc-10.0.0.20260917 · GHC.CmmEq SectionProtectionDefined in ghc-10.0.0.20260917 · GHC.CmmEq CLabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq CmmLabelInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq ConInfoTableLocationDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq DynamicLinkerLabelInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq ForeignLabelSourceDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq IdLabelInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq InfoProvEntDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq ModuleLabelKindDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq NeedExternDeclDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq RtsLabelInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq TickyIdInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelEq LabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelEq LabelSetDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelEq UnwindExprDefined in ghc-10.0.0.20260917 · GHC.Cmm.DebugBlockEq DominatorSetDefined in ghc-10.0.0.20260917 · GHC.Cmm.DominatorsEq RPNumDefined in ghc-10.0.0.20260917 · GHC.Cmm.DominatorsEq AlignmentSpecDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprEq AreaDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprEq CmmExprDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprEq CmmLitDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprEq TransferDefined in ghc-10.0.0.20260917 · GHC.Cmm.GraphEq CAFfyLabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.Info.BuildEq SRTEntryDefined in ghc-10.0.0.20260917 · GHC.Cmm.Info.BuildEq SomeLabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.Info.BuildEq AtomicMachOpDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpEq CallishMachOpDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpEq FMASignDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpEq MachOpDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpEq MemoryOrderingDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpEq CmmReturnInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.NodeEq CmmTickScopeDefined in ghc-10.0.0.20260917 · GHC.Cmm.NodeEq ConventionDefined in ghc-10.0.0.20260917 · GHC.Cmm.NodeEq ForeignConventionDefined in ghc-10.0.0.20260917 · GHC.Cmm.NodeEq ForeignTargetDefined in ghc-10.0.0.20260917 · GHC.Cmm.NodeEq ReducibilityDefined in ghc-10.0.0.20260917 · GHC.Cmm.ReducibilityEq CmmRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegEq GlobalArgRegsDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegEq GlobalRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegEq GlobalRegUseDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegEq LocalRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegEq SwitchTargetsDefined in ghc-10.0.0.20260917 · GHC.Cmm.SwitchEq CmmCatDefined in ghc-10.0.0.20260917 · GHC.Cmm.TypeEq ForeignHintDefined in ghc-10.0.0.20260917 · GHC.Cmm.TypeEq WidthDefined in ghc-10.0.0.20260917 · GHC.Cmm.TypeEq CondDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.CondEq DMBISHFlagsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrEq ExtModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrEq OperandDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrEq ShiftModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrEq TargetDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrEq AddrModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.RegsEq ImmDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.RegsEq BlockChainDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.BlockLayoutEq BranchInfoDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGEq CfgEdgeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGCareful! Since we assume there is at most one edge from A to B the Eq instance does not consider weight.
Eq EdgeInfoDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGEq EdgeWeightDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGEq TransitionSourceDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGEq DwarfAbbrevDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Dwarf.TypesEq FormatDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.FormatEq ScalarFormatDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.FormatEq CondDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.CondEq BarrierTypeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.InstrEq OperandDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.InstrEq AddrModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.RegsEq ImmDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.RegsEq ReferenceKindDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.PICEq CondDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.PPC.CondEq CondDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.CondEq OperandDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.InstrEq AddrModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.RegsEq ImmDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.RegsEq RegDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseEq RegClassDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseEq RegSubDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseEq ReadingOrWritingDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.BaseEq VLocDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.BaseEq RegsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.RegsEq SomeWasmTypeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesEq SymKindDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesEq SymNameDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesEq PaddingDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenEq StackRefDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenEq CondDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CondEq MinMaxTypeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.InstrEq MinOrMaxDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.InstrEq FixityDefined in ghc-10.0.0.20260917 · GHC.CmmToCEq SignageDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.CodeGenEq LlvmVersionDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.Version.TypeEq AltConDefined in ghc-10.0.0.20260917 · GHC.CoreEq CaseLevityDefined in ghc-10.0.0.20260917 · GHC.CoreEq UnfoldingCacheDefined in ghc-10.0.0.20260917 · GHC.CoreEq UnfoldingGuidanceDefined in ghc-10.0.0.20260917 · GHC.CoreEq ClassDefined in ghc-10.0.0.20260917 · GHC.Core.ClassEq CoAxiomRuleDefined in ghc-10.0.0.20260917 · GHC.Core.Coercion.AxiomEq ConLikeDefined in ghc-10.0.0.20260917 · GHC.Core.ConLikeEq DataConDefined in ghc-10.0.0.20260917 · GHC.Core.DataConEq StrictnessMarkDefined in ghc-10.0.0.20260917 · GHC.Core.DataConEq JoinOccDefined in ghc-10.0.0.20260917 · GHC.Core.LintEq StaticPtrCheckDefined in ghc-10.0.0.20260917 · GHC.Core.LintEq IsSubmultDefined in ghc-10.0.0.20260917 · GHC.Core.MultiplicityEq ArityTypeDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.ArityEq CostDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.ArityEq RangeDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.RangeEq LevelDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.SetLevelsEq SimplPhaseDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.Simplify.EnvEq TickDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.StatsEq IsRecDataConResultDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.WorkWrap.UtilsEq PatSynDefined in ghc-10.0.0.20260917 · GHC.Core.PatSynEq EqRelDefined in ghc-10.0.0.20260917 · GHC.Core.PredicateEq InvisibleBitDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareEq TypeOrderingDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareEq CoSelDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepEq FunSelDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepEq TyLitDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepEq UnivCoProvenanceDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepEq InjectivityDefined in ghc-10.0.0.20260917 · GHC.Core.TyConEq PrimElemRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConEq PrimOrVoidRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConEq PrimRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConEq TyConDefined in ghc-10.0.0.20260917 · GHC.Core.TyConEq BindFlagDefined in ghc-10.0.0.20260917 · GHC.Core.UnifyEq HowBoundDefined in ghc-10.0.0.20260917 · GHC.CoreToStgEq LetInfoDefined in ghc-10.0.0.20260917 · GHC.CoreToStgEq BindInfoDefined in ghc-10.0.0.20260917 · GHC.CoreToStg.PrepEq FloatInfoDefined in ghc-10.0.0.20260917 · GHC.CoreToStg.PrepEq OverridingBoolDefined in ghc-10.0.0.20260917 · GHC.Data.BoolEq FastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringEq LexicalFastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringEq NonDetFastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringEq EdgeTypeDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.DirectedEq TimeDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.DirectedEq UnVarSetDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.UnVarEq Word64SetDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Set.InternalEq BackendNameDefined in ghc-10.0.0.20260917 · GHC.Driver.Backend.InternalEq SessionTypeDefined in ghc-10.0.0.20260917 · GHC.Driver.BackpackEq CodeGenEnableDefined in ghc-10.0.0.20260917 · GHC.Driver.DownsweepEq DynLibLoaderDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq DynamicTooStateDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq ExecutableLinkModeDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq GhcLinkDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq GhcModeDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq IgnorePackageFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq ModRenamingDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq PackageArgDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq PackageDBFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq PackageFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq PkgDbRefDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq TrustFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsEq DeprecationDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEq DumpFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEq ExtensionDeprecationDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEq GeneralFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEq LanguageDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEq WarningFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEq WarningGroupDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEq WorkerLimitDefined in ghc-10.0.0.20260917 · GHC.Driver.MakeActionEq PhaseDefined in ghc-10.0.0.20260917 · GHC.Driver.PhasesEq AnnsModuleDefined in ghc-10.0.0.20260917 · GHC.HsEq NamespaceSpecifierDefined in ghc-10.0.0.20260917 · GHC.Hs.BasicEq ActivationAnnDefined in ghc-10.0.0.20260917 · GHC.Hs.BindsEq HsRuleBndrsAnnDefined in ghc-10.0.0.20260917 · GHC.Hs.BindsEq HsRuleAnnDefined in ghc-10.0.0.20260917 · GHC.Hs.DeclsEq OverlapFlagDefined in ghc-10.0.0.20260917 · GHC.Hs.Decls.OverlapEq HsDocStringDefined in ghc-10.0.0.20260917 · GHC.Hs.DocStringEq HsDocStringChunkDefined in ghc-10.0.0.20260917 · GHC.Hs.DocStringEq HsDocStringDecoratorDefined in ghc-10.0.0.20260917 · GHC.Hs.DocStringEq BlankEpAnnotationsDefined in ghc-10.0.0.20260917 · GHC.Hs.DumpEq BlankSrcSpanDefined in ghc-10.0.0.20260917 · GHC.Hs.DumpEq HsLitTcDefined in ghc-10.0.0.20260917 · GHC.Hs.LitEq SynchronicityDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Foreign.WasmEq GenerateInhabitingPatternsModeDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.SolverEq BotInfoDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesEq PmAltConDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesSyntactic equality.
Eq PmEqualityDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesEq PmLitDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesSyntactic equality. We want (Ord PmLit) so that we can use (Set PmLit) in PmAltConSet
Eq PrecisionDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.TypesEq TickDensityDefined in ghc-10.0.0.20260917 · GHC.HsToCore.TicksEq TickishTypeDefined in ghc-10.0.0.20260917 · GHC.HsToCore.TicksEq CheckHiWayDefined in ghc-10.0.0.20260917 · GHC.Iface.BinaryEq CompressionIFaceDefined in ghc-10.0.0.20260917 · GHC.Iface.BinaryEq BuildingCabalPackageDefined in ghc-10.0.0.20260917 · GHC.Iface.Errors.TypesEq BindTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq ContextInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq DeclTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq EntityInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq EvBindDepsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq EvVarSourceDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq HieNameDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq HieTypeFixDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq IETypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq NodeAnnotationDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq NodeOriginDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq RecFieldContextDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq ScopeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq TyVarScopeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq CompileReasonDefined in ghc-10.0.0.20260917 · GHC.Iface.RecompEq RecompReasonDefined in ghc-10.0.0.20260917 · GHC.Iface.RecompEq RecompileRequiredDefined in ghc-10.0.0.20260917 · GHC.Iface.RecompEq IfaceBooleanFormulaDefined in ghc-10.0.0.20260917 · GHC.Iface.SyntaxEq UnfoldingExposureDefined in ghc-10.0.0.20260917 · GHC.Iface.TidyEq IfLclNameDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceAppArgsDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceAxiomRuleDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceBndrDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceCoercionDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceMCoercionDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceTyConDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceTyConInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceTyConSortDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceTyLitDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IfaceTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq TupleOrSumDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeEq IdentDefined in ghc-10.0.0.20260917 · GHC.JS.IdentEq AOpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEq JStgExprDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEq JStgStatDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEq JValDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEq OpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEq UOpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEq MultiplicityDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleEq VarDeclDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleEq AOpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEq JExprDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEq JStatDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEq JValDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEq OpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEq UOpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEq MetaAnnotDefined in ghc-10.0.0.20260917 · GHC.Llvm.MetaDataEq MetaExprDefined in ghc-10.0.0.20260917 · GHC.Llvm.MetaDataEq MetaIdDefined in ghc-10.0.0.20260917 · GHC.Llvm.MetaDataEq LlvmAtomicOpDefined in ghc-10.0.0.20260917 · GHC.Llvm.SyntaxEq LlvmExpressionDefined in ghc-10.0.0.20260917 · GHC.Llvm.SyntaxEq LlvmStatementDefined in ghc-10.0.0.20260917 · GHC.Llvm.SyntaxEq LlvmSyncOrderingDefined in ghc-10.0.0.20260917 · GHC.Llvm.SyntaxEq LMConstDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmCallConventionDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmCallTypeDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmCastOpDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmCmpOpDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmFuncAttrDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmFunctionDeclDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmLinkageTypeDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmLitDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmMachOpDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmParamAttrDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmParameterListTypeDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmTypeDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq LlvmVarDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesEq AnnListBracketsDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq AnnListItemDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq AnnPragmaDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq BindTagDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq DeclTagDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq EpAnnCommentsDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq EpaCommentDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq EpaCommentTokDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq HasEDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq IsUnicodeSyntaxDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq NameAdornmentDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq NameAnnDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq NoEpAnnsDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq TrailingAnnDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq LexErrDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesEq LexErrKindDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesEq NumUnderscoreReasonDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesEq ParseContextDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesEq PatIncompleteDoBlockDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesEq StringLexErrorDefined in ghc-10.0.0.20260917 · GHC.Parser.StringEq BmiVersionDefined in ghc-10.0.0.20260917 · GHC.PlatformEq PlatformDefined in ghc-10.0.0.20260917 · GHC.PlatformEq PlatformWordSizeDefined in ghc-10.0.0.20260917 · GHC.PlatformEq SseAvxVersionDefined in ghc-10.0.0.20260917 · GHC.PlatformEq PlatformConstantsDefined in ghc-10.0.0.20260917 · GHC.Platform.ConstantsEq ProfileDefined in ghc-10.0.0.20260917 · GHC.Platform.ProfileEq RealRegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegEq RegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegEq VirtualRegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegEq RegArchDefined in ghc-10.0.0.20260917 · GHC.Platform.Reg.ClassEq RegClassDefined in ghc-10.0.0.20260917 · GHC.Platform.Reg.ClassEq WayDefined in ghc-10.0.0.20260917 · GHC.Platform.WaysEq ArgDescrDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutEq ClosureTypeInfoDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutEq SMRepDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutEq StgHalfWordDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutEq StgWordDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutEq TagInfoDefined in ghc-10.0.0.20260917 · GHC.Stg.EnforceEpt.TagSigEq TagSigDefined in ghc-10.0.0.20260917 · GHC.Stg.EnforceEpt.TagSigEq StgLiftConfigDefined in ghc-10.0.0.20260917 · GHC.Stg.Lift.ConfigEq StgToDoDefined in ghc-10.0.0.20260917 · GHC.Stg.PipelineEq CounterTypeDefined in ghc-10.0.0.20260917 · GHC.Stg.StatsEq NoExtFieldSilentDefined in ghc-10.0.0.20260917 · GHC.Stg.SyntaxEq UpdateFlagDefined in ghc-10.0.0.20260917 · GHC.Stg.SyntaxEq DiscrDefined in ghc-10.0.0.20260917 · GHC.StgToByteCodeEq ArgRepDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.ArgRepEq StandardFormInfoDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.TypesEq ApplyConvDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ApplyEq ApplySpecDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ApplyEq BlockRefDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectEq ExportedFunDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectEq JSOptionsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectEq ObjectKindDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectEq SpecialDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsEq StgRegDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsEq StgRetDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsEq CILayoutDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq CIRegsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq CITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq ClosureInfoDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq ClosureTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq ExpFunDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq ExprResultDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq ExprValDataDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq IdKeyDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq IdTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq OtherSymbDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq StackSlotDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq StaticAppKindDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq StaticArgDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq StaticInfoDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq StaticLitDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq StaticUnboxedDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq StaticValDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq ThreadStatusDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEq SlotCountDefined in ghc-10.0.0.20260917 · GHC.StgToJS.UtilsEq ArchiveDefined in ghc-10.0.0.20260917 · GHC.SysTools.ArEq ArchiveEntryDefined in ghc-10.0.0.20260917 · GHC.SysTools.ArEq SourceCodePreprocessorDefined in ghc-10.0.0.20260917 · GHC.SysTools.TasksEq HoleFitSortingAlgDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.HoleEq HoleFitCandidateDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.Hole.FitTypesEq TcHoleFitDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.Hole.FitTypesEq AssociatedTyLastVarInKindDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq AssociatedTyNotParamOverLastTyVarDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq DeriveAnyClassEnabledDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq ExportedDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq HasAssociatedDataFamInstsDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq HasKindsDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq HasWildcardDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq SuggestPartialTypeSignaturesDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq SuggestUndecidableInstancesDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq UnsupportedCallConventionDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq UsingGeneralizedNewtypeDerivingDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq WhatLookingDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesEq WhereToLookDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.InertSetEq IsPrefixConGADTDefined in ghc-10.0.0.20260917 · GHC.Tc.TyClEq DocLocDefined in ghc-10.0.0.20260917 · GHC.Tc.TypesEq CheckTyEqProblemDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintEq CtFlavourDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintEq HasGivenEqsDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ConstraintEq SubGoalDepthDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.CtLocEq ReportRedundantConstraintsDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ErrCtxtEq UserTypeCtxtDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.ErrCtxtEq SimpleUnifyResultDefined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifyEq TypeOrKindCtxtDefined in ghc-10.0.0.20260917 · GHC.Tc.ValidityEq DetOrdAvailsDefined in ghc-10.0.0.20260917 · GHC.Types.AvailEq AlignmentDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq CbvMarkDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq DoPmcDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq FunctionOrDataDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq GenReasonDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq ImportLevelDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq InsideLamDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq IntWithInfDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq InterestingCxtDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq LeftOrRightDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq LevityDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq NewOrDataDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq OccInfoDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq OneShotInfoDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq OriginDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq PprPrecDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq RecFlagDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq SwapFlagDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq TailCallInfoDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq TupleSortDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq TypeOrConstraintDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq TypeOrDataDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq TypeOrKindDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq UnboxedTupleOrSumDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEq CCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreEq CostCentreDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreEq CostCentreStackDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreEq IndexedCCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreEq CostCentreIndexDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentre.StateEq CprDefined in ghc-10.0.0.20260917 · GHC.Types.CprEq CprSigDefined in ghc-10.0.0.20260917 · GHC.Types.CprEq CprTypeDefined in ghc-10.0.0.20260917 · GHC.Types.CprEq DefaultProvenanceDefined in ghc-10.0.0.20260917 · GHC.Types.DefaultEnvEq CardDefined in ghc-10.0.0.20260917 · GHC.Types.DemandEq DemandDefined in ghc-10.0.0.20260917 · GHC.Types.DemandEq DivergenceDefined in ghc-10.0.0.20260917 · GHC.Types.DemandEq DmdEnvDefined in ghc-10.0.0.20260917 · GHC.Types.DemandEq DmdSigDefined in ghc-10.0.0.20260917 · GHC.Types.DemandEq DmdTypeDefined in ghc-10.0.0.20260917 · GHC.Types.DemandSee Note [Demand env Equality].
Eq SubDemandDefined in ghc-10.0.0.20260917 · GHC.Types.DemandWe have to respect Poly rewrites through
viewCalland viewProd.Eq DiagnosticCodeDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorEq DiagnosticReasonDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorEq SeverityDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorEq DuplicateRecordFieldsDefined in ghc-10.0.0.20260917 · GHC.Types.FieldLabelEq FieldLabelDefined in ghc-10.0.0.20260917 · GHC.Types.FieldLabelEq FieldSelectorsDefined in ghc-10.0.0.20260917 · GHC.Types.FieldLabelEq CCallSpecDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCallEq CCallStaticTargetUnitDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCallEq CTypeGhcDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCallEq ForeignCallDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCallEq StaticTargetGhcDefined in ghc-10.0.0.20260917 · GHC.Types.ForeignCallEq ConFieldInfoDefined in ghc-10.0.0.20260917 · GHC.Types.GREInfoEq ConInfoDefined in ghc-10.0.0.20260917 · GHC.Types.GREInfoEq ConLikeInfoDefined in ghc-10.0.0.20260917 · GHC.Types.GREInfoEq ConLikeNameDefined in ghc-10.0.0.20260917 · GHC.Types.GREInfoEq RecFieldInfoDefined in ghc-10.0.0.20260917 · GHC.Types.GREInfoEq AssumedDerivingStrategyDefined in ghc-10.0.0.20260917 · GHC.Types.HintEq SemaphoreUpgradeTargetDefined in ghc-10.0.0.20260917 · GHC.Types.HintEq CafInfoDefined in ghc-10.0.0.20260917 · GHC.Types.Id.InfoEq RecSelParentDefined in ghc-10.0.0.20260917 · GHC.Types.Id.InfoEq CompilerPhaseDefined in ghc-10.0.0.20260917 · GHC.Types.InlinePragmaEq InlineSaturationDefined in ghc-10.0.0.20260917 · GHC.Types.InlinePragmaEq XInlinePragmaGhcDefined in ghc-10.0.0.20260917 · GHC.Types.InlinePragmaEq XXActivationGhcDefined in ghc-10.0.0.20260917 · GHC.Types.InlinePragmaEq LitNumTypeDefined in ghc-10.0.0.20260917 · GHC.Types.LiteralEq LiteralDefined in ghc-10.0.0.20260917 · GHC.Types.LiteralEq LitFloatingDefined in ghc-10.0.0.20260917 · GHC.Types.Literal.FloatingThis instance intentionally disagrees with the equality predicate
(==)onFloatorDoublevalues: It is reflexive even on NaNs and distinguishes between positive and negative zero. Use litFloatingComparisonOp if you need to matchFloatorDouble.Eq LitFloatingTypeDefined in ghc-10.0.0.20260917 · GHC.Types.Literal.FloatingEq NameDefined in ghc-10.0.0.20260917 · GHC.Types.NameEq NameSpaceDefined in ghc-10.0.0.20260917 · GHC.Types.Name.OccurrenceEq OccNameDefined in ghc-10.0.0.20260917 · GHC.Types.Name.OccurrenceEq FieldsOrSelectorsDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderEq ImpDeclSpecDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderEq ImpItemSpecDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderEq ImportSpecDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderEq ParentDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderEq ParentGREDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderEq RdrNameDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderEq PkgQualDefined in ghc-10.0.0.20260917 · GHC.Types.PkgQualEq ProfAutoDefined in ghc-10.0.0.20260917 · GHC.Types.ProfAutoEq SlotTyDefined in ghc-10.0.0.20260917 · GHC.Types.RepTypeEq SafeHaskellModeDefined in ghc-10.0.0.20260917 · GHC.Types.SafeHaskellEq SaneDoubleDefined in ghc-10.0.0.20260917 · GHC.Types.SaneDoubleEq HsBootOrSigDefined in ghc-10.0.0.20260917 · GHC.Types.SourceFileEq HscSourceDefined in ghc-10.0.0.20260917 · GHC.Types.SourceFileEq FractionalExponentBaseDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextEq FractionalLitDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextBe wary of using this instance to compare for equal *values* when exponents are large. The same value expressed in different syntactic form won't compare as equal when any of the exponents is >= 100.
Eq IntegralLitDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextEq SourceTextDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextEq StringLiteralDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextEq BufPosDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq BufSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq DeltaPosDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq GeneratedSrcSpanDetailsDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq NoCommentsDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq PsLocDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq PsSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq RealSrcLocDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq RealSrcSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq SrcLocDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq SrcSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq UnhelpfulSpanReasonDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq TargetIdDefined in ghc-10.0.0.20260917 · GHC.Types.TargetEq ThLevelIndexDefined in ghc-10.0.0.20260917 · GHC.Types.ThLevelIndexEq BreakpointIdDefined in ghc-10.0.0.20260917 · GHC.Types.TickishEq TickishPlacementDefined in ghc-10.0.0.20260917 · GHC.Types.TickishEq UniqueDefined in ghc-10.0.0.20260917 · GHC.Types.UniqueEq UniqueTagDefined in ghc-10.0.0.20260917 · GHC.Types.UniqueEq UniqueSetDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SetEq FunTyFlagDefined in ghc-10.0.0.20260917 · GHC.Types.VarEq VarDefined in ghc-10.0.0.20260917 · GHC.Types.VarEq PackageIdDefined in ghc-10.0.0.20260917 · GHC.Unit.InfoEq PackageNameDefined in ghc-10.0.0.20260917 · GHC.Unit.InfoEq DependenciesDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.DepsEq HomeModImportDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.DepsEq HomeModImportedAvailsDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.DepsEq IfaceImportLevelDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.DepsEq UsageDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.DepsEq NDModuleDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.EnvEq ModuleGraphInvariantErrorDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphEq ModuleGraphNodeDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphEq NodeKeyDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphEq ZeroScopeKeyDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphEq ModNodeKeyWithUidDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModNodeKeyEq ModuleStageDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.StageEq IsTrustedDefined in ghc-10.0.0.20260917 · GHC.Unit.StateEq UnitIdDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesEq BindingNameDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryEq FullBinDataDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryEq OptionDefined in ghc-10.0.0.20260917 · GHC.Utils.CliOptionEq PrintTimingsDefined in ghc-10.0.0.20260917 · GHC.Utils.ErrorEq DumpFormatDefined in ghc-10.0.0.20260917 · GHC.Utils.LoggerEq BindingSiteDefined in ghc-10.0.0.20260917 · GHC.Utils.OutputableEq JoinPointHoodDefined in ghc-10.0.0.20260917 · GHC.Utils.OutputableEq BoxityDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicEq FieldLabelStringDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicEq FixityDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicEq FixityDirectionDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicEq LexicalFixityDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicEq RoleDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicEq SrcStrictnessDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicEq SrcUnpackednessDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicEq InlineSpecDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Binds.InlinePragmaEq RuleMatchInfoDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Binds.InlinePragmaEq SpliceDecorationDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.DeclsEq WarningCategoryDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.DeclsEq CCallConvDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignEq ForeignKindDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignEq SafetyDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignEq HsDoFlavourDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ExprEq HsLamVariantDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ExprEq DataConCantHappenDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ExtensionEq NoExtFieldDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ExtensionEq IEWildcardDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ImpExpEq ImportDeclLevelDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ImpExpEq ImportDeclLevelStyleDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ImpExpEq ImportDeclQualifiedStyleDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ImpExpEq ImportListInterpretationDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ImpExpEq IsBootInterfaceDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ImpExp.IsBootEq OverLitValDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.LitEq QualLitValDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.LitEq ModuleNameDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Module.NameEq RecFieldsDotDotDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.PatEq ForAllTyFlagDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.SpecificityEq SpecificityDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.SpecificityEq HsIPNameDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.TypeEq PromotionFlagDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.TypeEq ShortTextDefined in ghc-boot-10.0.0.20260917 · GHC.Data.ShortTextEq DbInstUnitIdDefined in ghc-boot-10.0.0.20260917 · GHC.Unit.DatabaseEq DbModuleDefined in ghc-boot-10.0.0.20260917 · GHC.Unit.DatabaseEq VoidDefined in ghc-internal-10.0.0 · GHC.Internal.BaseEq BigNatDefined in ghc-internal-10.0.0 · GHC.Internal.Bignum.BigNatEq IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.Bignum.IntegerEq NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.Bignum.NaturalEq ByteOrderDefined in ghc-internal-10.0.0 · GHC.Internal.ByteOrderEq ClosureTypeDefined in ghc-internal-10.0.0 · GHC.Internal.ClosureTypesEq BlockReasonDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncEq ThreadIdDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncEq ThreadStatusDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncEq ConstrDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataEquality of constructors
Eq ConstrRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataEq DataRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataEq FixityDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataEq AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq SomeTypeRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.InternalEq UniqueDefined in ghc-internal-10.0.0 · GHC.Internal.Data.UniqueEq VersionDefined in ghc-internal-10.0.0 · GHC.Internal.Data.VersionEq ControlMessageDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ControlEq EPollFdDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollEq EventTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollEq EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesEq EventLifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesEq LifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesEq FdKeyDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ManagerEq StateDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ManagerEq EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.PollEq TimeoutKeyDefined in ghc-internal-10.0.0 · GHC.Internal.Event.TimeOutEq StateDefined in ghc-internal-10.0.0 · GHC.Internal.Event.TimerManagerEq UniqueDefined in ghc-internal-10.0.0 · GHC.Internal.Event.UniqueEq ErrorCallDefined in ghc-internal-10.0.0 · GHC.Internal.ExceptionEq ArithExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeEq SpecConstrAnnotationDefined in ghc-internal-10.0.0 · GHC.Internal.ExtsEq FingerprintDefined in ghc-internal-10.0.0 · GHC.Internal.Fingerprint.TypeEq ErrnoDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.ErrorEq CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CClockDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CSUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CTimeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEq IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrEq WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrEq ForeignSrcLangDefined in ghc-internal-10.0.0 · GHC.Internal.ForeignSrcLangEq AssociativityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq FixityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq PrimTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresEq TsoFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresEq WhatNextDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresEq WhyBlockedDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresEq HalfWordDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesEq StgInfoTableDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesEq CostCentreDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesEq CostCentreStackDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesEq IndexTableDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesEq StgTSOProfInfoDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesEq MaskingStateDefined in ghc-internal-10.0.0 · GHC.Internal.IOEq BufferStateDefined in ghc-internal-10.0.0 · GHC.Internal.IO.BufferEq IODeviceTypeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.DeviceEq SeekModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.DeviceEq CodingProgressDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Encoding.TypesEq ArrayExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionEq AsyncExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionEq ExitCodeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionEq IOErrorTypeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionEq IOExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionEq HandlePosnDefined in ghc-internal-10.0.0 · GHC.Internal.IO.HandleEq BufferModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesEq HandleDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesEq NewlineDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesEq NewlineModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesEq IOModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.IOModeEq IoSubSystemDefined in ghc-internal-10.0.0 · GHC.Internal.IO.SubSystemEq InfoProvDefined in ghc-internal-10.0.0 · GHC.Internal.InfoProv.TypesEq Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntEq Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntEq Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntEq Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntEq ExtensionDefined in ghc-internal-10.0.0 · GHC.Internal.LanguageExtensionsEq IoManagerFlagDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsEq ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsEq WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsEq ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfEq WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfEq StackEntryDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.DecodeEq SrcLocDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.TypesEq CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CCcDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CSpeedDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CTimerDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEq AnnLookupDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq AnnTargetDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq BangDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq BndrVisDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq BodyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq BytesDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq CallconvDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq ClauseDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq ConDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq DecDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq DerivClauseDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq DerivStrategyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq DocLocDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq ExpDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq FamilyResultSigDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq FixityDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq FixityDirectionDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq ForeignDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq FunDepDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq GuardDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq InfoDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq InjectivityAnnDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq InlineDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq LitDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq LocDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq MatchDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq ModNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq ModuleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq ModuleInfoDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq NameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq NameFlavourDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq NameSpaceDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq NamespaceSpecifierDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq OccNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq OverlapDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq PatDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq PatSynArgsDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq PatSynDirDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq PhasesDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq PkgNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq PragmaDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq RangeDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq RoleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq RuleBndrDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq RuleMatchDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq SafetyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq SpecificityDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq StmtDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq TyLitDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq TySynEqnDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq TypeDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq TypeFamilyHeadDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq LexemeDefined in ghc-internal-10.0.0 · GHC.Internal.Text.Read.LexEq NumberDefined in ghc-internal-10.0.0 · GHC.Internal.Text.Read.LexEq SomeCharDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsEq SomeSymbolDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsEq SomeNatDefined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsEq BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq CharDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq FloatDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq IntDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq ModuleDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq TrNameDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq TyConDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq WordDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq GeneralCategoryDefined in ghc-internal-10.0.0 · GHC.Internal.UnicodeEq Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordEq Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordEq Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordEq Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordEq ArchDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSEq ArchOSDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSEq ArmABIDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSEq ArmISADefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSEq ArmISAExtDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSEq OSDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSEq PPC_64ABIDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSEq LibraryDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.LibraryEq ProgramDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.ProgramEq TargetDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.TargetEq WordSizeDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.TargetEq ArDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.ArEq CcDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CcEq CmmCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppEq CppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppEq HsCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppEq JsCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppEq CxxDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CxxEq CcLinkDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.LinkEq MergeObjsDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.MergeObjsEq NmDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.NmEq RanlibDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.RanlibEq BoxLabelDefined in hpc-0.7.0.2 · Trace.Hpc.MixEq CondBoxDefined in hpc-0.7.0.2 · Trace.Hpc.MixEq MixDefined in hpc-0.7.0.2 · Trace.Hpc.MixEq TixDefined in hpc-0.7.0.2 · Trace.Hpc.TixEq TixModuleDefined in hpc-0.7.0.2 · Trace.Hpc.TixEq HashDefined in hpc-0.7.0.2 · Trace.Hpc.UtilEq HpcPosDefined in hpc-0.7.0.2 · Trace.Hpc.UtilEq EncodingExceptionDefined in os-string-2.0.11 · System.OsString.Encoding.InternalEq OsCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesByte equality of the internal representation.
Eq OsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesByte equality of the internal representation.
Eq PosixCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesEq PosixStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesEq WindowsCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesEq WindowsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesEq ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassEq DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJEq PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassEq CmdSpecDefined in process-1.6.30.0 · System.Process.CommonEq CreateProcessDefined in process-1.6.30.0 · System.Process.CommonEq StdStreamDefined in process-1.6.30.0 · System.Process.CommonEq CommunicationHandleDefined in process-1.6.30.0 · System.Process.CommunicationHandle.InternalEq SemaphoreErrorDefined in semaphore-compat-2.0.1 · System.Semaphore.Internal.VersionEq SemaphoreNameDefined in semaphore-compat-2.0.1 · System.Semaphore.Internal.VersionEq SemaphoreProtocolVersionDefined in semaphore-compat-2.0.1 · System.Semaphore.Internal.VersionEq TSemDefined in stm-2.5.3.1 · Control.Concurrent.STM.TSemEq UnicodeExceptionDefined in text-2.1.4 · Data.Text.Encoding.ErrorEq I8Defined in text-2.1.4 · Data.Text.ForeignEq TextDefined in text-2.1.4 · Data.Text · orphanEq BuilderDefined in text-2.1.4 · Data.Text.Internal.BuilderEq PartialUtf8CodePointDefined in text-2.1.4 · Data.Text.Internal.EncodingEq Utf8StateDefined in text-2.1.4 · Data.Text.Internal.EncodingEq DecoderStateDefined in text-2.1.4 · Data.Text.Internal.Encoding.Utf8Eq SizeDefined in text-2.1.4 · Data.Text.Internal.Fusion.SizeEq TextDefined in text-2.1.4 · Data.Text.Lazy · orphanEq CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Calendar.CalendarDiffDaysEq DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysEq MonthDefined in time-1.16.0.1 · Data.Time.Calendar.MonthEq QuarterDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterEq QuarterOfYearDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterEq DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekEq FirstWeekTypeDefined in time-1.16.0.1 · Data.Time.Calendar.WeekDateEq AbsoluteTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.AbsoluteTimeEq DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeEq NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeEq SystemTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.SystemTimeEq UTCTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTimeEq UniversalTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTimeEq TimeLocaleDefined in time-1.16.0.1 · Data.Time.Format.LocaleEq WeekTypeDefined in time-1.16.0.1 · Data.Time.Format.Parse.InstancesEq CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.CalendarDiffTimeEq LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeEq TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayEq TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneEq DirTypeDefined in unix-2.8.8.0 · System.Posix.Directory.CommonEq AdviceDefined in unix-2.8.8.0 · System.Posix.FcntlEq CAttributesDefined in unix-2.8.8.0 · System.Posix.Files.CommonEq StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonEq StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonEq OpenFileFlagsDefined in unix-2.8.8.0 · System.Posix.IO.CommonEq OpenModeDefined in unix-2.8.8.0 · System.Posix.IO.CommonEq ProcessStatusDefined in unix-2.8.8.0 · System.Posix.Process.InternalsEq ResourceDefined in unix-2.8.8.0 · System.Posix.ResourceEq ResourceLimitDefined in unix-2.8.8.0 · System.Posix.ResourceEq ResourceLimitsDefined in unix-2.8.8.0 · System.Posix.ResourceEq BaudRateDefined in unix-2.8.8.0 · System.Posix.Terminal.CommonEq GroupEntryDefined in unix-2.8.8.0 · System.Posix.User.CommonEq UserEntryDefined in unix-2.8.8.0 · System.Posix.User.CommonEq ()Defined in ghc-internal-10.0.0 · GHC.Internal.ClassesIsPass p => Eq (CCallTarget (GhcPass p))Defined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphanIsUnitId u => Eq (GenUnit u)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesEq (Chan a)Defined in base-4.23.0.0 · Control.Concurrent.ChanEq (MutableByteArray s)Defined in base-4.23.0.0 · Data.Array.ByteEq (IgnoreFormat Loc)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.BaseEq (CoAxiom br)Defined in ghc-10.0.0.20260917 · GHC.Core.Coercion.AxiomEq (DeBruijn CoreAlt)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.Expr · orphanEq (DeBruijn CoreExpr)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.Expr · orphanEq (DeBruijn Coercion)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeEq (DeBruijn Type)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeEq (DeBruijn Var)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeEq (DeBruijn a) => Eq (DeBruijn (Maybe a))Defined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeEq (DeBruijn a) => Eq (DeBruijn [a])Defined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeEq (IEThingAllExt GhcPs)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (IEThingAllExt GhcRn)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (IEThingAllExt GhcTc)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (IEWholeNamespaceExt GhcPs)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (IEWholeNamespaceExt GhcRn)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (IEWholeNamespaceExt GhcTc)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (FormatReportWarningsMode ann)Defined in ghc-10.0.0.20260917 · GHC.HsToCore.PmcEq (EpToken tok)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq (CompleteMatchX con)Defined in ghc-10.0.0.20260917 · GHC.Types.CompleteMatchEq (GenTickish 'TickishPassCmm)Defined in ghc-10.0.0.20260917 · GHC.Types.TickishEq (GenTickish 'TickishPassCore)Defined in ghc-10.0.0.20260917 · GHC.Types.TickishEq (UniqDSet a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSetEq (UniqSet a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.SetEq (GenInstantiatedUnit unit)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesEq (InWarningCategory GhcPs)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.Warnings · orphanEq (InWarningCategory GhcRn)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.Warnings · orphanEq (InWarningCategory GhcTc)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.Warnings · orphanEq (WarningTxt GhcPs)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.Warnings · orphanEq (WarningTxt GhcRn)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.Warnings · orphanEq (WarningTxt GhcTc)Defined in ghc-10.0.0.20260917 · GHC.Unit.Module.Warnings · orphanEq (Header (GhcPass p))Defined in ghc-10.0.0.20260917 · GHC.Types.ForeignCall · orphanEq (XXLit x) => Eq (HsLit x)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.LitEq (XXOverLit p) => Eq (HsOverLit p)Defined in ghc-10.0.0.20260917 · GHC.Hs.Lit · orphanEq (XXQualLit p) => Eq (HsQualLit p)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.LitEq (IE GhcPs)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (IE GhcRn)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (IE GhcTc)Defined in ghc-10.0.0.20260917 · GHC.Hs.Instances · orphanEq (IEWrappedName GhcPs)Defined in ghc-10.0.0.20260917 · GHC.Hs.ImpExp · orphanEq (IEWrappedName GhcRn)Defined in ghc-10.0.0.20260917 · GHC.Hs.ImpExp · orphanEq (IEWrappedName GhcTc)Defined in ghc-10.0.0.20260917 · GHC.Hs.ImpExp · orphanEq (ConstPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.ConstPtrEq (ForeignPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.ForeignPtrEq (IORef a)Defined in ghc-internal-10.0.0 · GHC.Internal.IORefPointer equality.
Eq (MVar a)Defined in ghc-internal-10.0.0 · GHC.Internal.MVarCompares the underlying pointers.
Eq (FunPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.PtrEq (Ptr a)Defined in ghc-internal-10.0.0 · GHC.Internal.PtrEq (TVar a)Defined in ghc-internal-10.0.0 · GHC.Internal.STMEq (StablePtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.StableEq (StableName a)Defined in ghc-internal-10.0.0 · GHC.Internal.StableNameEq (SChar c)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsEq (SSymbol s)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsEq (SNat n)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsEq (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq (TBQueue a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TBQueueEq (TChan a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TChanEq (TMVar a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TMVarEq (TQueue a)Defined in stm-2.5.3.1 · Control.Concurrent.STM.TQueueEq (TVar a)Defined in stm-2.5.3.1 · Control.Sequential.STMEq a => Eq (Complex a)Defined in base-4.23.0.0 · Data.ComplexEq a => Eq (First a)Defined in base-4.23.0.0 · Data.SemigroupEq a => Eq (Last a)Defined in base-4.23.0.0 · Data.SemigroupEq a => Eq (Max a)Defined in base-4.23.0.0 · Data.SemigroupEq a => Eq (Min a)Defined in base-4.23.0.0 · Data.SemigroupEq a => Eq (IntMap a)Defined in containers-0.8 · Data.IntMap.InternalEq a => Eq (Seq a)Defined in containers-0.8 · Data.Sequence.InternalEq a => Eq (ViewL a)Defined in containers-0.8 · Data.Sequence.InternalEq a => Eq (ViewR a)Defined in containers-0.8 · Data.Sequence.InternalEq a => Eq (Intersection a)Defined in containers-0.8 · Data.Set.InternalEq a => Eq (Set a)Defined in containers-0.8 · Data.Set.InternalEq a => Eq (PostOrder a)Defined in containers-0.8 · Data.TreeEq a => Eq (Tree a)Defined in containers-0.8 · Data.TreeEq a => Eq (LPath a)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.GraphEq a => Eq (FromListCounting a)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.PatriciaTreeEq a => Eq (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Data.StrictEq a => Eq (Word64Map a)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalEq a => Eq (OnOff a)Defined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEq a => Eq (HieArgs a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq a => Eq (HieType a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq a => Eq (IdentifierDetails a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEq a => Eq (EvidenceInfo a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.UtilsEq a => Eq (AnnList a)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq a => Eq (NonVoid a)Defined in ghc-10.0.0.20260917 · GHC.StgToCmm.ClosureEq a => Eq (Branch a)Defined in ghc-10.0.0.20260917 · GHC.StgToJS.ExprEq a => Eq (EpaLocation' a)Defined in ghc-10.0.0.20260917 · GHC.Types.SrcLocEq a => Eq (Edit a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.FMEq a => Eq (FixedLengthEncoding a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryEq a => Eq (DataDefnCons a)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.DeclsEq a => Eq (NonEmpty a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseEq a => Eq (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsEq a => Eq (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsEq a => Eq (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsEq a => Eq (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsEq a => Eq (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityEq a => Eq (First a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidEq a => Eq (Last a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidEq a => Eq (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdEq a => Eq (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq a => Eq (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq a => Eq (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq a => Eq (ZipList a)Defined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListEq a => Eq (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.MaybeEq a => Eq (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealEq a => Eq (AnnotDetails a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq a => Eq (Span a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJEq a => Eq (Stream a)Defined in text-2.1.4 · Data.Text.Internal.Fusion.TypesEq a => Eq (a)Defined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq a => Eq [a]Defined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq ann => Eq (EpAnn ann)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq b => Eq (GroupEdges b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.GraphEq e => Eq (ActivationX e)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Binds.InlinePragmaEq flag => Eq (TyVarBndr flag)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxEq m => Eq (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupEq mod => Eq (GenWithIsBoot mod)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesEq p => Eq (Par1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq tag => Eq (AnnSortKey tag)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq tc => Eq (TyConFlavour tc)Defined in ghc-10.0.0.20260917 · GHC.Types.BasicEq unit => Eq (Definite unit)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesEq unit => Eq (GenModule unit)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesEq v => Eq (LabelMap v)Defined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelEq val => Eq (TaggedVal val)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DFMEq vertex => Eq (SCC vertex)Defined in containers-0.8 · Data.Graph(Eq (LIdP p), Eq (LBooleanFormula p)) => Eq (BooleanFormula p)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BooleanFormula(Eq (LIdP pass), Eq (XCFieldOcc pass), Eq (XXFieldOcc pass)) => Eq (FieldOcc pass)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Type(Eq (XOverlapMode pass), Eq (XXOverlapMode pass)) => Eq (OverlapMode pass)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.Overlap(Eq (XXActivation pass), Eq (XInlinePragma pass), Eq (XXInlinePragma pass)) => Eq (InlinePragma pass)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Binds.InlinePragmaEq (IOUArray i e)Defined in array-0.5.8.0 · Data.Array.IO.InternalsEq (Fixed a)Defined in base-4.23.0.0 · Data.FixedEq (CmmNode e x)Defined in ghc-10.0.0.20260917 · GHC.Cmm.NodeEq (Point s a)Defined in ghc-10.0.0.20260917 · GHC.Data.UnionFindEq (EpUniToken tok utok)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationEq (Bin a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryEq (RelBin a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryEq (RelBinPtr a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryEq (Proxy s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyEq (TypeRep a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.InternalEq (U1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (V1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (IOArray i e)Defined in ghc-internal-10.0.0 · GHC.Internal.IOArrayEq (STRef s a)Defined in ghc-internal-10.0.0 · GHC.Internal.STRefPointer equality.
Eq a => Eq (Arg a b)Defined in base-4.23.0.0 · Data.Semigroup(Eq1 f, Eq a) => Eq (Lift f a)Defined in transformers-0.6.3.0 · Control.Applicative.Lift(Eq1 m, Eq a) => Eq (MaybeT m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Maybe(Eq (IdP pass), Eq a) => Eq (WithHsDocIdentifiers a pass)Defined in ghc-10.0.0.20260917 · GHC.Hs.Doc(Eq a, Eq b) => Eq (Pair a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Strict(Eq a, Eq b) => Eq (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(Eq a, Eq b) => Eq (a, b)Defined in ghc-internal-10.0.0 · GHC.Internal.Classes(Eq a, Ord b) => Eq (Gr a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.PatriciaTree(Eq b, Eq r) => Eq (IfaceBindingX r b)Defined in ghc-10.0.0.20260917 · GHC.Iface.Syntax(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.8 · Data.Map.Internal(Eq k, Eq a) => Eq (UniqMap k a)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.Map(Eq l, Eq e) => Eq (GenLocated l e)Defined in ghc-10.0.0.20260917 · GHC.Types.SrcLoc(Eq var, Eq argf) => Eq (VarBndr var argf)Defined in ghc-10.0.0.20260917 · GHC.Types.Var(Ix i, Eq e) => Eq (Array i e)Defined in ghc-internal-10.0.0 · GHC.Internal.Arr(Ix ix, Eq e, IArray UArray e) => Eq (UArray ix e)Defined in array-0.5.8.0 · Data.Array.BaseEq (STUArray s i e)Defined in array-0.5.8.0 · Data.Array.BaseEq (STArray s i e)Defined in ghc-internal-10.0.0 · GHC.Internal.ArrEq (Coercion a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.CoercionEq (OrderingI a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.OrdEq (URec Char p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec Double p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec Float p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec Int p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec Word p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec (Ptr ()) p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (a :~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityEq (f a) => Eq (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidEq (f a) => Eq (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq (f p) => Eq (Rec1 f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq a => Eq (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstEq a => Eq (Constant a b)Defined in transformers-0.6.3.0 · Data.Functor.ConstantEq ele => Eq (UniqFM key ele)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.FM(Eq1 f, Eq a) => Eq (Backwards f a)Defined in transformers-0.6.3.0 · Control.Applicative.Backwards(Eq1 f, Eq a) => Eq (IdentityT f a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Identity(Eq1 f, Eq a) => Eq (Reverse f a)Defined in transformers-0.6.3.0 · Data.Functor.Reverse(Eq a, Eq b, Eq c) => Eq (a, b, c)Defined in ghc-internal-10.0.0 · GHC.Internal.Classes(Eq e, Eq1 m, Eq a) => Eq (ExceptT e m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Except(Eq w, Eq1 m, Eq a) => Eq (WriterT w m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Lazy(Eq w, Eq1 m, Eq a) => Eq (WriterT w m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Strict(Generic1 f, Eq (Rep1 f a)) => Eq (Generically1 f a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (a :~~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityEq c => Eq (K1 i c p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Eq (f a), Eq (g a)) => Eq (Product f g a)Defined in base-4.23.0.0 · Data.Functor.Product(Eq (f a), Eq (g a)) => Eq (Sum f g a)Defined in base-4.23.0.0 · Data.Functor.Sum(Eq (f p), Eq (g p)) => Eq ((:*:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Eq (f p), Eq (g p)) => Eq ((:+:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)Defined in ghc-internal-10.0.0 · GHC.Internal.ClassesEq (f (g a)) => Eq (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.ComposeEq (f (g p)) => Eq ((:.:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (f p) => Eq (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Graph gr, Ord a, Ord b) => Eq (OrdGr gr a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.Graph(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)Defined in ghc-internal-10.0.0 · GHC.Internal.Classes(Eq uid, Eq modulename, Eq mod, Eq srcpkgid, Eq srcpkgname) => Eq (GenericUnitInfo srcpkgid srcpkgname uid modulename mod)Defined in ghc-boot-10.0.0.20260917 · GHC.Unit.Database(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f)Defined in ghc-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.Classes
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=
- Transitivity
if
x <= y && y <= z=
, then
x <= z=
- Reflexivity
x <= x=
- Antisymmetry
if
x <= y && y <= x=
, then
x == y=
The following operator interactions are expected to hold:
x >= y=y <= xx < y=x <= y && x /= yx > y=y < xx < y=compare x y == LTx > y=compare x y == GTx == y=compare x y == EQmin x y == if x <= y then x else y= Truemax 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 (==). Users who expect a stronger guarantee are advised
to write their own min and/or max functions.
The nuance of the above distinction is not always fully internalized by
developers, and in the past (tracing back to the Haskell 1.4 Report) the
specification for Ord asserted the stronger property that (min x y, max x
y) = (x, y) or (y, x), or in other words, that min and max will
return one of their arguments, using argument order as the tie-breaker if
the arguments are equal by comparison. A few list and
Foldable functions have behavior that is best understood
with this assumption in mind: all variations of minimumBy and maximumBy
(which can't use min and max in their implementations) are written such
that minimumBy compare and maximumBy compare are respectively
equivalent to minimum and maximum (which do use min and max) only if
min and max adhere to this tie-breaking convention. Otherwise, if there
are multiple least or largest elements in a container, minimum and
maximum may not return the same one that minimumBy compare and
maximumBy compare do (though they should return something that is
equal). (This is relevant for types with non-extensional equality, like
Arg, but also in cases where the precise reference held
matters for memory-management reasons.) Unless there is a reason to deviate,
it is less confusing for implementors of Ord to respect this same
convention (as the default definitions of min and max do).
Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.
Instances604Ord, …
Ord ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteNon-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions.
Ord ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeOrd ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalOrd ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalLexicographic order.
Ord IntSetDefined in containers-0.8 · Data.IntSet.InternalOrd IntersectionDefined in containers-0.8 · Data.IntSet.InternalOrd FileTypeDefined in directory-1.3.11.0 · System.Directory.Internal.CommonOrd PermissionsDefined in directory-1.3.11.0 · System.Directory.Internal.CommonOrd XdgDirectoryDefined in directory-1.3.11.0 · System.Directory.Internal.CommonOrd XdgDirectoryListDefined in directory-1.3.11.0 · System.Directory.Internal.CommonOrd PrimOpDefined in ghc-10.0.0.20260917 · GHC.Builtin.PrimOpsOrd PrimOpEffectDefined in ghc-10.0.0.20260917 · GHC.Builtin.PrimOpsOrd InternalBreakpointIdDefined in ghc-10.0.0.20260917 · GHC.ByteCode.BreakpointsOrd LocalLabelDefined in ghc-10.0.0.20260917 · GHC.ByteCode.InstrOrd BCOIxDefined in ghc-10.0.0.20260917 · GHC.ByteCode.LinkerOrd ByteOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesOrd HalfWordDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesOrd RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesOrd WordOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesOrd CmmInfoTableDefined in ghc-10.0.0.20260917 · GHC.CmmOrd ProfilingInfoDefined in ghc-10.0.0.20260917 · GHC.CmmOrd CLabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd CmmLabelInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd ConInfoTableLocationDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd DynamicLinkerLabelInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd ForeignLabelSourceDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd IdLabelInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd InfoProvEntDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd ModuleLabelKindDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd NeedExternDeclDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd RtsLabelInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelOrd TickyIdInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelDon't depend on this if you need determinism. No determinism in the ncg backend, so we use the unique for Ord. Even if it pains me slightly.
Ord LabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelOrd LabelSetDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelOrd RPNumDefined in ghc-10.0.0.20260917 · GHC.Cmm.DominatorsOrd AlignmentSpecDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprOrd AreaDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprOrd CAFfyLabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.Info.BuildOrd SRTEntryDefined in ghc-10.0.0.20260917 · GHC.Cmm.Info.BuildOrd SomeLabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.Info.BuildOrd MemoryOrderingDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpOrd CmmTickScopeDefined in ghc-10.0.0.20260917 · GHC.Cmm.NodeOrd CmmRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegOrd GlobalArgRegsDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegOrd GlobalRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegOrd GlobalRegUseDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegOrd LocalRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegOrd WidthDefined in ghc-10.0.0.20260917 · GHC.Cmm.TypeOrd TargetDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrOrd BlockChainDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.BlockLayoutOrd CfgEdgeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGEdges are sorted ascending pointwise by weight, source and destination
Ord EdgeWeightDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGOrd FormatDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.FormatOrd ScalarFormatDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.FormatOrd RegSubDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseOrd ReadingOrWritingDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.BaseOrd VLocDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.BaseOrd SymNameDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesOrd PaddingDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenOrd StackRefDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenOrd LlvmVersionDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.Version.TypeOrd AltConDefined in ghc-10.0.0.20260917 · GHC.CoreOrd TickDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.StatsOrd EqRelDefined in ghc-10.0.0.20260917 · GHC.Core.PredicateOrd InvisibleBitDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareOrd TypeOrderingDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareOrd CoSelDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepOrd FunSelDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepOrd UnivCoProvenanceDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.RepOrd PrimElemRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConOrd PrimOrVoidRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConOrd PrimRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConOrd OverridingBoolDefined in ghc-10.0.0.20260917 · GHC.Data.BoolOrd LexicalFastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringOrd NonDetFastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringOrd EdgeTypeDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.DirectedOrd TimeDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.DirectedOrd Word64SetDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Set.InternalOrd CodeGenEnableDefined in ghc-10.0.0.20260917 · GHC.Driver.DownsweepOrd DynamicTooStateDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsOrd ModRenamingDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsOrd PackageArgDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsOrd PackageDBFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsOrd PackageFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsOrd PkgDbRefDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsOrd DeprecationDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsOrd WarningFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsOrd HsDocStringChunkDefined in ghc-10.0.0.20260917 · GHC.Hs.DocStringOrd HsDocStringDecoratorDefined in ghc-10.0.0.20260917 · GHC.Hs.DocStringOrd PmLitDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesOrd CompressionIFaceDefined in ghc-10.0.0.20260917 · GHC.Iface.BinaryOrd BindTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd ContextInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd DeclTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd EntityInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd EvBindDepsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd EvVarSourceDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd HieNameDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd IETypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd NodeAnnotationDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd NodeOriginDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd RecFieldContextDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd ScopeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd TyVarScopeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesOrd UnfoldingExposureDefined in ghc-10.0.0.20260917 · GHC.Iface.TidyOrd IfLclNameDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceAppArgsDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceAxiomRuleDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceBndrDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceCoercionDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceMCoercionDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceTyConDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceTyConInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceTyConSortDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceTyLitDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd IfaceTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeOrd AOpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxOrd OpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxOrd UOpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxOrd MultiplicityDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleOrd VarDeclDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleOrd AOpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxOrd OpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxOrd UOpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxOrd MetaIdDefined in ghc-10.0.0.20260917 · GHC.Llvm.MetaDataOrd BindTagDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationOrd DeclTagDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationOrd HasEDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationOrd IsUnicodeSyntaxDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationOrd NoEpAnnsDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationOrd LexErrDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesOrd LexErrKindDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesOrd NumUnderscoreReasonDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesOrd BmiVersionDefined in ghc-10.0.0.20260917 · GHC.PlatformOrd PlatformDefined in ghc-10.0.0.20260917 · GHC.PlatformOrd PlatformWordSizeDefined in ghc-10.0.0.20260917 · GHC.PlatformOrd SseAvxVersionDefined in ghc-10.0.0.20260917 · GHC.PlatformOrd PlatformConstantsDefined in ghc-10.0.0.20260917 · GHC.Platform.ConstantsOrd ProfileDefined in ghc-10.0.0.20260917 · GHC.Platform.ProfileOrd RealRegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegOrd RegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegOrd VirtualRegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegOrd RegArchDefined in ghc-10.0.0.20260917 · GHC.Platform.Reg.ClassOrd RegClassDefined in ghc-10.0.0.20260917 · GHC.Platform.Reg.ClassOrd WayDefined in ghc-10.0.0.20260917 · GHC.Platform.WaysOrd ArgDescrDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutOrd ClosureTypeInfoDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutOrd SMRepDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutOrd StgLiftConfigDefined in ghc-10.0.0.20260917 · GHC.Stg.Lift.ConfigOrd StgToDoDefined in ghc-10.0.0.20260917 · GHC.Stg.PipelineOrd CounterTypeDefined in ghc-10.0.0.20260917 · GHC.Stg.StatsOrd NoExtFieldSilentDefined in ghc-10.0.0.20260917 · GHC.Stg.SyntaxOrd DiscrDefined in ghc-10.0.0.20260917 · GHC.StgToByteCodeOrd ArgRepDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.ArgRepOrd ApplyConvDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ApplyOrd ApplySpecDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ApplyOrd BlockRefDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectOrd ExportedFunDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectOrd JSOptionsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectOrd ObjectKindDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectOrd StgRegDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsOrd StgRetDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsOrd CILayoutDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd CIRegsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd CITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd ClosureTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd ExpFunDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd IdKeyDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd IdTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd OtherSymbDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd StackSlotDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd StaticUnboxedDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd ThreadStatusDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesOrd SlotCountDefined in ghc-10.0.0.20260917 · GHC.StgToJS.UtilsOrd HoleFitSortingAlgDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.HoleOrd HoleFitCandidateDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.Hole.FitTypesOrd TcHoleFitDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.Hole.FitTypesCompare HoleFits by their Name. Use stableNameCmp to avoid non-determinism.
When comparing, we want HoleFits with a lower refinement level to come first.
Ord DocLocDefined in ghc-10.0.0.20260917 · GHC.Tc.TypesOrd SubGoalDepthDefined in ghc-10.0.0.20260917 · GHC.Tc.Types.CtLocOrd SimpleUnifyResultDefined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifyOrd DetOrdAvailsDefined in ghc-10.0.0.20260917 · GHC.Types.AvailOrd AlignmentDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd FunctionOrDataDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd ImportLevelDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd IntWithInfDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd LeftOrRightDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd LevityDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd PprPrecDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd TupleSortDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd TypeOrConstraintDefined in ghc-10.0.0.20260917 · GHC.Types.BasicOrd CCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreOrd CostCentreDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreOrd CostCentreStackDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreOrd IndexedCCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreOrd CostCentreIndexDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentre.StateOrd DiagnosticCodeDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorOrd SeverityDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorOrd AssumedDerivingStrategyDefined in ghc-10.0.0.20260917 · GHC.Types.HintOrd CafInfoDefined in ghc-10.0.0.20260917 · GHC.Types.Id.InfoOrd LitNumTypeDefined in ghc-10.0.0.20260917 · GHC.Types.LiteralOrd LiteralDefined in ghc-10.0.0.20260917 · GHC.Types.LiteralNeeded for the
Ordinstance ofAltCon, which in turn is needed inGHC.Data.TrieMap.CoreMap.Ord LitFloatingDefined in ghc-10.0.0.20260917 · GHC.Types.Literal.FloatingThe ordering represented by this instance is pretty arbitrary and may change without notice. Do not rely on its behavior!
Ord LitFloatingTypeDefined in ghc-10.0.0.20260917 · GHC.Types.Literal.FloatingOrd NameDefined in ghc-10.0.0.20260917 · GHC.Types.NameCaution: This instance is implemented via nonDetCmpUnique, which means that the ordering is not stable across deserialization or rebuilds.
See nonDetCmpUnique for further information, and #15240 for a bug caused by improper use of this instance.
Ord NameSpaceDefined in ghc-10.0.0.20260917 · GHC.Types.Name.OccurrenceOrd OccNameDefined in ghc-10.0.0.20260917 · GHC.Types.Name.OccurrenceOrd RdrNameDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderOrd PkgQualDefined in ghc-10.0.0.20260917 · GHC.Types.PkgQualOrd SlotTyDefined in ghc-10.0.0.20260917 · GHC.Types.RepTypeOrd SaneDoubleDefined in ghc-10.0.0.20260917 · GHC.Types.SaneDoubleOrd HsBootOrSigDefined in ghc-10.0.0.20260917 · GHC.Types.SourceFileOrd HscSourceDefined in ghc-10.0.0.20260917 · GHC.Types.SourceFileOrd FractionalExponentBaseDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextOrd FractionalLitDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextBe wary of using this instance to compare for equal *values* when exponents are large. The same value expressed in different syntactic form won't compare as equal when any of the exponents is >= 100.
Ord IntegralLitDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextOrd BufPosDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocOrd BufSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocOrd DeltaPosDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocOrd NoCommentsDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocOrd PsLocDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocOrd PsSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocOrd RealSrcLocDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocOrd RealSrcSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocOrd ThLevelIndexDefined in ghc-10.0.0.20260917 · GHC.Types.ThLevelIndexOrd BreakpointIdDefined in ghc-10.0.0.20260917 · GHC.Types.TickishOrd UniqueSetDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SetOrd FunTyFlagDefined in ghc-10.0.0.20260917 · GHC.Types.VarOrd VarDefined in ghc-10.0.0.20260917 · GHC.Types.VarOrd IfaceImportLevelDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.DepsOrd NDModuleDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.EnvOrd ModuleGraphInvariantErrorDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphOrd ModuleGraphNodeDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphOrd NodeKeyDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphOrd ZeroScopeKeyDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphOrd ModNodeKeyWithUidDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.ModNodeKeyOrd ModuleStageDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.StageOrd IsTrustedDefined in ghc-10.0.0.20260917 · GHC.Unit.StateOrd UnitDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesOrd UnitIdDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesOrd FullBinDataDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryOrd RoleDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.BasicOrd DataConCantHappenDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ExtensionOrd NoExtFieldDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ExtensionOrd IsBootInterfaceDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ImpExp.IsBootOrd OverLitValDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.LitOrd QualLitValDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.LitOrd ModuleNameDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Module.NameOrd RecFieldsDotDotDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.PatOrd ForAllTyFlagDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.SpecificityOrd SpecificityDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.SpecificityOrd PromotionFlagDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.TypeOrd ShortTextDefined in ghc-boot-10.0.0.20260917 · GHC.Data.ShortTextOrd VoidDefined in ghc-internal-10.0.0 · GHC.Internal.BaseOrd BigNatDefined in ghc-internal-10.0.0 · GHC.Internal.Bignum.BigNatOrd IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.Bignum.IntegerOrd NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.Bignum.NaturalOrd ByteOrderDefined in ghc-internal-10.0.0 · GHC.Internal.ByteOrderOrd ClosureTypeDefined in ghc-internal-10.0.0 · GHC.Internal.ClosureTypesOrd BlockReasonDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncOrd ThreadIdDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncOrd ThreadStatusDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncOrd AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalOrd AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalOrd SomeTypeRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.InternalOrd UniqueDefined in ghc-internal-10.0.0 · GHC.Internal.Data.UniqueOrd VersionDefined in ghc-internal-10.0.0 · GHC.Internal.Data.VersionOrd TimeoutKeyDefined in ghc-internal-10.0.0 · GHC.Internal.Event.TimeOutOrd UniqueDefined in ghc-internal-10.0.0 · GHC.Internal.Event.UniqueOrd ErrorCallDefined in ghc-internal-10.0.0 · GHC.Internal.ExceptionOrd ArithExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeOrd FingerprintDefined in ghc-internal-10.0.0 · GHC.Internal.Fingerprint.TypeOrd CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CClockDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CSUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CTimeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesOrd IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrOrd WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrOrd AssociativityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd FixityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd PrimTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresOrd TsoFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresOrd WhatNextDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresOrd WhyBlockedDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresOrd HalfWordDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesOrd CostCentreDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesOrd CostCentreStackDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesOrd IndexTableDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesOrd StgTSOProfInfoDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesOrd SeekModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.DeviceOrd ArrayExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionOrd AsyncExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionOrd ExitCodeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionOrd BufferModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesOrd NewlineDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesOrd NewlineModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesOrd IOModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.IOModeOrd Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntOrd Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntOrd Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntOrd Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntOrd ExtensionDefined in ghc-internal-10.0.0 · GHC.Internal.LanguageExtensionsOrd ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsOrd WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsOrd ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfOrd WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfOrd CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CCcDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CSpeedDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CTimerDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesOrd AnnLookupDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd AnnTargetDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd BangDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd BndrVisDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd BodyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd BytesDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd CallconvDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd ClauseDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd ConDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd DecDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd DerivClauseDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd DerivStrategyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd DocLocDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd ExpDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd FamilyResultSigDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd FixityDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd FixityDirectionDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd ForeignDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd FunDepDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd GuardDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd InfoDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd InjectivityAnnDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd InlineDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd LitDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd LocDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd MatchDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd ModNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd ModuleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd ModuleInfoDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd NameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd NameFlavourDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd NameSpaceDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd NamespaceSpecifierDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd OccNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd OverlapDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd PatDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd PatSynArgsDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd PatSynDirDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd PhasesDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd PkgNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd PragmaDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd RangeDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd RoleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd RuleBndrDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd RuleMatchDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd SafetyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd SpecificityDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd StmtDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd TyLitDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd TySynEqnDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd TypeDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd TypeFamilyHeadDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd SomeCharDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsOrd SomeSymbolDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsOrd SomeNatDefined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsOrd BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd CharDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesIEEE 754 Double-precision type includes not only numbers, but also positive and negative infinities and a special element called
NaN(which can be quiet or signal).IEEE 754-2008, section 5.11 requires that if at least one of arguments of <=, <, >, >= is
NaNthen the result of the comparison is False, andinstanceOrd Double complies with this requirement. This violates the reflexivity: bothNaN<=NaNandNaN>=NaNare False.IEEE 754-2008, section 5.10 defines
totalOrderpredicate. Unfortunately, compare on Doubles violates the IEEE standard and does not define a total order. More specifically, both compareNaNxand comparexNaNalways return GT.Thus, users must be extremely cautious when using
instanceOrd 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 infp-ieeepackage asTotallyOrderednewtype.Moving further, the behaviour of min and max with regards to
NaNis also non-compliant. IEEE 754-2008, section 5.3.1 defines that quietNaNshould be treated as a missing data byminNumandmaxNumfunctions, for example,minNum(NaN, 1) = minNum(1, NaN) = 1. Some languages such as Java deviate from the standard implementingminNum(NaN, 1) = minNum(1, NaN) = NaN. However, min / max inbaseare even worse: minNaN1 is 1, but min 1NaNisNaN.IEEE 754-2008 compliant min / max can be found in
ieee754package underminNum/maxNumnames. Implementations compliant withminimumNumber/maximumNumberfrom a newer IEEE 754-2019, section 9.6 are available fromfp-ieeepackage.Ord FloatDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd IntDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd TyConDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd WordDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd GeneralCategoryDefined in ghc-internal-10.0.0 · GHC.Internal.UnicodeOrd Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordOrd Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordOrd Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordOrd Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordOrd ArchDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSOrd ArchOSDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSOrd ArmABIDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSOrd ArmISADefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSOrd ArmISAExtDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSOrd OSDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSOrd PPC_64ABIDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSOrd LibraryDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.LibraryOrd ProgramDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.ProgramOrd TargetDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.TargetOrd WordSizeDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.TargetOrd ArDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.ArOrd CcDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CcOrd CmmCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppOrd CppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppOrd HsCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppOrd JsCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppOrd CxxDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CxxOrd CcLinkDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.LinkOrd MergeObjsDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.MergeObjsOrd NmDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.NmOrd RanlibDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.RanlibOrd BoxLabelDefined in hpc-0.7.0.2 · Trace.Hpc.MixOrd CondBoxDefined in hpc-0.7.0.2 · Trace.Hpc.MixOrd HpcPosDefined in hpc-0.7.0.2 · Trace.Hpc.UtilOrd OsCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesByte ordering of the internal representation.
Ord OsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesByte ordering of the internal representation.
Ord PosixCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesOrd PosixStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesOrd WindowsCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesOrd WindowsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesOrd PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassOrd PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassOrd CommunicationHandleDefined in process-1.6.30.0 · System.Process.CommunicationHandle.InternalOrd SemaphoreProtocolVersionDefined in semaphore-compat-2.0.1 · System.Semaphore.Internal.VersionOrd I8Defined in text-2.1.4 · Data.Text.ForeignOrd TextDefined in text-2.1.4 · Data.Text · orphanOrd BuilderDefined in text-2.1.4 · Data.Text.Internal.BuilderOrd TextDefined in text-2.1.4 · Data.Text.Lazy · orphanOrd DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysOrd MonthDefined in time-1.16.0.1 · Data.Time.Calendar.MonthOrd QuarterDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterOrd QuarterOfYearDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterOrd DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekOrd AbsoluteTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.AbsoluteTimeOrd DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeOrd NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeOrd SystemTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.SystemTimeOrd UTCTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UTCTimeOrd UniversalTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.UniversalTimeOrd TimeLocaleDefined in time-1.16.0.1 · Data.Time.Format.LocaleOrd LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeOrd TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayOrd TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneOrd DirTypeDefined in unix-2.8.8.0 · System.Posix.Directory.CommonOrd CAttributesDefined in unix-2.8.8.0 · System.Posix.Files.CommonOrd StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonOrd StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonOrd OpenFileFlagsDefined in unix-2.8.8.0 · System.Posix.IO.CommonOrd OpenModeDefined in unix-2.8.8.0 · System.Posix.IO.CommonOrd ProcessStatusDefined in unix-2.8.8.0 · System.Posix.Process.InternalsOrd BaudRateDefined in unix-2.8.8.0 · System.Posix.Terminal.CommonOrd ()Defined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd (IgnoreFormat Loc)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.BaseOrd (GenTickish 'TickishPassCmm)Defined in ghc-10.0.0.20260917 · GHC.Types.TickishOrd (GenTickish 'TickishPassCore)Defined in ghc-10.0.0.20260917 · GHC.Types.TickishOrd (GenInstantiatedUnit unit)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesOrd (XXOverLit p) => Ord (HsOverLit p)Defined in ghc-10.0.0.20260917 · GHC.Hs.Lit · orphanOrd (XXQualLit p) => Ord (HsQualLit p)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.LitOrd (ConstPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.ConstPtrOrd (ForeignPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.ForeignPtrOrd (FunPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.PtrOrd (Ptr a)Defined in ghc-internal-10.0.0 · GHC.Internal.PtrOrd (SChar c)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsOrd (SSymbol s)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsOrd (SNat n)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsOrd a => Ord (First a)Defined in base-4.23.0.0 · Data.SemigroupOrd a => Ord (Last a)Defined in base-4.23.0.0 · Data.SemigroupOrd a => Ord (Max a)Defined in base-4.23.0.0 · Data.SemigroupOrd a => Ord (Min a)Defined in base-4.23.0.0 · Data.SemigroupOrd a => Ord (IntMap a)Defined in containers-0.8 · Data.IntMap.InternalOrd a => Ord (Seq a)Defined in containers-0.8 · Data.Sequence.InternalOrd a => Ord (ViewL a)Defined in containers-0.8 · Data.Sequence.InternalOrd a => Ord (ViewR a)Defined in containers-0.8 · Data.Sequence.InternalOrd a => Ord (Intersection a)Defined in containers-0.8 · Data.Set.InternalOrd a => Ord (Set a)Defined in containers-0.8 · Data.Set.InternalOrd a => Ord (PostOrder a)Defined in containers-0.8 · Data.TreeOrd a => Ord (Tree a)Defined in containers-0.8 · Data.TreeOrd a => Ord (LPath a)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.GraphOrd a => Ord (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Data.StrictOrd a => Ord (Word64Map a)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalOrd a => Ord (EvidenceInfo a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.UtilsOrd a => Ord (FixedLengthEncoding a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryOrd a => Ord (NonEmpty a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseOrd a => Ord (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityOrd a => Ord (First a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidOrd a => Ord (Last a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidOrd a => Ord (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdOrd a => Ord (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalOrd a => Ord (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalOrd a => Ord (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalOrd a => Ord (ZipList a)Defined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListOrd a => Ord (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.MaybeOrd a => Ord (Stream a)Defined in text-2.1.4 · Data.Text.Internal.Fusion.TypesOrd a => Ord (a)Defined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd a => Ord [a]Defined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd flag => Ord (TyVarBndr flag)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxOrd m => Ord (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupOrd mod => Ord (GenWithIsBoot mod)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesOrd p => Ord (Par1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd unit => Ord (Definite unit)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesOrd unit => Ord (GenModule unit)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesOrd v => Ord (LabelMap v)Defined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelIntegral a => Ord (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealOrd (Fixed a)Defined in base-4.23.0.0 · Data.FixedOrd (Bin a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryOrd (RelBin a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryOrd (RelBinPtr a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryOrd (Proxy s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyOrd (TypeRep a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.InternalOrd (U1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (V1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd a => Ord (Arg a b)Defined in base-4.23.0.0 · Data.Semigroup(Ord1 f, Ord a) => Ord (Lift f a)Defined in transformers-0.6.3.0 · Control.Applicative.Lift(Ord1 m, Ord a) => Ord (MaybeT m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Maybe(Ord a, Ord b) => Ord (Pair a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Strict(Ord a, Ord b) => Ord (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(Ord a, Ord b) => Ord (a, b)Defined in ghc-internal-10.0.0 · GHC.Internal.Classes(Ord b, Ord r) => Ord (IfaceBindingX r b)Defined in ghc-10.0.0.20260917 · GHC.Iface.Syntax(Ord k, Ord v) => Ord (Map k v)Defined in containers-0.8 · Data.Map.Internal(Ord l, Ord e) => Ord (GenLocated l e)Defined in ghc-10.0.0.20260917 · GHC.Types.SrcLoc(Ord var, Ord argf) => Ord (VarBndr var argf)Defined in ghc-10.0.0.20260917 · GHC.Types.Var(Ix i, Ord e) => Ord (Array i e)Defined in ghc-internal-10.0.0 · GHC.Internal.Arr(Ix ix, Ord e, IArray UArray e) => Ord (UArray ix e)Defined in array-0.5.8.0 · Data.Array.BaseOrd (Coercion a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.CoercionOrd (URec Char p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Double p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Float p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Int p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Word p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec (Ptr ()) p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (a :~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityOrd (f a) => Ord (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidOrd (f a) => Ord (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalOrd (f p) => Ord (Rec1 f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd a => Ord (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstOrd a => Ord (Constant a b)Defined in transformers-0.6.3.0 · Data.Functor.Constant(Ord1 f, Ord a) => Ord (Backwards f a)Defined in transformers-0.6.3.0 · Control.Applicative.Backwards(Ord1 f, Ord a) => Ord (IdentityT f a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Identity(Ord1 f, Ord a) => Ord (Reverse f a)Defined in transformers-0.6.3.0 · Data.Functor.Reverse(Ord a, Ord b, Ord c) => Ord (a, b, c)Defined in ghc-internal-10.0.0 · GHC.Internal.Classes(Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Except(Ord w, Ord1 m, Ord a) => Ord (WriterT w m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Lazy(Ord w, Ord1 m, Ord a) => Ord (WriterT w m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Strict(Generic1 f, Ord (Rep1 f a)) => Ord (Generically1 f a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (a :~~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityOrd c => Ord (K1 i c p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Ord (f a), Ord (g a)) => Ord (Product f g a)Defined in base-4.23.0.0 · Data.Functor.Product(Ord (f a), Ord (g a)) => Ord (Sum f g a)Defined in base-4.23.0.0 · Data.Functor.Sum(Ord (f p), Ord (g p)) => Ord ((:*:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Ord (f p), Ord (g p)) => Ord ((:+:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)Defined in ghc-internal-10.0.0 · GHC.Internal.ClassesOrd (f (g a)) => Ord (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.ComposeOrd (f (g p)) => Ord ((:.:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (f p) => Ord (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Graph gr, Ord a, Ord b) => Ord (OrdGr gr a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.Graph(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)Defined in ghc-internal-10.0.0 · GHC.Internal.Classes(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f)Defined in ghc-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.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-internal-10.0.0 · GHC.Internal.Classes
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.
Methods
fail :: HasCallStack => String -> m a
Instances36MonadFail, …
MonadFail GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalMonadFail LintMDefined in ghc-10.0.0.20260917 · GHC.Core.LintMonadFail RuleMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.ConstantFoldMonadFail UMDefined in ghc-10.0.0.20260917 · GHC.Core.UnifyMonadFail GhcDefined in ghc-10.0.0.20260917 · GHC.Driver.MonadMonadFail TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.MonadMonadFail TcPluginMDefined in ghc-10.0.0.20260917 · GHC.Tc.TypesMonadFail UniqSMDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SupplyMonadFail MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FailMonadFail QDefined in ghc-internal-10.0.0 · GHC.Internal.TH.MonadMonadFail PDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPMonadFail ReadPDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPMonadFail ReadPrecDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPrecMonadFail IODefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FailMonadFail GHCiQDefined in ghci-10.0.0.20260917 · GHCi.THMonadFail []Defined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FailMonad m => MonadFail (CatchT m)Defined in exceptions-0.10.12 · Control.Monad.Catch.PureMonad m => MonadFail (MaybeT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.MaybeMonadFail (IOEnv m)Defined in ghc-10.0.0.20260917 · GHC.Data.IOEnvMonadFail m => MonadFail (GhcT m)Defined in ghc-10.0.0.20260917 · GHC.Driver.MonadMonadFail f => MonadFail (Ap f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidMonadFail m => MonadFail (ExceptT e m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ExceptMonadFail m => MonadFail (IdentityT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.IdentityMonadFail m => MonadFail (ReaderT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ReaderMonadFail m => MonadFail (SelectT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.SelectMonadFail m => MonadFail (StateT s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.State.LazyMonadFail m => MonadFail (StateT s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.State.StrictMonadFail m => MonadFail (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.CPSMonadFail m => MonadFail (Reverse m)Defined in transformers-0.6.3.0 · Data.Functor.Reverse(Monoid w, MonadFail m) => MonadFail (AccumT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Accum(Monoid w, MonadFail m) => MonadFail (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Lazy(Monoid w, MonadFail m) => MonadFail (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.StrictMonadFail m => MonadFail (ContT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ContMonadFail m => MonadFail (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.CPS(Monoid w, MonadFail m) => MonadFail (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.Lazy(Monoid w, MonadFail m) => MonadFail (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.Strict
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 is the type of values which can be either
a String IntString or an Int. The Left constructor can be used only on
Strings, and the Right constructor can be used only on Ints:
let s = Left "foo" :: Either String IntsLeft "foo"let n = Right 3 :: Either String IntnRight 3:type ss :: Either String Int:type nn :: Either String Int
The fmap from our Functor instance will ignore Left values, but will apply the supplied function to values contained in a Right:
let s = Left "foo" :: Either String Intlet n = Right 3 :: Either String Intfmap (*2) sLeft "foo"fmap (*2) nRight 6
The Monad instance for Either allows us to chain together multiple
actions which may fail, and fail overall if any of the individual
steps failed. First we'll write a function that can either parse an
Int from a Char, or fail.
import Data.Char ( digitToInt, isDigit ):{ let parseEither :: Char -> Either String Int parseEither c | isDigit c = Right (digitToInt c) | otherwise = Left "parse error":}
The following should work, since both '1' and '2' can be
parsed as Ints.
:{ let parseMultiple :: Either String Int parseMultiple = do x <- parseEither '1' y <- parseEither '2' return (x + y):}
parseMultipleRight 3
But the following should fail overall, since the first operation where
we attempt to parse 'm' as an Int will fail:
:{ let parseMultiple :: Either String Int parseMultiple = do x <- parseEither 'm' y <- parseEither '2' return (x + y):}
parseMultipleLeft "parse error"
Instances42Bifoldable, Bifoldable1, Bifunctor, Bitraversable, Eq2, Ord2, …
Bifoldable EitherDefined in base-4.23.0.0 · Data.BifoldableBifoldable1 EitherDefined in base-4.23.0.0 · Data.Bifoldable1Bifunctor EitherDefined in base-4.23.0.0 · Data.BifunctorBitraversable EitherDefined in base-4.23.0.0 · Data.BitraversableEq2 EitherDefined in base-4.23.0.0 · Data.Functor.ClassesOrd2 EitherDefined in base-4.23.0.0 · Data.Functor.ClassesRead2 EitherDefined in base-4.23.0.0 · Data.Functor.ClassesShow2 EitherDefined in base-4.23.0.0 · Data.Functor.ClassesNFData2 EitherDefined in deepseq-1.5.2.0 · Control.DeepSeqGeneric1 (Either a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonadError e (Either e)Defined in mtl-2.3.2 · Control.Monad.Error.Class(Lift a, Lift b) => Lift (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftMonad (Either e)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.EitherFunctor (Either a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.EitherMonadFix (Either e)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FixApplicative (Either e)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.EitherFoldable (Either a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableTraversable (Either a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableEq a => Eq1 (Either a)Defined in base-4.23.0.0 · Data.Functor.ClassesOrd a => Ord1 (Either a)Defined in base-4.23.0.0 · Data.Functor.ClassesRead a => Read1 (Either a)Defined in base-4.23.0.0 · Data.Functor.ClassesShow a => Show1 (Either a)Defined in base-4.23.0.0 · Data.Functor.ClassesNFData a => NFData1 (Either a)Defined in deepseq-1.5.2.0 · Control.DeepSeqe ~ SomeException => MonadCatch (Either e)Defined in exceptions-0.10.12 · Control.Monad.Catche ~ SomeException => MonadMask (Either e)Defined in exceptions-0.10.12 · Control.Monad.Catche ~ SomeException => MonadThrow (Either e)Defined in exceptions-0.10.12 · Control.Monad.Catch(Eq a, Eq b) => Eq (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(Data a, Data b) => Data (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Data(Ord a, Ord b) => Ord (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(Read a, Read b) => Read (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(Show a, Show b) => Show (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.EitherGeneric (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(NFData a, NFData b) => NFData (Either a b)Defined in deepseq-1.5.2.0 · Control.DeepSeq(Pretty a, Pretty b) => Pretty (Either a b)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass(Pretty a, Pretty b) => Pretty (Either a b)Defined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass(Binary a, Binary b) => Binary (Either a b)Defined in binary-0.8.9.3 · Data.Binary.ClassNoAnn a => NoAnn (Either a b)Defined in ghc-10.0.0.20260917 · GHC.Parser.Annotation(Outputable a, Outputable b) => Outputable (Either a b)Defined in ghc-10.0.0.20260917 · GHC.Utils.Outputable(Binary a, Binary b) => Binary (Either a b)Defined in ghc-10.0.0.20260917 · GHC.Utils.Binarytype Rep (Either a b) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Either"
"GHC.Internal.Data.Either"
"ghc-internal"
'False) (C1 ('MetaCons"Left"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons"Right"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 b)))type Rep1 (Either a) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Either"
"GHC.Internal.Data.Either"
"ghc-internal"
'False) (C1 ('MetaCons"Left"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons"Right"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
The Foldable class represents data structures that can be reduced to a summary value one element at a time. Strict left-associative folds are a good fit for space-efficient reduction, while lazy right-associative folds are a good fit for corecursive iteration, or for folds that short-circuit after processing an initial subsequence of the structure's elements.
Instances can be derived automatically by enabling the DeriveFoldable
extension. For example, a derived instance for a binary tree might be:
{-# LANGUAGE DeriveFoldable #-}
data Tree a = Empty
| Leaf a
| Node (Tree a) a (Tree a)
deriving FoldableA more detailed description can be found in the Overview section of
Data.Foldable#overview.
For the class laws see the Laws section of Data.Foldable#laws.
Methods
foldMap :: Monoid m => (a -> m) -> t a -> mMap each element of the structure into a monoid, and combine the results with
(<>). This fold is right-associative and lazy in the accumulator. For strict left-associative folds consider foldMap' instead.Examples
Basic usage:
Example1 expression foldMap Sum [1, 3, 5]Sum {getSum = 9}
Example1 expression foldMap Product [1, 3, 5]Product {getProduct = 15}
Example1 expression foldMap (replicate 3) [1, 2, 3][1,1,1,2,2,2,3,3,3]
When a Monoid's
(<>)is lazy in its second argument, foldMap can return a result even from an unbounded structure. For example, lazy accumulation enables Data.ByteString.Builder to efficiently serialise large data structures and produce the output incrementally:Example5 expressions import qualified Data.ByteString.Lazy as Limport qualified Data.ByteString.Builder as Blet bld :: Int -> B.Builder; bld i = B.intDec i <> B.word8 0x20let lbs = B.toLazyByteString $ foldMap bld [0..]L.take 64 lbs"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"
foldr :: (a -> b -> b) -> b -> t a -> bRight-associative fold of a structure, lazy in the accumulator.
In the case of lists, foldr, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:
foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)Note that since the head of the resulting expression is produced by an application of the operator to the first element of the list, given an operator lazy in its right argument, foldr can produce a terminating expression from an unbounded list.
For a general Foldable structure this should be semantically identical to,
foldr f z = foldr f z . toListExamples
Basic usage:
Example1 expression foldr (||) False [False, True, False]True
Example1 expression foldr (||) False []False
Example1 expression foldr (\c acc -> acc ++ [c]) "foo" ['a', 'b', 'c', 'd']"foodcba"
Infinite structures
⚠️ Applying foldr to infinite structures usually doesn't terminate.
It may still terminate under one of the following conditions:
the folding function is short-circuiting
the folding function is lazy on its second argument
Short-circuiting
(short-circuits on True values, so the following terminates because there is a True value finitely far from the left side:||)Example1 expression foldr (||) False (True : repeat False)True
But the following doesn't terminate:
Example1 expression foldr (||) False (repeat False ++ [True])* Hangs forever *
Laziness in the second argument
Applying foldr to infinite structures terminates when the operator is lazy in its second argument (the initial accumulator is never used in this case, and so could be left
undefined, but[]is more clear):Example1 expression take 5 $ foldr (\i acc -> i : fmap (+3) acc) [] (repeat 1)[1,4,7,10,13]
foldl :: (b -> a -> b) -> b -> t a -> bLeft-associative fold of a structure, lazy in the accumulator. This is rarely what you want, but can work well for structures with efficient right-to-left sequencing and an operator that is lazy in its left argument.
In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:
foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xnNote that to produce the outermost application of the operator the entire input list must be traversed. Like all left-associative folds, foldl will diverge if given an infinite list.
If you want an efficient strict left-fold, you probably want to use foldl' instead of foldl. The reason for this is that the latter does not force the inner results (e.g.
z `f` x1in the above example) before applying them to the operator (e.g. to(`f` x2)). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.For a general Foldable structure this should be semantically identical to:
foldl f z = foldl f z . toListExamples
The first example is a strict fold, which in practice is best performed with foldl'.
Example1 expression foldl (+) 42 [1,2,3,4]52
Though the result below is lazy, the input is reversed before prepending it to the initial accumulator, so corecursion begins only after traversing the entire input string.
Example1 expression foldl (\acc c -> c : acc) "abcd" "efgh""hgfeabcd"
A left fold of a structure that is infinite on the right cannot terminate, even when for any finite input the fold just returns the initial accumulator:
Example1 expression foldl (\a _ -> a) 0 $ repeat 1* Hangs forever *
WARNING: When it comes to lists, you always want to use either foldl' or foldr instead.
foldl' :: (b -> a -> b) -> b -> t a -> bLeft-associative fold of a structure but with strict application of the operator.
This ensures that each step of the fold is forced to Weak Head Normal Form before being applied, avoiding the collection of thunks that would otherwise occur. This is often what you want to strictly reduce a finite structure to a single strict result (e.g. sum).
For a general Foldable structure this should be semantically identical to,
foldl' f z = foldl' f z . toListnull :: t a -> BoolTest whether the structure is empty. The default implementation is Left-associative and lazy in both the initial element and the accumulator. Thus optimised for structures where the first element can be accessed in constant time. Structures where this is not the case should have a non-default implementation.
Examples
Basic usage:
Example1 expression null []True
Example1 expression null [1]False
null is expected to terminate even for infinite structures. The default implementation terminates provided the structure is bounded on the left (there is a leftmost element).
Example1 expression null [1..]False
length :: t a -> IntReturns the size/length of a finite structure as an Int. The default implementation just counts elements starting with the leftmost. Instances for structures that can compute the element count faster than via element-by-element counting, should provide a specialised implementation.
Examples
Basic usage:
Example1 expression length []0
Example2 expressions length ['a', 'b', 'c']3length [1..]* Hangs forever *
elem :: Eq a => a -> t a -> Boolinfix 4Does the element occur in the structure?
Note: elem is often used in infix form.
Examples
Basic usage:
Example1 expression 3 `elem` []False
Example1 expression 3 `elem` [1,2]False
Example1 expression 3 `elem` [1,2,3,4,5]True
For infinite structures, the default implementation of elem terminates if the sought-after value exists at a finite distance from the left side of the structure:
Example1 expression 3 `elem` [1..]True
Example1 expression 3 `elem` ([4..] ++ [3])* Hangs forever *
sum :: Num a => t a -> aThe sum function computes the sum of the numbers of a structure.
Examples
Basic usage:
Example1 expression sum []0
Example1 expression sum [42]42
Example1 expression sum [1..10]55
Example1 expression sum [4.1, 2.0, 1.7]7.8
Example1 expression sum [1..]* Hangs forever *
product :: Num a => t a -> aThe product function computes the product of the numbers of a structure.
Examples
Basic usage:
Example1 expression product []1
Example1 expression product [42]42
Example1 expression product [1..10]3628800
Example1 expression product [4.1, 2.0, 1.7]13.939999999999998
Example1 expression product [1..]* Hangs forever *
Instances110Foldable, …
Foldable ComplexDefined in base-4.23.0.0 · Data.ComplexFoldable FirstDefined in base-4.23.0.0 · Data.SemigroupFoldable LastDefined in base-4.23.0.0 · Data.SemigroupFoldable MaxDefined in base-4.23.0.0 · Data.SemigroupFoldable MinDefined in base-4.23.0.0 · Data.SemigroupFoldable SCCDefined in containers-0.8 · Data.GraphFoldable IntMapDefined in containers-0.8 · Data.IntMap.InternalFolds in order of increasing key.
Foldable DigitDefined in containers-0.8 · Data.Sequence.InternalFoldable ElemDefined in containers-0.8 · Data.Sequence.InternalFoldable FingerTreeDefined in containers-0.8 · Data.Sequence.InternalFoldable NodeDefined in containers-0.8 · Data.Sequence.InternalFoldable SeqDefined in containers-0.8 · Data.Sequence.InternalFoldable ViewLDefined in containers-0.8 · Data.Sequence.InternalFoldable ViewRDefined in containers-0.8 · Data.Sequence.InternalFoldable SetDefined in containers-0.8 · Data.Set.InternalFolds in order of increasing key.
Foldable PostOrderDefined in containers-0.8 · Data.TreeFoldable TreeDefined in containers-0.8 · Data.TreeFolds in pre-order.
Foldable MaybeSDefined in containers-0.8 · Utils.Containers.Internal.StrictMaybeFoldable LabelMapDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelFoldable NormaliseStepResultDefined in ghc-10.0.0.20260917 · GHC.Core.CoercionFoldable BagDefined in ghc-10.0.0.20260917 · GHC.Data.BagFoldable FlatBagDefined in ghc-10.0.0.20260917 · GHC.Data.FlatBagFoldable InfiniteDefined in ghc-10.0.0.20260917 · GHC.Data.List.InfiniteFoldable OrdListDefined in ghc-10.0.0.20260917 · GHC.Data.OrdListFoldable PairDefined in ghc-10.0.0.20260917 · GHC.Data.PairFoldable MaybeDefined in ghc-10.0.0.20260917 · GHC.Data.StrictFoldable Word64MapDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalFolds in order of increasing key.
Foldable ModNodeMapDefined in ghc-10.0.0.20260917 · GHC.Driver.MakeFoldable HieASTDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFoldable HieASTsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFoldable HieArgsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFoldable HieTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFoldable IdentifierDetailsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFoldable NodeInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFoldable SourcedNodeInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesFoldable LinkableWithDefined in ghc-10.0.0.20260917 · GHC.Linker.TypesFoldable PV_ResultDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcessFoldable MessagesDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorFoldable MsgEnvelopeDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorFoldable WithUserRdrDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderFoldable TaggedValDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.DFMFoldable UnitEnvGraphDefined in ghc-10.0.0.20260917 · GHC.Unit.Home.GraphFoldable NodeMapDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphFoldable GenWithIsBootDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesFoldable DataDefnConsDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.DeclsFoldable NonEmptyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable IdentityDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityFoldable FirstDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable LastDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable DownDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable ZipListDefined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListFoldable Par1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable GenClosureDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresFoldable GenStackFieldDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresFoldable GenStackFrameDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresFoldable GenStgStackClosureDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresFoldable MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable TyVarBndrDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxFoldable SoloDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable []Defined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableTrieMap m => Foldable (ListMap m)Defined in ghc-10.0.0.20260917 · GHC.Data.TrieMapTrieMap m => Foldable (MaybeMap m)Defined in ghc-10.0.0.20260917 · GHC.Data.TrieMapFoldable ProxyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable U1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UAddrDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UCharDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UFloatDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UIntDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UWordDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable V1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable (Arg a)Defined in base-4.23.0.0 · Data.SemigroupFoldable (Map k)Defined in containers-0.8 · Data.Map.InternalFolds in order of increasing key.
Foldable (Pair a)Defined in ghc-10.0.0.20260917 · GHC.Data.StrictFoldable (IfaceBindingX r)Defined in ghc-10.0.0.20260917 · GHC.Iface.SyntaxFoldable (PuResult a)Defined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifyFoldable (GenLocated l)Defined in ghc-10.0.0.20260917 · GHC.Types.SrcLocFoldable (HsFieldBind lhs)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.PatFoldable (DbOpenMode mode)Defined in ghc-boot-10.0.0.20260917 · GHC.Unit.DatabaseFoldable (Array i)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable (Either a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable (Tuple2 a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable f => Foldable (Lift f)Defined in transformers-0.6.3.0 · Control.Applicative.LiftFoldable f => Foldable (MaybeT f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.MaybeFoldable m => Foldable (CatchT m)Defined in exceptions-0.10.12 · Control.Monad.Catch.Pure(Eq (Key m), TrieMap m) => Foldable (GenMap m)Defined in ghc-10.0.0.20260917 · GHC.Data.TrieMapFoldable (UniqDFM key)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DFMDeterministic, in O(n log n).
Foldable (NonDetUniqFM key)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.FMInherently nondeterministic. If you use this please provide a justification why it doesn't introduce nondeterminism. See Note [Deterministic UniqFM] in GHC.Types.Unique.DFM to learn about determinism.
Foldable (Const m)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstFoldable (Constant a)Defined in transformers-0.6.3.0 · Data.Functor.ConstantFoldable f => Foldable (Ap f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable f => Foldable (Alt f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableFoldable f => Foldable (Rec1 f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable f => Foldable (Backwards f)Defined in transformers-0.6.3.0 · Control.Applicative.BackwardsDerived instance.
Foldable f => Foldable (ExceptT e f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ExceptFoldable f => Foldable (IdentityT f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.IdentityFoldable f => Foldable (WriterT w f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.LazyFoldable f => Foldable (WriterT w f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.StrictFoldable f => Foldable (Reverse f)Defined in transformers-0.6.3.0 · Data.Functor.ReverseFold from right to left.
Foldable (K1 i c)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Foldable f, Foldable g) => Foldable (Product f g)Defined in base-4.23.0.0 · Data.Functor.Product(Foldable f, Foldable g) => Foldable (Sum f g)Defined in base-4.23.0.0 · Data.Functor.Sum(Foldable f, Foldable g) => Foldable (f :*: g)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Foldable f, Foldable g) => Foldable (f :+: g)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable f => Foldable (M1 i c f)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Foldable f, Foldable g) => Foldable (Compose f g)Defined in base-4.23.0.0 · Data.Functor.Compose(Foldable f, Foldable g) => Foldable (f :.: g)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics
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.
Methods
traverse :: Applicative f => (a -> f b) -> t a -> f (t b)Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see traverse_.
Examples
Basic usage:
In the first two examples we show each evaluated action mapping to the output structure.
Example1 expression traverse Just [1,2,3,4]Just [1,2,3,4]
Example1 expression traverse id [Right 1, Right 2, Right 3, Right 4]Right [1,2,3,4]
In the next examples, we show that Nothing and Left values short circuit the created structure.
Example1 expression traverse (const Nothing) [1,2,3,4]Nothing
Example1 expression traverse (\x -> if odd x then Just x else Nothing) [1,2,3,4]Nothing
Example1 expression traverse id [Right 1, Right 2, Right 3, Right 4, Left 0]Left 0
sequenceA :: Applicative f => t (f a) -> f (t a)Evaluate each action in the structure from left to right, and collect the results. For a version that ignores the results see sequenceA_.
Examples
Basic usage:
For the first two examples we show sequenceA fully evaluating a a structure and collecting the results.
Example1 expression sequenceA [Just 1, Just 2, Just 3]Just [1,2,3]
Example1 expression sequenceA [Right 1, Right 2, Right 3]Right [1,2,3]
The next two example show Nothing and Just will short circuit the resulting structure if present in the input. For more context, check the Traversable instances for Either and Maybe.
Example1 expression sequenceA [Just 1, Just 2, Just 3, Nothing]Nothing
Example1 expression sequenceA [Right 1, Right 2, Right 3, Left 4]Left 4
mapM :: Monad m => (a -> m b) -> t a -> m (t b)Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see
Data.Foldable.mapM_.Examples
mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.
sequence :: Monad m => t (m a) -> m (t a)Evaluate each monadic action in the structure from left to right, and collect the results. For a version that ignores the results see
Data.Foldable.sequence_.Examples
Basic usage:
The first two examples are instances where the input and and output of sequence are isomorphic.
Example1 expression sequence $ Right [1,2,3,4][Right 1,Right 2,Right 3,Right 4]
Example1 expression sequence $ [Right 1,Right 2,Right 3,Right 4]Right [1,2,3,4]
The following examples demonstrate short circuit behavior for sequence.
Example1 expression sequence $ Left [1,2,3,4]Left [1,2,3,4]
Example1 expression sequence $ [Left 0, Right 1,Right 2,Right 3,Right 4]Left 0
Instances105Traversable, …
Traversable ComplexDefined in base-4.23.0.0 · Data.ComplexTraversable FirstDefined in base-4.23.0.0 · Data.SemigroupTraversable LastDefined in base-4.23.0.0 · Data.SemigroupTraversable MaxDefined in base-4.23.0.0 · Data.SemigroupTraversable MinDefined in base-4.23.0.0 · Data.SemigroupTraversable SCCDefined in containers-0.8 · Data.GraphTraversable IntMapDefined in containers-0.8 · Data.IntMap.InternalTraverses in order of increasing key.
Traversable DigitDefined in containers-0.8 · Data.Sequence.InternalTraversable ElemDefined in containers-0.8 · Data.Sequence.InternalTraversable FingerTreeDefined in containers-0.8 · Data.Sequence.InternalTraversable NodeDefined in containers-0.8 · Data.Sequence.InternalTraversable SeqDefined in containers-0.8 · Data.Sequence.InternalTraversable ViewLDefined in containers-0.8 · Data.Sequence.InternalTraversable ViewRDefined in containers-0.8 · Data.Sequence.InternalTraversable PostOrderDefined in containers-0.8 · Data.TreeTraversable TreeDefined in containers-0.8 · Data.TreeTraverses in pre-order.
Traversable LabelMapDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelTraversable NormaliseStepResultDefined in ghc-10.0.0.20260917 · GHC.Core.CoercionTraversable BagDefined in ghc-10.0.0.20260917 · GHC.Data.BagTraversable FlatBagDefined in ghc-10.0.0.20260917 · GHC.Data.FlatBagTraversable InfiniteDefined in ghc-10.0.0.20260917 · GHC.Data.List.InfiniteTraversable OrdListDefined in ghc-10.0.0.20260917 · GHC.Data.OrdListTraversable PairDefined in ghc-10.0.0.20260917 · GHC.Data.PairTraversable MaybeDefined in ghc-10.0.0.20260917 · GHC.Data.StrictTraversable Word64MapDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalTraverses in order of increasing key.
Traversable ModNodeMapDefined in ghc-10.0.0.20260917 · GHC.Driver.MakeTraversable HieASTDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesTraversable HieASTsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesTraversable HieArgsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesTraversable HieTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesTraversable IdentifierDetailsDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesTraversable NodeInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesTraversable SourcedNodeInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesTraversable LinkableWithDefined in ghc-10.0.0.20260917 · GHC.Linker.TypesTraversable PV_ResultDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcessTraversable MessagesDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorTraversable MsgEnvelopeDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorTraversable WithUserRdrDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderTraversable TaggedValDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.DFMTraversable UnitEnvGraphDefined in ghc-10.0.0.20260917 · GHC.Unit.Home.GraphTraversable NodeMapDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.GraphTraversable GenWithIsBootDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesTraversable DataDefnConsDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.DeclsTraversable NonEmptyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable IdentityDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable FirstDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable LastDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable DownDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable ZipListDefined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListTraversable Par1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable GenClosureDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresTraversable GenStackFieldDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresTraversable GenStackFrameDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresTraversable GenStgStackClosureDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresTraversable MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable TyVarBndrDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxTraversable SoloDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable []Defined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable ProxyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable U1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UAddrDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UCharDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UFloatDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UIntDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UWordDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable V1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable (Arg a)Defined in base-4.23.0.0 · Data.SemigroupTraversable (Map k)Defined in containers-0.8 · Data.Map.InternalTraverses in order of increasing key.
Traversable (Pair a)Defined in ghc-10.0.0.20260917 · GHC.Data.StrictTraversable (IfaceBindingX r)Defined in ghc-10.0.0.20260917 · GHC.Iface.SyntaxTraversable (PuResult a)Defined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifyTraversable (GenLocated l)Defined in ghc-10.0.0.20260917 · GHC.Types.SrcLocTraversable (HsFieldBind lhs)Defined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.PatTraversable (DbOpenMode mode)Defined in ghc-boot-10.0.0.20260917 · GHC.Unit.DatabaseTraversable (Either a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable (Tuple2 a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable f => Traversable (Lift f)Defined in transformers-0.6.3.0 · Control.Applicative.LiftTraversable f => Traversable (MaybeT f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.MaybeIx i => Traversable (Array i)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Traversable(Monad m, Traversable m) => Traversable (CatchT m)Defined in exceptions-0.10.12 · Control.Monad.Catch.PureTraversable (UniqDFM key)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DFMDeterministic, in O(n log n).
Traversable (NonDetUniqFM key)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.FMInherently nondeterministic. If you use this please provide a justification why it doesn't introduce nondeterminism. See Note [Deterministic UniqFM] in GHC.Types.Unique.DFM to learn about determinism.
Traversable (Const m)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable (Constant a)Defined in transformers-0.6.3.0 · Data.Functor.ConstantTraversable f => Traversable (Ap f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable f => Traversable (Alt f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableTraversable f => Traversable (Rec1 f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable f => Traversable (Backwards f)Defined in transformers-0.6.3.0 · Control.Applicative.BackwardsDerived instance.
Traversable f => Traversable (ExceptT e f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ExceptTraversable f => Traversable (IdentityT f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.IdentityTraversable f => Traversable (WriterT w f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.LazyTraversable f => Traversable (WriterT w f)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.StrictTraversable f => Traversable (Reverse f)Defined in transformers-0.6.3.0 · Data.Functor.ReverseTraverse from right to left.
Traversable (K1 i c)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Traversable f, Traversable g) => Traversable (Product f g)Defined in base-4.23.0.0 · Data.Functor.Product(Traversable f, Traversable g) => Traversable (Sum f g)Defined in base-4.23.0.0 · Data.Functor.Sum(Traversable f, Traversable g) => Traversable (f :*: g)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Traversable f, Traversable g) => Traversable (f :+: g)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable f => Traversable (M1 i c f)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Traversable f, Traversable g) => Traversable (Compose f g)Defined in base-4.23.0.0 · Data.Functor.Compose(Traversable f, Traversable g) => Traversable (f :.: g)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics
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.
Instances127Bounded, …
Bounded FileTypeDefined in directory-1.3.11.0 · System.Directory.Internal.CommonBounded XdgDirectoryDefined in directory-1.3.11.0 · System.Directory.Internal.CommonBounded XdgDirectoryListDefined in directory-1.3.11.0 · System.Directory.Internal.CommonBounded TypeOrderingDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareBounded OverridingBoolDefined in ghc-10.0.0.20260917 · GHC.Data.BoolBounded LanguageDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsBounded WarningFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsBounded WarningGroupDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsBounded CompressionIFaceDefined in ghc-10.0.0.20260917 · GHC.Iface.BinaryBounded StgRetDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsBounded ClosureTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesBounded JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesBounded ThreadStatusDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesBounded ImportLevelDefined in ghc-10.0.0.20260917 · GHC.Types.BasicBounded UniqueTagDefined in ghc-10.0.0.20260917 · GHC.Types.UniqueBounded ModuleStageDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.StageBounded ByteOrderDefined in ghc-internal-10.0.0 · GHC.Internal.ByteOrderBounded AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalBounded AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalBounded CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBounded IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrBounded WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrBounded AssociativityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsBounded DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsBounded SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsBounded SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsBounded Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntBounded Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntBounded Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntBounded Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntBounded ExtensionDefined in ghc-internal-10.0.0 · GHC.Internal.LanguageExtensionsBounded CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBounded BoolDefined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded CharDefined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded IntDefined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded LevityDefined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded VecCountDefined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded VecElemDefined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded WordDefined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded GeneralCategoryDefined in ghc-internal-10.0.0 · GHC.Internal.UnicodeBounded Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordBounded Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordBounded Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordBounded Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordBounded I8Defined in text-2.1.4 · Data.Text.ForeignBounded FPFormatDefined in text-2.1.4 · Data.Text.Lazy.Builder.RealFloatBounded QuarterOfYearDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterBounded ()Defined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded a => Bounded (First a)Defined in base-4.23.0.0 · Data.SemigroupBounded a => Bounded (Last a)Defined in base-4.23.0.0 · Data.SemigroupBounded a => Bounded (Max a)Defined in base-4.23.0.0 · Data.SemigroupBounded a => Bounded (Min a)Defined in base-4.23.0.0 · Data.SemigroupBounded a => Bounded (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBounded a => Bounded (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBounded a => Bounded (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBounded a => Bounded (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBounded a => Bounded (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityBounded a => Bounded (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdBounded a => Bounded (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalBounded a => Bounded (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalBounded a => Bounded (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalBounded a => Bounded (a)Defined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded m => Bounded (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupBounded (Bin a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryBounded (RelBin a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryBounded (RelBinPtr a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryBounded (Proxy t)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Proxy(Bounded a, Bounded b) => Bounded (a, b)Defined in ghc-internal-10.0.0 · GHC.Internal.EnumBounded a => Bounded (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstCoercible a b => Bounded (Coercion a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.Coercion(Applicative f, Bounded a) => Bounded (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Monoid(Bounded a, Bounded b, Bounded c) => Bounded (a, b, c)Defined in ghc-internal-10.0.0 · GHC.Internal.Enuma ~ b => Bounded (a :~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.Equality(Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d)Defined in ghc-internal-10.0.0 · GHC.Internal.Enuma ~~ b => Bounded (a :~~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityBounded (f (g a)) => Bounded (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.Compose(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => Bounded (a, b, c, d, e, f, g)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => Bounded (a, b, c, d, e, f, g, h)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => Bounded (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => Bounded (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => Bounded (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-10.0.0 · GHC.Internal.Enum
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:
The calls
succ maxBoundandpred minBoundshould result in a runtime error.fromEnum and toEnum should give a runtime error if the result value is not representable in the result type. For example,
toEnum 7 :: Boolis an error.enumFrom and enumFromThen should be defined with an implicit bound, thus:
enumFrom x = enumFromTo x maxBound
enumFromThen x y = enumFromThenTo x y bound
where
bound | fromEnum y >= fromEnum x = maxBound
| otherwise = minBoundMethods
succ :: a -> aSuccessor of a value. For numeric types, succ adds 1.
pred :: a -> aPredecessor of a value. For numeric types, pred subtracts 1.
toEnum :: Int -> aConvert from an Int.
fromEnum :: a -> IntenumFrom :: a -> [a]Used in Haskell's translation of
[n..]with[n..] = enumFrom n, a possible implementation beingenumFrom n = n : enumFrom (succ n).Examples
enumFrom 4 :: [Integer] = [4,5,6,7,...]enumFrom 6 :: [Int] = [6,7,8,9,...,maxBound :: Int]
enumFromThen :: a -> a -> [a]Used in Haskell's translation of
[n,n'..]with[n,n'..] = enumFromThen n n', a possible implementation beingenumFromThen n n' = n : n' : worker (f x) (f x n'),worker s v = v : worker s (s v),x = fromEnum n' - fromEnum nandf n y | n > 0 = f (n - 1) (succ y) | n < 0 = f (n + 1) (pred y) | otherwise = yExamples
enumFromThen 4 6 :: [Integer] = [4,6,8,10...]enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: Int]
enumFromTo :: a -> a -> [a]Used in Haskell's translation of
[n..m]with[n..m] = enumFromTo n m, a possible implementation beingenumFromTo n m | n <= m = n : enumFromTo (succ n) m | otherwise = []Examples
enumFromTo 6 10 :: [Int] = [6,7,8,9,10]enumFromTo 42 1 :: [Integer] = []
enumFromThenTo :: a -> a -> a -> [a]Used in Haskell's translation of
[n,n'..m]with[n,n'..m] = enumFromThenTo n n' m, a possible implementation beingenumFromThenTo n n' m = worker (f x) (c x) n m,x = fromEnum n' - fromEnum n,c x = bool (>=) ((x 0)f n y | n > 0 = f (n - 1) (succ y) | n < 0 = f (n + 1) (pred y) | otherwise = yand
worker s c v m | c v m = v : worker s c (s v) m | otherwise = []Examples
enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6]enumFromThenTo 6 8 2 :: [Int] = []
Instances178Enum, …
Enum IoManagerFlagDefined in base-4.23.0.0 · GHC.RTS.FlagsEnum FileTypeDefined in directory-1.3.11.0 · System.Directory.Internal.CommonEnum XdgDirectoryDefined in directory-1.3.11.0 · System.Directory.Internal.CommonEnum XdgDirectoryListDefined in directory-1.3.11.0 · System.Directory.Internal.CommonEnum ByteOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEnum HalfWordDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEnum RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEnum WordOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesEnum EdgeWeightDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGEnum DwarfAbbrevDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Dwarf.TypesEnum RegClassDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseEnum RegSubDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseEnum TypeOrderingDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareEnum PrimElemRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConEnum OverridingBoolDefined in ghc-10.0.0.20260917 · GHC.Data.BoolEnum DumpFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEnum GeneralFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEnum LanguageDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEnum WarningFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEnum WarningGroupDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsEnum CompressionIFaceDefined in ghc-10.0.0.20260917 · GHC.Iface.BinaryEnum BindTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEnum DeclTypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEnum EntityInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEnum IETypeDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEnum NodeOriginDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEnum RecFieldContextDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesEnum AOpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEnum OpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEnum UOpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxEnum AOpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEnum OpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEnum UOpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxEnum MetaIdDefined in ghc-10.0.0.20260917 · GHC.Llvm.MetaDataEnum ExtBitsDefined in ghc-10.0.0.20260917 · GHC.Parser.LexerEnum StgRetDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsEnum ClosureTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEnum IdTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEnum JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEnum JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEnum ThreadStatusDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesEnum ImportLevelDefined in ghc-10.0.0.20260917 · GHC.Types.BasicEnum IndexedCCFlavourDefined in ghc-10.0.0.20260917 · GHC.Types.CostCentreEnum LitNumTypeDefined in ghc-10.0.0.20260917 · GHC.Types.LiteralEnum ProfAutoDefined in ghc-10.0.0.20260917 · GHC.Types.ProfAutoEnum UniqueTagDefined in ghc-10.0.0.20260917 · GHC.Types.UniqueEnum ModuleStageDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.StageEnum CCallConvDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignEnum ForeignKindDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignEnum SafetyDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignEnum IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum ByteOrderDefined in ghc-internal-10.0.0 · GHC.Internal.ByteOrderEnum ClosureTypeDefined in ghc-internal-10.0.0 · GHC.Internal.ClosureTypesEnum CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CClockDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CSUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CTimeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesEnum IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrEnum WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrEnum AssociativityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEnum DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEnum SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEnum SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsEnum HalfWordDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesEnum SeekModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.DeviceEnum IOModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.IOModeEnum IoSubSystemDefined in ghc-internal-10.0.0 · GHC.Internal.IO.SubSystemEnum Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntEnum Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntEnum Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntEnum Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntEnum ExtensionDefined in ghc-internal-10.0.0 · GHC.Internal.LanguageExtensionsEnum DoCostCentresDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsEnum DoHeapProfileDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsEnum DoTraceDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsEnum GiveGCStatsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsEnum IoManagerFlagDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsEnum ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsEnum WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsEnum ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfEnum WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfEnum CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CCcDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CSpeedDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesEnum BoolDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum CharDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanfromEnum just truncates its argument, beware of all sorts of overflows.
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Example1 expression [0..1.5][0.0,1.0,2.0]
Enum FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanfromEnum just truncates its argument, beware of all sorts of overflows.
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Example1 expression [0..1.5 :: Float][0.0,1.0,2.0]
Enum IntDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum LevityDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum VecCountDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum VecElemDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum WordDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum GeneralCategoryDefined in ghc-internal-10.0.0 · GHC.Internal.UnicodeEnum Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordEnum Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordEnum Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordEnum Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordEnum THResultTypeDefined in ghci-10.0.0.20260917 · GHCi.MessageEnum I8Defined in text-2.1.4 · Data.Text.ForeignEnum FPFormatDefined in text-2.1.4 · Data.Text.Lazy.Builder.RealFloatEnum DayDefined in time-1.16.0.1 · Data.Time.Calendar.DaysEnum MonthDefined in time-1.16.0.1 · Data.Time.Calendar.MonthEnum QuarterDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterEnum QuarterOfYearDefined in time-1.16.0.1 · Data.Time.Calendar.Quartermaps Q1..Q4 to 1..4
Enum DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekEnum DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeEnum NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeEnum StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonEnum StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonEnum BaudRateDefined in unix-2.8.8.0 · System.Posix.Terminal.CommonEnum ()Defined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum a => Enum (First a)Defined in base-4.23.0.0 · Data.SemigroupEnum a => Enum (Last a)Defined in base-4.23.0.0 · Data.SemigroupEnum a => Enum (Max a)Defined in base-4.23.0.0 · Data.SemigroupEnum a => Enum (Min a)Defined in base-4.23.0.0 · Data.SemigroupEnum a => Enum (WrappedMonoid a)Defined in base-4.23.0.0 · Data.SemigroupEnum a => Enum (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsEnum a => Enum (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsEnum a => Enum (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsEnum a => Enum (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsEnum a => Enum (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityEnum a => Enum (a)Defined in ghc-internal-10.0.0 · GHC.Internal.EnumIntegral a => Enum (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.Real(Enum a, Bounded a, Eq a) => Enum (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdEnum (Fixed a)Defined in base-4.23.0.0 · Data.FixedRecall that, for numeric types, succ and pred typically add and subtract
1, respectively. This is not true in the case of Fixed, whose successor and predecessor functions intuitively return the "next" and "previous" values in the enumeration. The results of these functions thus depend on the resolution of the Fixed value. For example, when enumerating values of resolution10^-3oftype 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^-12is the smallest (positive) amount that can be added to a value oftype Pico = Fixed E12without changing its resolution, and soExample1 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" of10^-12. Hence, the list[1..10] :: [Pico]has the form[1.000000000000, 1.00000000001, 1.00000000002, ..., 10.000000000000]and contains
9 * 10^12 + 1values.Enum (Proxy s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyEnum (f a) => Enum (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidEnum (f a) => Enum (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEnum a => Enum (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstCoercible a b => Enum (Coercion a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.Coerciona ~ b => Enum (a :~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.Equalitya ~~ b => Enum (a :~~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityEnum (f (g a)) => Enum (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.Compose
Instances10Floating, …
Floating CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFloating CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFloating DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.FloatFloating FloatDefined in ghc-internal-10.0.0 · GHC.Internal.FloatFloating a => Floating (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityFloating a => Floating (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdRealFloat a => Floating (Complex a)Defined in base-4.23.0.0 · Data.ComplexFloating a => Floating (Op a b)Defined in base-4.23.0.0 · Data.Functor.ContravariantFloating a => Floating (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstFloating (f (g a)) => Floating (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.Compose
Efficient, machine-independent access to the components of a floating-point number.
Methods
floatRadix :: a -> Integera constant function, returning the radix of the representation (often
2)floatDigits :: a -> Inta constant function, returning the number of digits of floatRadix in the significand
floatRange :: a -> (Int, Int)A constant function, returning the lowest and highest values that
exponent xmay assume for a normalx. The relation to IEEEeminandemaxisfloatRange x = (emin + 1, emax + 1).decodeFloat :: a -> (Integer, Int)The function decodeFloat applied to a real floating-point number returns the significand expressed as an Integer and an appropriately scaled exponent (an Int). If
decodeFloat xyields(m,n), thenxis equal in value tom*b^^n, wherebis the floating-point radix, and furthermore, eithermandnare both zero or elseb^(d-1) <= abs m < b^d, wheredis the value offloatDigits x. In particular,decodeFloat 0 = (0,0). If the type contains a negative zero, alsodecodeFloat (-0.0) = (0,0). The result ofdecodeFloat xis unspecified if either ofisNaN xorisInfinite xis True.encodeFloat :: Integer -> Int -> aencodeFloat performs the inverse of decodeFloat in the sense that for finite
xwith the exception of-0.0,.Prelude.uncurryencodeFloat (decodeFloat x) = xencodeFloat m nis one of the two closest representable floating-point numbers tom*b^^n(or±Infinityif overflow occurs); usually the closer, but ifmcontains too many bits, the result may be rounded in the wrong direction.exponent :: a -> Intexponent corresponds to the second component of decodeFloat.
exponent 0 = 0and for finite nonzerox,exponent x = snd (decodeFloat x) + floatDigits x. Ifxis a finite floating-point number, it is equal in value tosignificand x * b ^^ exponent x, wherebis the floating-point radix. The behaviour is unspecified on infinite orNaNvalues.significand :: a -> aThe first component of decodeFloat, scaled to lie in the open interval (
-1,1), either0.0or of absolute value>= 1/b, wherebis the floating-point radix. The behaviour is unspecified on infinite orNaNvalues.scaleFloat :: Int -> a -> amultiplies a floating-point number by an integer power of the radix
isNaN :: a -> BoolTrue if the argument is an IEEE "not-a-number" (NaN) value
isInfinite :: a -> BoolTrue if the argument is an IEEE infinity or negative infinity
isDenormalized :: a -> BoolTrue if the argument is too small to be represented in normalized format
isNegativeZero :: a -> BoolTrue if the argument is an IEEE negative zero
isIEEE :: a -> BoolTrue if the argument is an IEEE floating point number
atan2 :: a -> a -> aa version of arctangent taking two real floating-point arguments. For real floating
xandy,atan2 y xcomputes the angle (from the positive x-axis) of the vector from the origin to the point(x,y).atan2 y xreturns a value in the range [-pi,pi]. It follows the Common Lisp semantics for the origin when signed zeroes are supported.atan2 y 1, withyin a type that is RealFloat, should return the same value asatan y. A default definition of atan2 is provided, but implementors can provide a more accurate implementation.
Instances8RealFloat, …
RealFloat CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRealFloat CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRealFloat DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.FloatRealFloat FloatDefined in ghc-internal-10.0.0 · GHC.Internal.FloatRealFloat a => RealFloat (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityRealFloat a => RealFloat (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdRealFloat a => RealFloat (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstRealFloat (f (g a)) => RealFloat (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.Compose
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.
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 + xfromInteger 0is the additive identityx + fromInteger 0=
x- negate gives the additive inverse
x + negate x=
fromInteger 0- Associativity of
(*) (x * y) * z=
x * (y * z)fromInteger 1is the multiplicative identityx * fromInteger 1=
xand
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
is a left inverse for
, i.e.
fromInteger (toInteger i) == i
Note that it isn't customarily expected that a type instance of both Num
and Ord implement an ordered ring. Indeed, in base only Integer and
Data.Ratio.Rational do.
Methods
(+) :: a -> a -> ainfixl 6(-) :: a -> a -> ainfixl 6(*) :: a -> a -> ainfixl 7negate :: a -> aUnary negation.
abs :: a -> aAbsolute value.
signum :: a -> afromInteger :: Integer -> aConversion from an Integer. An integer literal represents the application of the function fromInteger to the appropriate value of type Integer, so such literals have type
(Num a) => a.
Instances105Num, …
Num ByteOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesNum HalfWordDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesNum RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesNum WordOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesNum EdgeWeightDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGNum TimeDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.DirectedNum JStgExprDefined in ghc-10.0.0.20260917 · GHC.JS.Make · orphanNum IntWithInfDefined in ghc-10.0.0.20260917 · GHC.Types.BasicNum SaneDoubleDefined in ghc-10.0.0.20260917 · GHC.Types.SaneDoubleNum IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.NumNum NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.NumNum EventTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollNum EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.PollNum UniqueDefined in ghc-internal-10.0.0 · GHC.Internal.Event.UniqueNum CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CClockDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CSUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CTimeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesNum IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrNum WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrNum HalfWordDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesNum Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntNum Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntNum Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntNum Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntNum ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsNum WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsNum ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfNum WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfNum CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CCcDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CSpeedDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesNum DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
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-10.0.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
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-10.0.0 · GHC.Internal.NumNum WordDefined in ghc-internal-10.0.0 · GHC.Internal.NumNum Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordNum Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordNum Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordNum Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordNum HashDefined in hpc-0.7.0.2 · Trace.Hpc.UtilNum I8Defined in text-2.1.4 · Data.Text.ForeignNum SizeDefined in text-2.1.4 · Data.Text.Internal.Fusion.SizeNum DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeNum NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeNum CAttributesDefined in unix-2.8.8.0 · System.Posix.Files.CommonNum StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonNum StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonNum BaudRateDefined in unix-2.8.8.0 · System.Posix.Terminal.CommonRealFloat a => Num (Complex a)Defined in base-4.23.0.0 · Data.ComplexNum a => Num (Max a)Defined in base-4.23.0.0 · Data.SemigroupNum a => Num (Min a)Defined in base-4.23.0.0 · Data.SemigroupNum a => Num (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityNum a => Num (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdNum a => Num (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNum a => Num (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalIntegral a => Num (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealHasResolution a => Num (Fixed a)Defined in base-4.23.0.0 · Data.FixedMultiplication 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.23.0.0 · Data.Functor.ContravariantNum (f a) => Num (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNum a => Num (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.Const(Applicative f, Num a) => Num (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidNote that even if the underlying Num and Applicative instances are lawful, for most Applicatives, this instance will not be lawful. If you use this instance with the list Applicative, the following customary laws will not hold:
Commutativity:
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.23.0.0 · Data.Functor.Compose
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 athe derived instance of Read in Haskell 2010 is equivalent to
instance (Read a) => Read (Tree a) where
readsPrec d r = readParen (d > app_prec)
(\r -> [(Leaf m,t) |
("Leaf",s) <- lex r,
(m,t) <- readsPrec (app_prec+1) s]) r
++ readParen (d > up_prec)
(\r -> [(u:^:v,w) |
(u,s) <- readsPrec (up_prec+1) r,
(":^:",t) <- lex s,
(v,w) <- readsPrec (up_prec+1) t]) r
where app_prec = 10
up_prec = 5Note that right-associativity of :^: is unused.
The derived instance in GHC is equivalent to
instance (Read a) => Read (Tree a) where
readPrec = parens $ (prec app_prec $ do
Ident "Leaf" <- lexP
m <- step readPrec
return (Leaf m))
+++ (prec up_prec $ do
u <- step readPrec
Symbol ":^:" <- lexP
v <- step readPrec
return (u :^: v))
where app_prec = 10
up_prec = 5
readListPrec = readListPrecDefaultWhy do both readsPrec and readPrec exist, and why does GHC opt to implement readPrec in derived Read instances instead of readsPrec? The reason is that readsPrec is based on the ReadS type, and although ReadS is mentioned in the Haskell 2010 Report, it is not a very efficient parser data structure.
readPrec, on the other hand, is based on a much more efficient ReadPrec
datatype (a.k.a "new-style parsers"), but its definition relies on the use
of the RankNTypes language extension. Therefore, readPrec (and its
cousin, readListPrec) are marked as GHC-only. Nevertheless, it is
recommended to use readPrec instead of readsPrec whenever possible
for the efficiency improvements it brings.
As mentioned above, derived Read instances in GHC will implement readPrec instead of readsPrec. The default implementations of readsPrec (and its cousin, readList) will simply use readPrec under the hood. If you are writing a Read instance by hand, it is recommended to write it like so:
instance Read T where
readPrec = ...
readListPrec = readListPrecDefault
Methods
readsPrec :: Int -> ReadS aattempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty.
Derived instances of Read and
Text.Show.Showsatisfy the following:That is, readsPrec parses the string produced by showsPrec, and delivers the value that showsPrec started with.
readList :: ReadS [a]
Instances253Read, …
Read GCDetailsDefined in base-4.23.0.0 · GHC.StatsRead RTSStatsDefined in base-4.23.0.0 · GHC.StatsRead ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeRead ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalRead ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalRead IntSetDefined in containers-0.8 · Data.IntSet.InternalRead FileTypeDefined in directory-1.3.11.0 · System.Directory.Internal.CommonRead PermissionsDefined in directory-1.3.11.0 · System.Directory.Internal.CommonRead XdgDirectoryDefined in directory-1.3.11.0 · System.Directory.Internal.CommonRead XdgDirectoryListDefined in directory-1.3.11.0 · System.Directory.Internal.CommonRead OverridingBoolDefined in ghc-10.0.0.20260917 · GHC.Data.BoolRead Word64SetDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Set.InternalRead PlatformDefined in ghc-10.0.0.20260917 · GHC.PlatformRead PlatformWordSizeDefined in ghc-10.0.0.20260917 · GHC.PlatformRead PlatformConstantsDefined in ghc-10.0.0.20260917 · GHC.Platform.ConstantsRead ProfileDefined in ghc-10.0.0.20260917 · GHC.Platform.ProfileRead WayDefined in ghc-10.0.0.20260917 · GHC.Platform.WaysRead StgLiftConfigDefined in ghc-10.0.0.20260917 · GHC.Stg.Lift.ConfigRead StgToDoDefined in ghc-10.0.0.20260917 · GHC.Stg.PipelineRead VoidDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead ByteOrderDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead VersionDefined in ghc-internal-10.0.0 · GHC.Internal.Data.VersionRead CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CClockDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CSUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CTimeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRead IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrRead WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrRead AssociativityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead FixityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead SeekModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.DeviceRead ExitCodeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionRead BufferModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesRead NewlineDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesRead NewlineModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesRead IOModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.IOModeRead Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntRead Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntRead Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntRead Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntRead GCDetailsDefined in ghc-internal-10.0.0 · GHC.Internal.StatsRead RTSStatsDefined in ghc-internal-10.0.0 · GHC.Internal.StatsRead CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CCcDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CSpeedDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesRead LexemeDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead SomeCharDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsRead SomeSymbolDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsRead SomeNatDefined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsRead BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead CharDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead FloatDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead IntDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead WordDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead GeneralCategoryDefined in ghc-internal-10.0.0 · GHC.Internal.ReadRead Word16Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead Word32Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead Word64Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead Word8Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead ArchDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSRead ArchOSDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSRead ArmABIDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSRead ArmISADefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSRead ArmISAExtDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSRead OSDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSRead PPC_64ABIDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSRead LibraryDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.LibraryRead ProgramDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.ProgramRead TargetDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.TargetRead WordSizeDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.TargetRead ArDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.ArRead CcDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CcRead CmmCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppRead CppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppRead HsCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppRead JsCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppRead CxxDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CxxRead CcLinkDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.LinkRead MergeObjsDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.MergeObjsRead NmDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.NmRead RanlibDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.RanlibRead ReadelfDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.ReadelfRead BoxLabelDefined in hpc-0.7.0.2 · Trace.Hpc.MixRead CondBoxDefined in hpc-0.7.0.2 · Trace.Hpc.MixRead MixDefined in hpc-0.7.0.2 · Trace.Hpc.MixRead TixDefined in hpc-0.7.0.2 · Trace.Hpc.TixRead TixModuleDefined in hpc-0.7.0.2 · Trace.Hpc.TixRead HashDefined in hpc-0.7.0.2 · Trace.Hpc.UtilRead HpcPosDefined in hpc-0.7.0.2 · Trace.Hpc.UtilRead CommunicationHandleDefined in process-1.6.30.0 · System.Process.CommunicationHandle.InternalRead I8Defined in text-2.1.4 · Data.Text.ForeignRead TextDefined in text-2.1.4 · Data.Text · orphanRead TextDefined in text-2.1.4 · Data.Text.Lazy · orphanRead FPFormatDefined in text-2.1.4 · Data.Text.Lazy.Builder.RealFloatRead CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.ISO8601 · orphanRead DayDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanRead MonthDefined in time-1.16.0.1 · Data.Time.Calendar.MonthRead as
yyyy-mm.Read QuarterDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterRead as
yyyy-Qn.Read QuarterOfYearDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterRead DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekRead DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeRead NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeRead UTCTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanRead UniversalTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanRead CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.ISO8601 · orphanRead LocalTimeDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanRead TimeOfDayDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanRead TimeZoneDefined in time-1.16.0.1 · Data.Time.Format.Parse · orphanThis only works for
±HHMMformat, 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.16.0.1 · Data.Time.Format.Parse · orphanThis only works for a zonedTimeZone in
±HHMMformat, 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.8.0 · System.Posix.DynamicLinker.PrimRead CAttributesDefined in unix-2.8.8.0 · System.Posix.Files.CommonRead StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonRead StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonRead OpenFileFlagsDefined in unix-2.8.8.0 · System.Posix.IO.CommonRead OpenModeDefined in unix-2.8.8.0 · System.Posix.IO.CommonRead GroupEntryDefined in unix-2.8.8.0 · System.Posix.User.CommonRead UserEntryDefined in unix-2.8.8.0 · System.Posix.User.CommonRead ()Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead a => Read (Complex a)Defined in base-4.23.0.0 · Data.ComplexRead a => Read (First a)Defined in base-4.23.0.0 · Data.SemigroupRead a => Read (Last a)Defined in base-4.23.0.0 · Data.SemigroupRead a => Read (Max a)Defined in base-4.23.0.0 · Data.SemigroupRead a => Read (Min a)Defined in base-4.23.0.0 · Data.SemigroupRead a => Read (Seq a)Defined in containers-0.8 · Data.Sequence.InternalRead a => Read (ViewL a)Defined in containers-0.8 · Data.Sequence.InternalRead a => Read (ViewR a)Defined in containers-0.8 · Data.Sequence.InternalRead a => Read (PostOrder a)Defined in containers-0.8 · Data.TreeRead a => Read (Tree a)Defined in containers-0.8 · Data.TreeRead a => Read (FromListCounting a)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.PatriciaTreeRead a => Read (NonEmpty a)Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead a => Read (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsRead a => Read (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsRead a => Read (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsRead a => Read (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsRead a => Read (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityThis instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed
Read a => Read (First a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidRead a => Read (Last a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidRead a => Read (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdRead a => Read (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead a => Read (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead a => Read (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead a => Read (ZipList a)Defined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListRead a => Read (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead a => Read (a)Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead a => Read [a]Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead b => Read (GroupEdges b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.GraphRead e => Read (IntMap e)Defined in containers-0.8 · Data.IntMap.InternalRead e => Read (Word64Map e)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalRead m => Read (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupRead p => Read (Par1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead vertex => Read (SCC vertex)Defined in containers-0.8 · Data.Graph(Read a, Ord a) => Read (Set a)Defined in containers-0.8 · Data.Set.Internal(Integral a, Read a) => Read (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.ReadHasResolution a => Read (Fixed a)Defined in base-4.23.0.0 · Data.FixedRead (Proxy t)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyRead (U1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead (V1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Read1 f, Read a) => Read (Lift f a)Defined in transformers-0.6.3.0 · Control.Applicative.Lift(Read1 m, Read a) => Read (MaybeT m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Maybe(Ord k, Read k, Read e) => Read (Map k e)Defined in containers-0.8 · Data.Map.Internal(Ix a, Read a, Read b) => Read (Array a b)Defined in ghc-internal-10.0.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.23.0.0 · Data.Semigroup(Read a, Read b) => Read (Gr a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.PatriciaTree(Read a, Read b) => Read (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(Read a, Read b) => Read (a, b)Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead (f a) => Read (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidRead (f a) => Read (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead (f p) => Read (Rec1 f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead a => Read (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstRead a => Read (Constant a b)Defined in transformers-0.6.3.0 · Data.Functor.ConstantCoercible a b => Read (Coercion a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.Coercion(Read1 f, Read a) => Read (Backwards f a)Defined in transformers-0.6.3.0 · Control.Applicative.Backwards(Read1 f, Read a) => Read (IdentityT f a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Identity(Read1 f, Read a) => Read (Reverse f a)Defined in transformers-0.6.3.0 · Data.Functor.Reverse(Read a, Read b, Read c) => Read (a, b, c)Defined in ghc-internal-10.0.0 · GHC.Internal.Read(Read e, Read1 m, Read a) => Read (ExceptT e m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Except(Read w, Read1 m, Read a) => Read (WriterT w m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Lazy(Read w, Read1 m, Read a) => Read (WriterT w m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Stricta ~ b => Read (a :~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityRead c => Read (K1 i c p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Read (f a), Read (g a)) => Read (Product f g a)Defined in base-4.23.0.0 · Data.Functor.Product(Read (f a), Read (g a)) => Read (Sum f g a)Defined in base-4.23.0.0 · Data.Functor.Sum(Read (f p), Read (g p)) => Read ((:*:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Read (f p), Read (g p)) => Read ((:+:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Read a, Read b, Read c, Read d) => Read (a, b, c, d)Defined in ghc-internal-10.0.0 · GHC.Internal.Reada ~~ b => Read (a :~~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityRead (f (g a)) => Read (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.ComposeRead (f (g p)) => Read ((:.:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead (f p) => Read (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsRead (gr a b) => Read (OrdGr gr a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.Graph(Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e)Defined in ghc-internal-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.0 · GHC.Internal.Read
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
is total
- Coherence with toRational
if the type also implements
, then
is a left inverse for
, i.e.
fromRational (toRational i) = i
Note that it isn't customarily expected that a type instance of
Fractional implement a field. However, all instances in base do.
Methods
(/) :: a -> a -> ainfixl 7Fractional division.
recip :: a -> aReciprocal fraction.
fromRational :: Rational -> aConversion from a Rational (that is
Ratio Integer). A floating literal stands for an application of fromRational to a value of type Rational, so such literals have type(Fractional a) => a.
Instances17Fractional, …
Fractional EdgeWeightDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGFractional JStgExprDefined in ghc-10.0.0.20260917 · GHC.JS.Make · orphanFractional SaneDoubleDefined in ghc-10.0.0.20260917 · GHC.Types.SaneDoubleFractional CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFractional CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFractional DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanThis 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-10.0.0 · GHC.Internal.Float · orphanThis 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.16.0.1 · Data.Time.Clock.Internal.DiffTimeFractional NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeRealFloat a => Fractional (Complex a)Defined in base-4.23.0.0 · Data.ComplexFractional a => Fractional (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityFractional a => Fractional (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdIntegral a => Fractional (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealHasResolution a => Fractional (Fixed a)Defined in base-4.23.0.0 · Data.FixedFractional a => Fractional (Op a b)Defined in base-4.23.0.0 · Data.Functor.ContravariantFractional a => Fractional (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstFractional (f (g a)) => Fractional (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.Compose
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 ywithrem x y=fromInteger 0org (rem x y)<g yx=y * div x y + mod x ywithmod x y=fromInteger 0orf (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.
Methods
quot :: a -> a -> ainfixl 7Integer division truncated toward zero.
WARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in
base.rem :: a -> a -> ainfixl 7Integer remainder, satisfying
(x `quot` y)*y + (x `rem` y) == xWARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in
base.div :: a -> a -> ainfixl 7Integer division truncated toward negative infinity.
WARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in
base.mod :: a -> a -> ainfixl 7Integer modulus, satisfying
(x `div` y)*y + (x `mod` y) == xWARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in
base.quotRem :: a -> a -> (a, a)divMod :: a -> a -> (a, a)toInteger :: a -> IntegerConversion to Integer.
Instances70Integral, …
Integral ByteOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesIntegral HalfWordDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesIntegral RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesIntegral WordOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesIntegral IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.RealIntegral NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.RealIntegral CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesIntegral IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrIntegral WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrIntegral HalfWordDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesIntegral Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntIntegral Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntIntegral Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntIntegral Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntIntegral ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsIntegral WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsIntegral ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfIntegral WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfIntegral CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesIntegral IntDefined in ghc-internal-10.0.0 · GHC.Internal.RealIntegral WordDefined in ghc-internal-10.0.0 · GHC.Internal.RealIntegral Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordIntegral Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordIntegral Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordIntegral Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordIntegral I8Defined in text-2.1.4 · Data.Text.ForeignIntegral StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonIntegral StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonIntegral a => Integral (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityIntegral a => Integral (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstIntegral (f (g a)) => Integral (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.Compose
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
, then
is a left inverse for
, i.e.
fromRational (toRational i) = i
The law does not hold for Float, Double, CFloat,
CDouble, etc., because these types contain non-finite values,
which cannot be roundtripped through Rational.
Methods
toRational :: a -> RationalRational equivalent of its real argument with full precision.
Instances87Real, …
Real ByteOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesReal HalfWordDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesReal RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesReal WordOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesReal EdgeWeightDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFGReal IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.RealReal NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.RealReal CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CClockDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CSUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CTimeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesReal IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrReal WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrReal HalfWordDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesReal Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntReal Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntReal Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntReal Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntReal ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsReal WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsReal ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfReal WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfReal CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CCcDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CSpeedDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesReal DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanReal FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanReal IntDefined in ghc-internal-10.0.0 · GHC.Internal.RealReal WordDefined in ghc-internal-10.0.0 · GHC.Internal.RealReal Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordReal Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordReal Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordReal Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordReal I8Defined in text-2.1.4 · Data.Text.ForeignReal DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeReal NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeReal StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonReal StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonReal BaudRateDefined in unix-2.8.8.0 · System.Posix.Terminal.CommonIntegral a => Real (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealReal a => Real (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityReal a => Real (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdHasResolution a => Real (Fixed a)Defined in base-4.23.0.0 · Data.FixedReal a => Real (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstReal (f (g a)) => Real (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.Compose
Extracting components of fractions.
Methods
properFraction :: Integral b => a -> (b, a)The function properFraction takes a real fractional number
xand returns a pair(n,f)such thatx = n+f, and:nis an integral number with the same sign asx; andfis a fraction with the same type and sign asx, and with absolute value less than1.
The default definitions of the ceiling, floor, truncate and round functions are in terms of properFraction.
truncate :: Integral b => a -> btruncate xreturns the integer nearestxbetween zero andxround :: Integral b => a -> bround xreturns the nearest integer tox; the even integer ifxis equidistant between two integersceiling :: Integral b => a -> bceiling xreturns the least integer not less thanxfloor :: Integral b => a -> bfloor xreturns the greatest integer not greater thanx
Instances12RealFrac, …
RealFrac CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRealFrac CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesRealFrac DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanBeware 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-10.0.0 · GHC.Internal.Float · orphanBeware 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.16.0.1 · Data.Time.Clock.Internal.DiffTimeRealFrac NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeIntegral a => RealFrac (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealRealFrac a => RealFrac (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityRealFrac a => RealFrac (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdHasResolution a => RealFrac (Fixed a)Defined in base-4.23.0.0 · Data.FixedRealFrac a => RealFrac (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstRealFrac (f (g a)) => RealFrac (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.Compose
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
xis less thand(associativity is ignored). Thus, ifdis0then the result is never surrounded in parentheses; ifdis11it is always surrounded in parentheses, unless it is an atomic expression.If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.
For example, given the declarations
infixr 5 :^:
data Tree a = Leaf a | Tree a :^: Tree athe derived instance of Show is equivalent to
instance (Show a) => Show (Tree a) where
showsPrec d (Leaf m) = showParen (d > app_prec) $
showString "Leaf " . showsPrec (app_prec+1) m
where app_prec = 10
showsPrec d (u :^: v) = showParen (d > up_prec) $
showsPrec (up_prec+1) u .
showString " :^: " .
showsPrec (up_prec+1) v
where up_prec = 5Note that right-associativity of :^: is ignored. For example,
show (Leaf 1 :^: Leaf 2 :^: Leaf 3)produces the string"Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
Methods
Instances805Show, …
Show ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteShow CCFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow ConcFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow DebugFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow DoCostCentresDefined in base-4.23.0.0 · GHC.RTS.FlagsShow DoHeapProfileDefined in base-4.23.0.0 · GHC.RTS.FlagsShow DoTraceDefined in base-4.23.0.0 · GHC.RTS.FlagsShow GCFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow GiveGCStatsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow HpcFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow IoManagerFlagDefined in base-4.23.0.0 · GHC.RTS.FlagsShow MiscFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow ParFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow ProfFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow RTSFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow TickyFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow TraceFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow GCDetailsDefined in base-4.23.0.0 · GHC.StatsShow RTSStatsDefined in base-4.23.0.0 · GHC.StatsShow TimeoutDefined in base-4.23.0.0 · System.TimeoutShow BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphanShow FormatModeDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloatShow FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.D2SShow FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.F2SShow ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeShow SizeOverflowExceptionDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeShow ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalShow ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalShow IntSetDefined in containers-0.8 · Data.IntSet.InternalShow IntersectionDefined in containers-0.8 · Data.IntSet.InternalShow BitQueueDefined in containers-0.8 · Utils.Containers.Internal.BitQueueShow BitQueueBDefined in containers-0.8 · Utils.Containers.Internal.BitQueueShow FileTypeDefined in directory-1.3.11.0 · System.Directory.Internal.CommonShow PermissionsDefined in directory-1.3.11.0 · System.Directory.Internal.CommonShow WhetherFollowDefined in directory-1.3.11.0 · System.Directory.Internal.CommonShow XdgDirectoryDefined in directory-1.3.11.0 · System.Directory.Internal.CommonShow XdgDirectoryListDefined in directory-1.3.11.0 · System.Directory.Internal.CommonShow GhcApiErrorDefined in ghc-10.0.0.20260917 · GHCShow BCOIxDefined in ghc-10.0.0.20260917 · GHC.ByteCode.LinkerShow ByteOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesShow FFIInfoDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesShow HalfWordDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesShow ItblPtrDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesShow RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesShow WordOffDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesShow SectionTypeDefined in ghc-10.0.0.20260917 · GHC.CmmShow CLabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelShow TickyIdInfoDefined in ghc-10.0.0.20260917 · GHC.Cmm.CLabelShow LabelDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelShow LabelSetDefined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelShow RPNumDefined in ghc-10.0.0.20260917 · GHC.Cmm.DominatorsShow AlignmentSpecDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprShow AreaDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprShow CmmExprDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprShow CmmLitDefined in ghc-10.0.0.20260917 · GHC.Cmm.ExprShow CmmTokenDefined in ghc-10.0.0.20260917 · GHC.Cmm.LexerShow AtomicMachOpDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpShow CallishMachOpDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpShow FMASignDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpShow MachOpDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpShow MemoryOrderingDefined in ghc-10.0.0.20260917 · GHC.Cmm.MachOpShow ReducibilityDefined in ghc-10.0.0.20260917 · GHC.Cmm.ReducibilityShow CmmRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegShow GlobalArgRegsDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegShow GlobalRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegShow GlobalRegUseDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegShow LocalRegDefined in ghc-10.0.0.20260917 · GHC.Cmm.RegShow SwitchPlanDefined in ghc-10.0.0.20260917 · GHC.Cmm.SwitchShow SwitchTargetsDefined in ghc-10.0.0.20260917 · GHC.Cmm.SwitchShow CmmCatDefined in ghc-10.0.0.20260917 · GHC.Cmm.TypeShow CmmTypeDefined in ghc-10.0.0.20260917 · GHC.Cmm.TypeShow WidthDefined in ghc-10.0.0.20260917 · GHC.Cmm.TypeShow DMBISHFlagsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrShow ExtModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrShow OperandDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrShow ShiftModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.InstrShow AddrModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.RegsShow ImmDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.AArch64.RegsShow FormatDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.FormatShow RegWithFormatDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.FormatShow ScalarFormatDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.FormatShow RegUsageDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.InstrShow CondDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.CondShow BarrierTypeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.InstrShow OperandDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.InstrShow AddrModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.RegsShow ImmDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.LA64.RegsShow CondDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.CondShow OperandDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.InstrShow AddrModeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.RegsShow ImmDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.RV64.RegsShow RegDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseShow RegClassDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseShow RegSubDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Graph.BaseShow FreeRegsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.AArch64Show RealRegUsageDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.BaseShow VLocDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.BaseShow FreeRegsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.LA64Show FreeRegsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.PPCShow FreeRegsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.RV64Show FreeRegsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.X86Show FreeRegsDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.X86_64Show BrTableIntervalDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesShow SymNameDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesShow PaddingDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenShow RawStackArgDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenShow StackArgDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenShow StackRefDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.CodeGenShow MinMaxTypeDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.InstrShow MinOrMaxDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.X86.InstrShow FixityDefined in ghc-10.0.0.20260917 · GHC.CmmToCShow SignageDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.CodeGenShow IsSubmultDefined in ghc-10.0.0.20260917 · GHC.Core.MultiplicityShow ComparisonDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.RangeShow RangeDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.RangeShow IsRecDataConResultDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.WorkWrap.UtilsShow InvisibleBitDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.CompareShow PrimElemRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConShow PrimOrVoidRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConShow PrimRepDefined in ghc-10.0.0.20260917 · GHC.Core.TyConShow OverridingBoolDefined in ghc-10.0.0.20260917 · GHC.Data.BoolShow FastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringShow LexicalFastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringShow NonDetFastStringDefined in ghc-10.0.0.20260917 · GHC.Data.FastStringShow IOEnvFailureDefined in ghc-10.0.0.20260917 · GHC.Data.IOEnvShow StringBufferDefined in ghc-10.0.0.20260917 · GHC.Data.StringBufferShow Word64SetDefined in ghc-10.0.0.20260917 · GHC.Data.Word64Set.InternalShow BackendDefined in ghc-10.0.0.20260917 · GHC.Driver.BackendThe Show instance is for messages only. If code depends on what's in the string, you deserve what happens to you.
Show PrimitiveImplementationDefined in ghc-10.0.0.20260917 · GHC.Driver.BackendShow BackendNameDefined in ghc-10.0.0.20260917 · GHC.Driver.Backend.InternalShow CodeGenEnableDefined in ghc-10.0.0.20260917 · GHC.Driver.DownsweepShow DynamicTooStateDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsShow ExecutableLinkModeDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsShow GhcLinkDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsShow PackageArgDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsShow RtsOptsEnabledDefined in ghc-10.0.0.20260917 · GHC.Driver.DynFlagsShow DumpFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsShow GeneralFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsShow LanguageDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsShow WarningFlagDefined in ghc-10.0.0.20260917 · GHC.Driver.FlagsShow IncludeSpecsDefined in ghc-10.0.0.20260917 · GHC.Driver.IncludeSpecsShow ResultLoopOriginDefined in ghc-10.0.0.20260917 · GHC.Driver.MakeShow ResultOriginDefined in ghc-10.0.0.20260917 · GHC.Driver.MakeShow PhaseDefined in ghc-10.0.0.20260917 · GHC.Driver.PhasesShow PipelineOutputDefined in ghc-10.0.0.20260917 · GHC.Driver.Pipeline.MonadShow HsDocStringDefined in ghc-10.0.0.20260917 · GHC.Hs.DocStringShow HsDocStringChunkDefined in ghc-10.0.0.20260917 · GHC.Hs.DocStringShow HsDocStringDecoratorDefined in ghc-10.0.0.20260917 · GHC.Hs.DocStringShow BlankEpAnnotationsDefined in ghc-10.0.0.20260917 · GHC.Hs.DumpShow BlankSrcSpanDefined in ghc-10.0.0.20260917 · GHC.Hs.DumpShow PatGroupDefined in ghc-10.0.0.20260917 · GHC.HsToCore.MatchShow GenerateInhabitingPatternsModeDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.SolverShow PmEqualityDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.Solver.TypesShow PrecisionDefined in ghc-10.0.0.20260917 · GHC.HsToCore.Pmc.TypesShow CompressionIFaceDefined in ghc-10.0.0.20260917 · GHC.Iface.BinaryShow EntityInfoDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesShow UnfoldingExposureDefined in ghc-10.0.0.20260917 · GHC.Iface.TidyShow IfLclNameDefined in ghc-10.0.0.20260917 · GHC.Iface.TypeShow IdentDefined in ghc-10.0.0.20260917 · GHC.JS.IdentShow AOpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxShow OpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxShow UOpDefined in ghc-10.0.0.20260917 · GHC.JS.JStg.SyntaxShow MultiplicityDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleShow VarDeclDefined in ghc-10.0.0.20260917 · GHC.JS.Opt.SimpleShow AOpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxShow OpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxShow UOpDefined in ghc-10.0.0.20260917 · GHC.JS.SyntaxShow LinkInfoDefined in ghc-10.0.0.20260917 · GHC.Linker.ExecutableShow UnitLinkOptsDefined in ghc-10.0.0.20260917 · GHC.Linker.UnitShow LlvmAtomicOpDefined in ghc-10.0.0.20260917 · GHC.Llvm.SyntaxShow LlvmSyncOrderingDefined in ghc-10.0.0.20260917 · GHC.Llvm.SyntaxShow LlvmCallTypeDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesShow LlvmParameterListTypeDefined in ghc-10.0.0.20260917 · GHC.Llvm.TypesShow BindTagDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationShow DeclTagDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationShow EpaCommentDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationShow EpaCommentTokDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationShow HasEDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationShow IsUnicodeSyntaxDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationShow LexErrDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesShow LexErrKindDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesShow NumUnderscoreReasonDefined in ghc-10.0.0.20260917 · GHC.Parser.Errors.TypesShow HdkCommentDefined in ghc-10.0.0.20260917 · GHC.Parser.LexerShow LayoutContextDefined in ghc-10.0.0.20260917 · GHC.Parser.LexerShow OpWsDefined in ghc-10.0.0.20260917 · GHC.Parser.LexerShow TokenDefined in ghc-10.0.0.20260917 · GHC.Parser.LexerShow AlexInputDefined in ghc-10.0.0.20260917 · GHC.Parser.Lexer.InterfaceShow ColumnBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockShow LowerLocBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockShow UpperLocBoundDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockShow StringLexErrorDefined in ghc-10.0.0.20260917 · GHC.Parser.StringShow StringMetaDefined in ghc-10.0.0.20260917 · GHC.Parser.StringShow PlatformDefined in ghc-10.0.0.20260917 · GHC.PlatformShow PlatformWordSizeDefined in ghc-10.0.0.20260917 · GHC.PlatformShow PlatformConstantsDefined in ghc-10.0.0.20260917 · GHC.Platform.ConstantsShow ProfileDefined in ghc-10.0.0.20260917 · GHC.Platform.ProfileShow RealRegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegShow RegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegShow VirtualRegDefined in ghc-10.0.0.20260917 · GHC.Platform.RegShow RegArchDefined in ghc-10.0.0.20260917 · GHC.Platform.Reg.ClassShow RegClassDefined in ghc-10.0.0.20260917 · GHC.Platform.Reg.ClassShow WayDefined in ghc-10.0.0.20260917 · GHC.Platform.WaysShow StgLiftConfigDefined in ghc-10.0.0.20260917 · GHC.Stg.Lift.ConfigShow StgToDoDefined in ghc-10.0.0.20260917 · GHC.Stg.PipelineShow UpdateFlagDefined in ghc-10.0.0.20260917 · GHC.Stg.SyntaxShow ApplyConvDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ApplyShow ApplySpecDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ApplyShow ObjectKindDefined in ghc-10.0.0.20260917 · GHC.StgToJS.ObjectShow SpecialDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsShow StgRetDefined in ghc-10.0.0.20260917 · GHC.StgToJS.RegsShow CILayoutDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow CIRegsDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow CIStaticDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow CITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow ClosureInfoDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow ClosureTypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow ExpFunDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow ForeignJSRefDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow JSFFITypeDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow JSRepDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow StaticAppKindDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow StaticArgDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow StaticInfoDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow StaticLitDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow StaticUnboxedDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow StaticValDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow ThreadStatusDefined in ghc-10.0.0.20260917 · GHC.StgToJS.TypesShow SlotCountDefined in ghc-10.0.0.20260917 · GHC.StgToJS.UtilsShow ArchiveDefined in ghc-10.0.0.20260917 · GHC.SysTools.ArShow ArchiveEntryDefined in ghc-10.0.0.20260917 · GHC.SysTools.ArShow HasKindsDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesShow SuggestPartialTypeSignaturesDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesShow SuggestUndecidableInstancesDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesShow WhatLookingDefined in ghc-10.0.0.20260917 · GHC.Tc.Errors.TypesShow SimpleUnifyResultDefined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifyShow ImportLevelDefined in ghc-10.0.0.20260917 · GHC.Types.BasicShow LevityDefined in ghc-10.0.0.20260917 · GHC.Types.BasicShow PprPrecDefined in ghc-10.0.0.20260917 · GHC.Types.BasicShow CardDefined in ghc-10.0.0.20260917 · GHC.Types.DemandShow DiagnosticCodeDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorShow DiagnosticReasonDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorShow SeverityDefined in ghc-10.0.0.20260917 · GHC.Types.ErrorShow DuplicateRecordFieldsDefined in ghc-10.0.0.20260917 · GHC.Types.FieldLabelShow FieldSelectorsDefined in ghc-10.0.0.20260917 · GHC.Types.FieldLabelShow SemaphoreUpgradeTargetDefined in ghc-10.0.0.20260917 · GHC.Types.HintShow LitFloatingDefined in ghc-10.0.0.20260917 · GHC.Types.Literal.FloatingShow LitFloatingTypeDefined in ghc-10.0.0.20260917 · GHC.Types.Literal.FloatingShow FieldsOrSelectorsDefined in ghc-10.0.0.20260917 · GHC.Types.Name.ReaderShow ProfAutoDefined in ghc-10.0.0.20260917 · GHC.Types.ProfAutoShow SafeHaskellModeDefined in ghc-10.0.0.20260917 · GHC.Types.SafeHaskellShow SaneDoubleDefined in ghc-10.0.0.20260917 · GHC.Types.SaneDoubleShow SourceErrorDefined in ghc-10.0.0.20260917 · GHC.Types.SourceErrorShow HsBootOrSigDefined in ghc-10.0.0.20260917 · GHC.Types.SourceFileShow HscSourceDefined in ghc-10.0.0.20260917 · GHC.Types.SourceFileShow FractionalExponentBaseDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextShow FractionalLitDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextShow IntegralLitDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextShow SourceTextDefined in ghc-10.0.0.20260917 · GHC.Types.SourceTextShow BufPosDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow BufSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow DeltaPosDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow GeneratedSrcSpanDetailsDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow NoCommentsDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow PsLocDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow PsSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow RealSrcLocDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow RealSrcSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow SrcLocDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow SrcSpanDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow UnhelpfulSpanReasonDefined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow TickishPlacementDefined in ghc-10.0.0.20260917 · GHC.Types.TickishShow UniqueDefined in ghc-10.0.0.20260917 · GHC.Types.UniqueShow UniqueTagDefined in ghc-10.0.0.20260917 · GHC.Types.UniqueShow UniqueSetDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SetShow ModLocationDefined in ghc-10.0.0.20260917 · GHC.Unit.Module.LocationShow UnitDefined in ghc-10.0.0.20260917 · GHC.Unit.TypesShow PrintTimingsDefined in ghc-10.0.0.20260917 · GHC.Utils.ErrorShow DumpFormatDefined in ghc-10.0.0.20260917 · GHC.Utils.LoggerShow GhcExceptionDefined in ghc-10.0.0.20260917 · GHC.Utils.PanicShow PlainGhcExceptionDefined in ghc-10.0.0.20260917 · GHC.Utils.Panic.PlainShow DocDefined in ghc-10.0.0.20260917 · GHC.Utils.PprShow TempFileLifetimeDefined in ghc-10.0.0.20260917 · GHC.Utils.TmpFsShow InlineSpecDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Binds.InlinePragmaShow RuleMatchInfoDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Binds.InlinePragmaShow SpliceDecorationDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.DeclsShow WarningCategoryDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.DeclsShow CCallConvDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignShow ForeignKindDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignShow SafetyDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Decls.ForeignShow IsBootInterfaceDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.ImpExp.IsBootShow ModuleNameDefined in ghc-10.0.0.20260917 · Language.Haskell.Syntax.Module.NameShow ShortTextDefined in ghc-boot-10.0.0.20260917 · GHC.Data.ShortTextShow DbInstUnitIdDefined in ghc-boot-10.0.0.20260917 · GHC.Unit.DatabaseShow DbModuleDefined in ghc-boot-10.0.0.20260917 · GHC.Unit.DatabaseShow ForallVisFlagDefined in ghc-boot-th-10.0.0.20260917 · GHC.Boot.TH.PprShow DocDefined in ghc-boot-th-10.0.0.20260917 · GHC.Boot.TH.PprLibShow VoidDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow ByteOrderDefined in ghc-internal-10.0.0 · GHC.Internal.ByteOrderShow ClosureTypeDefined in ghc-internal-10.0.0 · GHC.Internal.ClosureTypesShow BlockReasonDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncShow ThreadIdDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncShow ThreadStatusDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncShow NestedAtomicallyDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow NoMatchingContinuationPromptDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow NoMethodErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow NonTerminationDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow PatternMatchFailDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow RecConErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow RecSelErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow RecUpdErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow TypeErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow ConstrDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow ConstrRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow DataRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow DataTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow FixityDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow DynamicDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DynamicShow AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow SomeTypeRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.InternalShow VersionDefined in ghc-internal-10.0.0 · GHC.Internal.Data.VersionShow ControlMessageDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ControlShow EPollFdDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollShow EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollShow EventTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollShow EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesShow EventLifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesShow LifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesShow TimeoutDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesShow FdKeyDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ManagerShow StateDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ManagerShow EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.PollShow PollFdDefined in ghc-internal-10.0.0 · GHC.Internal.Event.PollShow StateDefined in ghc-internal-10.0.0 · GHC.Internal.Event.TimerManagerShow UniqueDefined in ghc-internal-10.0.0 · GHC.Internal.Event.UniqueShow ErrorCallDefined in ghc-internal-10.0.0 · GHC.Internal.ExceptionShow ArithExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow SomeExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow WhileHandlingDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow FingerprintDefined in ghc-internal-10.0.0 · GHC.Internal.Fingerprint.TypeShow CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CClockDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CSUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CTimeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrShow WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrShow ForeignSrcLangDefined in ghc-internal-10.0.0 · GHC.Internal.ForeignSrcLangShow AssociativityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow FixityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow BoxDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow PrimTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow TsoFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow WhatNextDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow WhyBlockedDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow HalfWordDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesShow StgInfoTableDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesShow CostCentreDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesShow CostCentreStackDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesShow IndexTableDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesShow StgTSOProfInfoDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesShow MaskingStateDefined in ghc-internal-10.0.0 · GHC.Internal.IOShow SeekModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.DeviceShow CodingFailureModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Encoding.FailureShow CodingProgressDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Encoding.TypesShow TextEncodingDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Encoding.TypesShow AllocationLimitExceededDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow ArrayExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow AssertionFailedDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow AsyncExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow BlockedIndefinitelyOnMVarDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow BlockedIndefinitelyOnSTMDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow CompactionFailedDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow DeadlockDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow ExitCodeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow FixIOExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow IOErrorTypeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow IOExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow SomeAsyncExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow FDDefined in ghc-internal-10.0.0 · GHC.Internal.IO.FDShow HandlePosnDefined in ghc-internal-10.0.0 · GHC.Internal.IO.HandleShow FileLockingNotSupportedDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.Lock.CommonShow BufferModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow HandleDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow HandleTypeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow NewlineDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow NewlineModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow IOModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.IOModeShow IoSubSystemDefined in ghc-internal-10.0.0 · GHC.Internal.IO.SubSystemShow InfoProvDefined in ghc-internal-10.0.0 · GHC.Internal.InfoProv.TypesShow Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntShow Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntShow Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntShow Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntShow ExtensionDefined in ghc-internal-10.0.0 · GHC.Internal.LanguageExtensionsShow CCFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow ConcFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow DebugFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow DoCostCentresDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow DoHeapProfileDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow DoTraceDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow GCFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow GiveGCStatsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow HpcFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow IoManagerFlagDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow MiscFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow ParFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow ProfFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow RTSFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow TickyFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow TraceFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow FractionalExponentBaseDefined in ghc-internal-10.0.0 · GHC.Internal.RealShow ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsShow WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsShow ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfShow WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfShow PointernessDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.DecodeShow StackEntryDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.DecodeShow CallStackDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow SrcLocDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow StaticPtrInfoDefined in ghc-internal-10.0.0 · GHC.Internal.StaticPtrShow GCDetailsDefined in ghc-internal-10.0.0 · GHC.Internal.StatsShow RTSStatsDefined in ghc-internal-10.0.0 · GHC.Internal.StatsShow CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CCcDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CSpeedDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CTimerDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow AnnLookupDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow AnnTargetDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow BangDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow BndrVisDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow BodyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow BytesDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow CallconvDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ClauseDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ConDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DecDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DerivClauseDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DerivStrategyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DocLocDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ExpDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow FamilyResultSigDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow FixityDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow FixityDirectionDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ForeignDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow FunDepDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow GuardDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow InfoDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow InjectivityAnnDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow InlineDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow LitDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow LocDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow MatchDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ModNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ModuleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ModuleInfoDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow NameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow NameFlavourDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow NameSpaceDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow NamespaceSpecifierDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow OccNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow OverlapDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PatDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PatSynArgsDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PatSynDirDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PhasesDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PkgNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PragmaDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow RangeDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow RoleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow RuleBndrDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow RuleMatchDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow SafetyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow SpecificityDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow StmtDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow TyLitDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow TySynEqnDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow TypeDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow TypeFamilyHeadDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow LexemeDefined in ghc-internal-10.0.0 · GHC.Internal.Text.Read.LexShow NumberDefined in ghc-internal-10.0.0 · GHC.Internal.Text.Read.LexShow SomeCharDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsShow SomeSymbolDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsShow SomeNatDefined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsShow BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow CharDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanShow FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanShow IntDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow KindRepDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow LevityDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow ModuleDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow RuntimeRepDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow TrNameDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow TyConDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow TypeLitSortDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow VecCountDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow VecElemDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow WordDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow GeneralCategoryDefined in ghc-internal-10.0.0 · GHC.Internal.UnicodeShow Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordShow Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordShow Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordShow Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordShow ArchDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSShow ArchOSDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSShow ArmABIDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSShow ArmISADefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSShow ArmISAExtDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSShow OSDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSShow PPC_64ABIDefined in ghc-platform-0.1.0.0 · GHC.Platform.ArchOSShow LibraryDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.LibraryShow ErrorDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.MonadShow ProgramDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.ProgramShow TargetDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.TargetHandwritten Show instance to have have better diffs against the toolchain targets generated by configure
Show WordSizeDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.TargetShow ArDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.ArShow CcDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CcShow CmmCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppShow CppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppShow HsCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppShow JsCppDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CppShow CxxDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.CxxShow CcLinkDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.LinkShow MergeObjsDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.MergeObjsShow NmDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.NmShow RanlibDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.RanlibShow ReadelfDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.Tools.ReadelfShow FFITypeDefined in ghci-10.0.0.20260917 · GHCi.FFIShow ConInfoTableDefined in ghci-10.0.0.20260917 · GHCi.MessageShow EvalBreakpointDefined in ghci-10.0.0.20260917 · GHCi.MessageShow EvalOptsDefined in ghci-10.0.0.20260917 · GHCi.MessageShow QStateDefined in ghci-10.0.0.20260917 · GHCi.MessageShow SerializableExceptionDefined in ghci-10.0.0.20260917 · GHCi.MessageShow THResultTypeDefined in ghci-10.0.0.20260917 · GHCi.MessageShow HValueDefined in ghci-10.0.0.20260917 · GHCi.RemoteTypesShow ResolvedBCODefined in ghci-10.0.0.20260917 · GHCi.ResolvedBCOShow ResolvedBCOPtrDefined in ghci-10.0.0.20260917 · GHCi.ResolvedBCOShow GHCiQExceptionDefined in ghci-10.0.0.20260917 · GHCi.THShow BoxLabelDefined in hpc-0.7.0.2 · Trace.Hpc.MixShow CondBoxDefined in hpc-0.7.0.2 · Trace.Hpc.MixShow MixDefined in hpc-0.7.0.2 · Trace.Hpc.MixShow TixDefined in hpc-0.7.0.2 · Trace.Hpc.TixShow TixModuleDefined in hpc-0.7.0.2 · Trace.Hpc.TixShow HashDefined in hpc-0.7.0.2 · Trace.Hpc.UtilShow HpcPosDefined in hpc-0.7.0.2 · Trace.Hpc.UtilShow EncodingExceptionDefined in os-string-2.0.11 · System.OsString.Encoding.InternalShow OsCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesShow OsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesOn windows, decodes as UCS-2. On unix prints the raw bytes without decoding.
Show PosixCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesShow PosixStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesPrints the raw bytes without decoding.
Show WindowsCharDefined in os-string-2.0.11 · System.OsString.Internal.TypesShow WindowsStringDefined in os-string-2.0.11 · System.OsString.Internal.TypesDecodes as UCS-2.
Show ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassShow DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJShow PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassShow CmdSpecDefined in process-1.6.30.0 · System.Process.CommonShow CreateProcessDefined in process-1.6.30.0 · System.Process.CommonShow StdStreamDefined in process-1.6.30.0 · System.Process.CommonShow CommunicationHandleDefined in process-1.6.30.0 · System.Process.CommunicationHandle.InternalShow SemaphoreErrorDefined in semaphore-compat-2.0.1 · System.Semaphore.Internal.VersionShow SemaphoreNameDefined in semaphore-compat-2.0.1 · System.Semaphore.Internal.VersionShow SemaphoreProtocolVersionDefined in semaphore-compat-2.0.1 · System.Semaphore.Internal.VersionShow DecodingDefined in text-2.1.4 · Data.Text.EncodingShow UnicodeExceptionDefined in text-2.1.4 · Data.Text.Encoding.ErrorShow I8Defined in text-2.1.4 · Data.Text.ForeignShow TextDefined in text-2.1.4 · Data.Text.Show · orphanShow BuilderDefined in text-2.1.4 · Data.Text.Internal.BuilderShow PartialUtf8CodePointDefined in text-2.1.4 · Data.Text.Internal.EncodingShow Utf8StateDefined in text-2.1.4 · Data.Text.Internal.EncodingShow DecoderStateDefined in text-2.1.4 · Data.Text.Internal.Encoding.Utf8Show SizeDefined in text-2.1.4 · Data.Text.Internal.Fusion.SizeShow TextDefined in text-2.1.4 · Data.Text.Lazy · orphanShow FPFormatDefined in text-2.1.4 · Data.Text.Lazy.Builder.RealFloatShow IterDefined in text-2.1.4 · Data.Text.UnsafeShow CalendarDiffDaysDefined in time-1.16.0.1 · Data.Time.Format.ISO8601 · orphanShow DayDefined in time-1.16.0.1 · Data.Time.Calendar.Gregorian · orphanShow MonthDefined in time-1.16.0.1 · Data.Time.Calendar.MonthShow as
yyyy-mm.Show QuarterDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterShow as
yyyy-Qn.Show QuarterOfYearDefined in time-1.16.0.1 · Data.Time.Calendar.QuarterShow DayOfWeekDefined in time-1.16.0.1 · Data.Time.Calendar.WeekShow AbsoluteTimeDefined in time-1.16.0.1 · Data.Time.Clock.TAI · orphanShow DiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.DiffTimeShow NominalDiffTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.NominalDiffTimeShow SystemTimeDefined in time-1.16.0.1 · Data.Time.Clock.Internal.SystemTimeShow UTCTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTime · orphanShow UniversalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTime · orphanShow TimeLocaleDefined in time-1.16.0.1 · Data.Time.Format.LocaleShow CalendarDiffTimeDefined in time-1.16.0.1 · Data.Time.Format.ISO8601 · orphanShow LocalTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.LocalTimeShow TimeOfDayDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeOfDayShow TimeZoneDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.TimeZoneThis only shows the time zone name, or offset if the name is empty.
Show ZonedTimeDefined in time-1.16.0.1 · Data.Time.LocalTime.Internal.ZonedTimeFor the time zone, this only shows the name, or offset if the name is empty.
Show DirTypeDefined in unix-2.8.8.0 · System.Posix.Directory.CommonShow DLDefined in unix-2.8.8.0 · System.Posix.DynamicLinker.PrimShow RTLDFlagsDefined in unix-2.8.8.0 · System.Posix.DynamicLinker.PrimShow CAttributesDefined in unix-2.8.8.0 · System.Posix.Files.CommonShow StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonShow StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonShow OpenFileFlagsDefined in unix-2.8.8.0 · System.Posix.IO.CommonShow OpenModeDefined in unix-2.8.8.0 · System.Posix.IO.CommonShow ProcessStatusDefined in unix-2.8.8.0 · System.Posix.Process.InternalsShow ResourceDefined in unix-2.8.8.0 · System.Posix.ResourceShow ResourceLimitDefined in unix-2.8.8.0 · System.Posix.ResourceShow ResourceLimitsDefined in unix-2.8.8.0 · System.Posix.ResourceShow BaudRateDefined in unix-2.8.8.0 · System.Posix.Terminal.CommonShow GroupEntryDefined in unix-2.8.8.0 · System.Posix.User.CommonShow UserEntryDefined in unix-2.8.8.0 · System.Posix.User.CommonShow ()Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow (WasmTypeTag t)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesShow (Position p)Defined in ghc-10.0.0.20260917 · GHC.Tc.Types.OriginShow (MsgEnvelope DiagnosticMessage)Defined in ghc-10.0.0.20260917 · GHC.Types.ErrorShow (ConstPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.ConstPtrShow (ForeignPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.ForeignPtrShow (FunPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.PtrShow (Ptr a)Defined in ghc-internal-10.0.0 · GHC.Internal.PtrShow (SChar c)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsShow (SSymbol s)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsShow (SNat n)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsShow (Message a)Defined in ghci-10.0.0.20260917 · GHCi.MessageShow (THMessage a)Defined in ghci-10.0.0.20260917 · GHCi.MessageShow (RemotePtr a)Defined in ghci-10.0.0.20260917 · GHCi.RemoteTypesShow (RemoteRef a)Defined in ghci-10.0.0.20260917 · GHCi.RemoteTypesShow (BCOByteArray Word)Defined in ghci-10.0.0.20260917 · GHCi.ResolvedBCOShow (BCOByteArray Word16)Defined in ghci-10.0.0.20260917 · GHCi.ResolvedBCOShow (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow a => Show (Complex a)Defined in base-4.23.0.0 · Data.ComplexShow a => Show (First a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (Last a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (Max a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (Min a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (Decoder a)Defined in binary-0.8.9.3 · Data.Binary.Get.InternalShow a => Show (IntMap a)Defined in containers-0.8 · Data.IntMap.InternalShow a => Show (Seq a)Defined in containers-0.8 · Data.Sequence.InternalShow a => Show (ViewL a)Defined in containers-0.8 · Data.Sequence.InternalShow a => Show (ViewR a)Defined in containers-0.8 · Data.Sequence.InternalShow a => Show (Intersection a)Defined in containers-0.8 · Data.Set.InternalShow a => Show (Set a)Defined in containers-0.8 · Data.Set.InternalShow a => Show (PostOrder a)Defined in containers-0.8 · Data.TreeShow a => Show (Tree a)Defined in containers-0.8 · Data.TreeShow a => Show (ExitCase a)Defined in exceptions-0.10.12 · Control.Monad.CatchShow a => Show (LPath a)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.GraphShow a => Show (FromListCounting a)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.PatriciaTreeShow a => Show (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Data.StrictShow a => Show (Word64Map a)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalShow a => Show (OnOff a)Defined in ghc-10.0.0.20260917 · GHC.Driver.FlagsShow a => Show (NonVoid a)Defined in ghc-10.0.0.20260917 · GHC.StgToCmm.ClosureShow a => Show (EpaLocation' a)Defined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow a => Show (FixedLengthEncoding a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryShow a => Show (SmallArray a)Defined in ghc-boot-10.0.0.20260917 · GHC.Data.SmallArrayShow a => Show (NonEmpty a)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow a => Show (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsShow a => Show (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsShow a => Show (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsShow a => Show (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsShow a => Show (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityThis instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed
Show a => Show (First a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidShow a => Show (Last a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidShow a => Show (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdShow a => Show (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (ExceptionWithContext a)Defined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow a => Show (ZipList a)Defined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListShow a => Show (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow a => Show (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealShow a => Show (EvalExpr a)Defined in ghci-10.0.0.20260917 · GHCi.MessageShow a => Show (EvalResult a)Defined in ghci-10.0.0.20260917 · GHCi.MessageShow a => Show (QResult a)Defined in ghci-10.0.0.20260917 · GHCi.MessageShow a => Show (THResult a)Defined in ghci-10.0.0.20260917 · GHCi.MessageShow a => Show (AnnotDetails a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow a => Show (Span a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow a => Show (a)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow a => Show [a]Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow b => Show (GroupEdges b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.GraphShow b => Show (GenClosure b)Defined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow b => Show (GenStackField b)Defined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow b => Show (GenStackFrame b)Defined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow b => Show (GenStgStackClosure b)Defined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow e => Show (NoBacktrace e)Defined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow flag => Show (TyVarBndr flag)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow m => Show (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupShow mod => Show (GenWithIsBoot mod)Defined in ghc-10.0.0.20260917 · GHC.Unit.TypesShow p => Show (Par1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow v => Show (LabelMap v)Defined in ghc-10.0.0.20260917 · GHC.Cmm.Dataflow.LabelShow vertex => Show (SCC vertex)Defined in containers-0.8 · Data.GraphHasResolution a => Show (Fixed a)Defined in base-4.23.0.0 · Data.FixedShow (Bin a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryShow (RelBin a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryShow (RelBinPtr a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryShow (Proxy s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyShow (TypeRep a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.InternalShow (U1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (UAddr p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (V1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (ST s a)Defined in ghc-internal-10.0.0 · GHC.Internal.STShow (a -> b)Defined in base-4.23.0.0 · Text.Show.Functions · orphanShow a => Show (EvalStatus_ a b)Defined in ghci-10.0.0.20260917 · GHCi.Message(Show1 f, Show a) => Show (Lift f a)Defined in transformers-0.6.3.0 · Control.Applicative.Lift(Show1 m, Show a) => Show (MaybeT m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Maybe(Ix a, Show a, Show b) => Show (Array a b)Defined in ghc-internal-10.0.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.23.0.0 · Data.Semigroup(Show a, Show b) => Show (Gr a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.PatriciaTree(Show a, Show b) => Show (Pair a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Strict(Show a, Show b) => Show (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(Show a, Show b) => Show (a, b)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(Show k, Show a) => Show (Map k a)Defined in containers-0.8 · Data.Map.Internal(Show l, Show e) => Show (GenLocated l e)Defined in ghc-10.0.0.20260917 · GHC.Types.SrcLocShow (Coercion a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.CoercionShow (OrderingI a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.OrdShow (URec Char p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Double p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Float p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Int p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Word p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (a :~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityShow (f a) => Show (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidShow (f a) => Show (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow (f p) => Show (Rec1 f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow a => Show (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstShow a => Show (Constant a b)Defined in transformers-0.6.3.0 · Data.Functor.Constant(Show1 f, Show a) => Show (Backwards f a)Defined in transformers-0.6.3.0 · Control.Applicative.Backwards(Show1 f, Show a) => Show (IdentityT f a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Identity(Show1 f, Show a) => Show (Reverse f a)Defined in transformers-0.6.3.0 · Data.Functor.Reverse(Show a, Show b, Show c) => Show (a, b, c)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(Show e, Show1 m, Show a) => Show (ExceptT e m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Except(Show w, Show1 m, Show a) => Show (WriterT w m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Lazy(Show w, Show1 m, Show a) => Show (WriterT w m a)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.StrictShow (a :~~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityShow c => Show (K1 i c p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Show (f a), Show (g a)) => Show (Product f g a)Defined in base-4.23.0.0 · Data.Functor.Product(Show (f a), Show (g a)) => Show (Sum f g a)Defined in base-4.23.0.0 · Data.Functor.Sum(Show (f p), Show (g p)) => Show ((:*:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Show (f p), Show (g p)) => Show ((:+:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Show a, Show b, Show c, Show d) => Show (a, b, c, d)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow (f (g a)) => Show (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.ComposeShow (f (g p)) => Show ((:.:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (f p) => Show (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (gr a b) => Show (OrdGr gr a b)Defined in ghc-10.0.0.20260917 · GHC.Data.Graph.Inductive.Graph(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(Show uid, Show modulename, Show mod, Show srcpkgid, Show srcpkgname) => Show (GenericUnitInfo srcpkgid srcpkgname uid modulename mod)Defined in ghc-boot-10.0.0.20260917 · GHC.Unit.Database(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f)Defined in ghc-internal-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.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-10.0.0 · GHC.Internal.Show
A value of type IO a is a computation which, when performed,
does some I/O before returning a value of type a.
There is really only one way to "perform" an I/O action: bind it to
Main.main in your program. When your program is run, the I/O will
be performed. It isn't possible to perform I/O from an arbitrary
function, unless that function is itself in the IO monad and called
at some point, directly or indirectly, from Main.main.
IO is a monad, so IO actions can be combined using either the do-notation
or the Prelude.>> and Prelude.>>= operations from the Prelude.Monad
class.
Instances39Monad, Functor, MonadFix, MonadFail, Applicative, GHCiSandboxIO, …
Monad IODefined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor IODefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonadFix IODefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FixMonadFail IODefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FailApplicative IODefined in ghc-internal-10.0.0 · GHC.Internal.BaseGHCiSandboxIO IODefined in ghc-internal-10.0.0 · GHC.Internal.GHCiQuote IODefined in ghc-internal-10.0.0 · GHC.Internal.TH.MonadAlternative IODefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonadPlus IODefined in ghc-internal-10.0.0 · GHC.Internal.BaseQuasi IODefined in ghc-internal-10.0.0 · GHC.Internal.TH.MonadMonadIO IODefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.IO.ClassMonadCatch IODefined in exceptions-0.10.12 · Control.Monad.CatchMonadMask IODefined in exceptions-0.10.12 · Control.Monad.CatchMonadThrow IODefined in exceptions-0.10.12 · Control.Monad.CatchMonadError IOException IODefined in mtl-2.3.2 · Control.Monad.Error.ClassMArray IOUArray Int16 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Int32 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Int64 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Int8 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Bool IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Char IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Double IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Float IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Int IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word16 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word32 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word64 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray Word8 IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOArray e IODefined in array-0.5.8.0 · Data.Array.BaseMArray TArray e IODefined in stm-2.5.3.1 · Control.Concurrent.STM.TArrayWrites are slow in IO.
Storable e => MArray StorableArray e IODefined in array-0.5.8.0 · Data.Array.Storable.InternalsMArray IOUArray (FunPtr a) IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray (Ptr a) IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray IOUArray (StablePtr a) IODefined in array-0.5.8.0 · Data.Array.IO.InternalsSemigroup a => Semigroup (IO a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid a => Monoid (IO a)Defined in ghc-internal-10.0.0 · GHC.Internal.Basea ~ () => HPrintfType (IO a)Defined in base-4.23.0.0 · Text.Printfa ~ () => PrintfType (IO a)Defined in base-4.23.0.0 · Text.Printf
Instances17Bounded, Enum, Eq, Data, Ord, Read, …
Bounded OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEq OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesData OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataOrd OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesRead OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ReadShow OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ShowIx OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.IxGeneric OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.BaseNFData OrderingDefined in deepseq-1.5.2.0 · Control.DeepSeqPretty OrderingDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty OrderingDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary OrderingDefined in binary-0.8.9.3 · Data.Binary.ClassOutputable OrderingDefined in ghc-10.0.0.20260917 · GHC.Utils.Outputabletype Rep Ordering = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Ordering"
"GHC.Internal.Types"
"ghc-internal"
'False) (C1 ('MetaCons"LT"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"EQ"
'PrefixI 'False) U1 :+: C1 ('MetaCons"GT"
'PrefixI 'False) U1))
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.
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.
Instances23Enum, Eq, Integral, Data, Num, Ord, …
Enum IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEq IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.Bignum.IntegerIntegral IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.RealData IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataNum IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.NumOrd IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.Bignum.IntegerRead IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.ReadReal IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.RealShow IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.ShowIx IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.IxBits IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.BitsPrintfArg IntegerDefined in base-4.23.0.0 · Text.PrintfNFData IntegerDefined in deepseq-1.5.2.0 · Control.DeepSeqPretty IntegerDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty IntegerDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary IntegerDefined in binary-0.8.9.3 · Data.Binary.ClassDayPeriod YearDefined in time-1.16.0.1 · Data.Time.Calendar.Gregorian · orphanShowPadded IntegerDefined in time-1.16.0.1 · Data.Time.Calendar.PrivateHpcHash IntegerDefined in hpc-0.7.0.2 · Trace.Hpc.UtilOutputable IntegerDefined in ghc-10.0.0.20260917 · GHC.Utils.OutputableBinary IntegerDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryToJExpr IntegerDefined in ghc-10.0.0.20260917 · GHC.JS.MakeLift IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.TH.Lift
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.
Instances50Monad, Functor, MonadFix, MonadFail, Applicative, Foldable, …
Monad MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.BaseFunctor MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonadFix MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FixMonadFail MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FailApplicative MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.BaseFoldable MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableTraversable MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableAlternative MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonadPlus MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.BaseMonadZip MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ZipEq1 MaybeDefined in base-4.23.0.0 · Data.Functor.ClassesOrd1 MaybeDefined in base-4.23.0.0 · Data.Functor.ClassesRead1 MaybeDefined in base-4.23.0.0 · Data.Functor.ClassesShow1 MaybeDefined in base-4.23.0.0 · Data.Functor.ClassesNFData1 MaybeDefined in deepseq-1.5.2.0 · Control.DeepSeqMonadThrow MaybeDefined in exceptions-0.10.12 · Control.Monad.CatchBinary OnDiskBytecodeLibDefined in ghc-10.0.0.20260917 · GHC.ByteCode.BinaryGeneric1 MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonadError () MaybeDefined in mtl-2.3.2 · Control.Monad.Error.ClassLift a => Lift (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftOutputableP env a => OutputableP env (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Utils.OutputableReifyFlag TyConBndrVis (Maybe BndrVis)Defined in ghc-10.0.0.20260917 · GHC.Tc.Gen.SpliceHasType namespace ty orig g => HasTypeProd namespace ty 'Nothing orig f gDefined in ghc-10.0.0.20260917 · GHC.Types.Error.CodesHasType namespace ty orig f => HasTypeProd namespace ty ('Just l) orig f gDefined in ghc-10.0.0.20260917 · GHC.Types.Error.CodesEq (DeBruijn a) => Eq (DeBruijn (Maybe a))Defined in ghc-10.0.0.20260917 · GHC.Core.Map.TypeEq a => Eq (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.MaybeData a => Data (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.DataOrd a => Ord (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.MaybeRead a => Read (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.ReadShow a => Show (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowGeneric (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup a => Semigroup (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseSemigroup a => Monoid (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseLift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup
Smay be turned into a monoid simply by adjoining an elementenot inSand defininge*e = eande*s = s = s*efor alls ∈ S."Since 4.11.0: constraint on inner
avalue generalised from Monoid to Semigroup.SingKind a => SingKind (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsNFData a => NFData (Maybe a)Defined in deepseq-1.5.2.0 · Control.DeepSeqPretty a => Pretty (Maybe a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty a => Pretty (Maybe a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary a => Binary (Maybe a)Defined in binary-0.8.9.3 · Data.Binary.ClassHasLoc a => HasLoc (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationNoAnn (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationOutputable a => Outputable (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Utils.OutputableBinary a => Binary (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Utils.BinaryToHie a => ToHie (Maybe a)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.AstSingI 'NothingDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsSingI a2 => SingI ('Just a2)Defined in ghc-internal-10.0.0 · GHC.Internal.Genericstype Rep (Maybe a) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Maybe"
"GHC.Internal.Maybe"
"ghc-internal"
'False) (C1 ('MetaCons"Nothing"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Just"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Maybe = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Maybe"
"GHC.Internal.Maybe"
"ghc-internal"
'False) (C1 ('MetaCons"Nothing"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Just"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))type DemoteRep (Maybe a) = Maybe (DemoteRep a)Defined in ghc-internal-10.0.0 · GHC.Internal.Genericsdata SingDefined in ghc-internal-10.0.0 · GHC.Internal.Genericstype Anno (Maybe Role) = EpAnnCODefined in ghc-10.0.0.20260917 · GHC.Hs.Decls · orphan
Instances32Bounded, Enum, Eq, Data, Ord, Read, …
Bounded BoolDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum BoolDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEq BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesData BoolDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataOrd BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesRead BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ReadShow BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ShowIx BoolDefined in ghc-internal-10.0.0 · GHC.Internal.IxGeneric BoolDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsBits BoolDefined in ghc-internal-10.0.0 · GHC.Internal.BitsInterpret Bool as 1-bit bit-field
FiniteBits BoolDefined in ghc-internal-10.0.0 · GHC.Internal.BitsStorable BoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.StorableSingKind BoolDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsNFData BoolDefined in deepseq-1.5.2.0 · Control.DeepSeqPretty BoolDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty BoolDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary BoolDefined in binary-0.8.9.3 · Data.Binary.ClassHpcHash BoolDefined in hpc-0.7.0.2 · Trace.Hpc.UtilNoAnn BoolDefined in ghc-10.0.0.20260917 · GHC.Parser.AnnotationOutputable BoolDefined in ghc-10.0.0.20260917 · GHC.Utils.OutputableBinary BoolDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryToJExpr BoolDefined in ghc-10.0.0.20260917 · GHC.JS.MakeLift BoolDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftSingI 'FalseDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsSingI 'TrueDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsIArray UArray BoolDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Bool IODefined in array-0.5.8.0 · Data.Array.IO.InternalsMArray (STUArray s) Bool (ST s)Defined in array-0.5.8.0 · Data.Array.Basetype Rep Bool = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Bool"
"GHC.Internal.Types"
"ghc-internal"
'False) (C1 ('MetaCons"False"
'PrefixI 'False) U1 :+: C1 ('MetaCons"True"
'PrefixI 'False) U1)type DemoteRep Bool = BoolDefined in ghc-internal-10.0.0 · GHC.Internal.Genericsdata SingDefined in ghc-internal-10.0.0 · GHC.Internal.Genericstype Anno Bool = EpAnnCODefined in ghc-10.0.0.20260917 · GHC.Hs.Decls · orphan
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 |
|---|---|---|
|
| null character |
|
| start of heading |
|
| start of text |
|
| end of text |
|
| end of transmission |
|
| enquiry |
|
| acknowledge |
|
,
| bell (alert) |
|
,
| backspace |
|
,
| horizontal tab |
|
,
| line feed (new line) |
|
,
| vertical tab |
|
,
| form feed |
|
,
| carriage return |
|
| shift out |
|
| shift in |
|
| data link escape |
|
| device control 1 |
|
| device control 2 |
|
| device control 3 |
|
| device control 4 |
|
| negative acknowledge |
|
| synchronous idle |
|
| end of transmission block |
|
| cancel |
|
| end of medium |
|
| substitute |
|
| escape |
|
| file separator |
|
| group separator |
|
| record separator |
|
| unit separator |
|
,
| space |
|
| delete |
Instances38Bounded, Enum, Data, Read, Ix, Storable, …
Bounded CharDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum CharDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEq CharDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesData CharDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataOrd CharDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesRead CharDefined in ghc-internal-10.0.0 · GHC.Internal.ReadShow CharDefined in ghc-internal-10.0.0 · GHC.Internal.ShowIx CharDefined in ghc-internal-10.0.0 · GHC.Internal.IxStorable CharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.StorableIsChar CharDefined in base-4.23.0.0 · Text.PrintfPrintfArg CharDefined in base-4.23.0.0 · Text.PrintfNFData CharDefined in deepseq-1.5.2.0 · Control.DeepSeqPretty CharDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty CharDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary CharDefined in binary-0.8.9.3 · Data.Binary.ClassHpcHash CharDefined in hpc-0.7.0.2 · Trace.Hpc.UtilBinary CharDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryToJExpr CharDefined in ghc-10.0.0.20260917 · GHC.JS.MakeHasChar CharDefined in ghc-10.0.0.20260917 · GHC.Parser.StringLift CharDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftTestCoercion SCharDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsTestEquality SCharDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsIArray UArray CharDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Char IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Char)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UCharDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UCharDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsMArray (STUArray s) Char (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Char)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsHasChar (Char, x)Defined in ghc-10.0.0.20260917 · GHC.Parser.StringEq (URec Char p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Char p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Char p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsGeneric (URec Char p)Defined in ghc-internal-10.0.0 · GHC.Internal.Genericstype Rep (URec Char p) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UChar"
'PrefixI 'True) (S1 ('MetaSel ('Just"uChar#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UChar))type Rep1 (URec Char) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UChar"
'PrefixI 'True) (S1 ('MetaSel ('Just"uChar#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UChar))type Compare a b = CmpChar a bDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.Orddata URec CharDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsUsed for marking occurrences of Char#
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.
Instances36Enum, Floating, Fractional, Data, Num, Read, …
Enum DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanfromEnum just truncates its argument, beware of all sorts of overflows.
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Example1 expression [0..1.5][0.0,1.0,2.0]
Eq DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesFloating DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.FloatFractional DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanThis 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-10.0.0 · GHC.Internal.Data.DataNum DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
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-internal-10.0.0 · GHC.Internal.ClassesIEEE 754 Double-precision type includes not only numbers, but also positive and negative infinities and a special element called
NaN(which can be quiet or signal).IEEE 754-2008, section 5.11 requires that if at least one of arguments of <=, <, >, >= is
NaNthen the result of the comparison is False, andinstanceOrd Double complies with this requirement. This violates the reflexivity: bothNaN<=NaNandNaN>=NaNare False.IEEE 754-2008, section 5.10 defines
totalOrderpredicate. Unfortunately, compare on Doubles violates the IEEE standard and does not define a total order. More specifically, both compareNaNxand comparexNaNalways return GT.Thus, users must be extremely cautious when using
instanceOrd 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 infp-ieeepackage asTotallyOrderednewtype.Moving further, the behaviour of min and max with regards to
NaNis also non-compliant. IEEE 754-2008, section 5.3.1 defines that quietNaNshould be treated as a missing data byminNumandmaxNumfunctions, for example,minNum(NaN, 1) = minNum(1, NaN) = 1. Some languages such as Java deviate from the standard implementingminNum(NaN, 1) = minNum(1, NaN) = NaN. However, min / max inbaseare even worse: minNaN1 is 1, but min 1NaNisNaN.IEEE 754-2008 compliant min / max can be found in
ieee754package underminNum/maxNumnames. Implementations compliant withminimumNumber/maximumNumberfrom a newer IEEE 754-2019, section 9.6 are available fromfp-ieeepackage.Read DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.ReadReal DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanRealFloat DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.FloatRealFrac DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanBeware 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-10.0.0 · GHC.Internal.Float · orphanStorable DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.StorablePrintfArg DoubleDefined in base-4.23.0.0 · Text.PrintfNFData DoubleDefined in deepseq-1.5.2.0 · Control.DeepSeqPretty DoubleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty DoubleDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary DoubleDefined in binary-0.8.9.3 · Data.Binary.ClassUses non-IEEE754 encoding. Does not round-trip NaN.
Outputable DoubleDefined in ghc-10.0.0.20260917 · GHC.Utils.OutputableBinary DoubleDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryToJExpr DoubleDefined in ghc-10.0.0.20260917 · GHC.JS.MakeLift DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftIArray UArray DoubleDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Double IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Double)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsMArray (STUArray s) Double (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Double)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec Double p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Double p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Double p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsGeneric (URec Double p)Defined in ghc-internal-10.0.0 · GHC.Internal.Genericstype Rep (URec Double p) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UDouble"
'PrefixI 'True) (S1 ('MetaSel ('Just"uDouble#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))type Rep1 (URec Double) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UDouble"
'PrefixI 'True) (S1 ('MetaSel ('Just"uDouble#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))data URec DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsUsed for marking occurrences of Double#
Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.
Instances35Enum, Floating, Fractional, Data, Num, Read, …
Enum FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanfromEnum just truncates its argument, beware of all sorts of overflows.
List generators have extremely peculiar behavior, mandated by Haskell Report 2010:
Example1 expression [0..1.5 :: Float][0.0,1.0,2.0]
Eq FloatDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesFloating FloatDefined in ghc-internal-10.0.0 · GHC.Internal.FloatFractional FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanThis 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-10.0.0 · GHC.Internal.Data.DataNum FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanThis instance implements IEEE 754 standard with all its usual pitfalls about NaN, infinities and negative zero. Neither addition nor multiplication are associative or distributive:
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-internal-10.0.0 · GHC.Internal.ClassesRead FloatDefined in ghc-internal-10.0.0 · GHC.Internal.ReadReal FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanRealFloat FloatDefined in ghc-internal-10.0.0 · GHC.Internal.FloatRealFrac FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanBeware 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-10.0.0 · GHC.Internal.Float · orphanStorable FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.StorablePrintfArg FloatDefined in base-4.23.0.0 · Text.PrintfNFData FloatDefined in deepseq-1.5.2.0 · Control.DeepSeqPretty FloatDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty FloatDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary FloatDefined in binary-0.8.9.3 · Data.Binary.ClassUses non-IEEE754 encoding. Does not round-trip NaN.
Outputable FloatDefined in ghc-10.0.0.20260917 · GHC.Utils.OutputableBinary FloatDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryLift FloatDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftIArray UArray FloatDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Float IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Float)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UFloatDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UFloatDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsMArray (STUArray s) Float (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Float)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec Float p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Float p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Float p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsGeneric (URec Float p)Defined in ghc-internal-10.0.0 · GHC.Internal.Genericstype Rep (URec Float p) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UFloat"
'PrefixI 'True) (S1 ('MetaSel ('Just"uFloat#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))type Rep1 (URec Float) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UFloat"
'PrefixI 'True) (S1 ('MetaSel ('Just"uFloat#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))data URec FloatDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsUsed for marking occurrences of Float#
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
Prelude.minBound and Prelude.maxBound from the Prelude.Bounded class.
Instances48Bounded, Enum, Integral, Data, Num, Read, …
Bounded IntDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum IntDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEq IntDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesIntegral IntDefined in ghc-internal-10.0.0 · GHC.Internal.RealData IntDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataNum IntDefined in ghc-internal-10.0.0 · GHC.Internal.NumOrd IntDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesRead IntDefined in ghc-internal-10.0.0 · GHC.Internal.ReadReal IntDefined in ghc-internal-10.0.0 · GHC.Internal.RealShow IntDefined in ghc-internal-10.0.0 · GHC.Internal.ShowIx IntDefined in ghc-internal-10.0.0 · GHC.Internal.IxBits IntDefined in ghc-internal-10.0.0 · GHC.Internal.BitsFiniteBits IntDefined in ghc-internal-10.0.0 · GHC.Internal.BitsStorable IntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.StorablePrintfArg IntDefined in base-4.23.0.0 · Text.PrintfNFData IntDefined in deepseq-1.5.2.0 · Control.DeepSeqPretty IntDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClassPretty IntDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClassBinary IntDefined in binary-0.8.9.3 · Data.Binary.ClassShowPadded IntDefined in time-1.16.0.1 · Data.Time.Calendar.PrivateHpcHash IntDefined in hpc-0.7.0.2 · Trace.Hpc.UtilOutputable IntDefined in ghc-10.0.0.20260917 · GHC.Utils.OutputableUniquable IntDefined in ghc-10.0.0.20260917 · GHC.Types.UniqueBinary IntDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryToJExpr IntDefined in ghc-10.0.0.20260917 · GHC.JS.MakeToJson IntDefined in ghc-10.0.0.20260917 · GHC.Utils.JsonLift IntDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftIArray UArray IntDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Int IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Int)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsFoldable UIntDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UIntDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsBinary (HieAST TypeIndex)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesBinary (HieASTs TypeIndex)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesBinary (HieArgs TypeIndex)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesBinary (HieType TypeIndex)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesBinary (IdentifierDetails TypeIndex)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesBinary (NodeInfo TypeIndex)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesBinary (SourcedNodeInfo TypeIndex)Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.TypesMArray (STUArray s) Int (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Int)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec Int p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Int p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Int p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsGeneric (URec Int p)Defined in ghc-internal-10.0.0 · GHC.Internal.Genericstype Rep (URec Int p) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UInt"
'PrefixI 'True) (S1 ('MetaSel ('Just"uInt#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UInt))type Rep1 (URec Int) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UInt"
'PrefixI 'True) (S1 ('MetaSel ('Just"uInt#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UInt))data URec IntDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsUsed for marking occurrences of Int#
Instances36Bounded, Enum, Integral, Data, Num, Read, …
Bounded WordDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum WordDefined in ghc-internal-10.0.0 · GHC.Internal.EnumEq WordDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesIntegral WordDefined in ghc-internal-10.0.0 · GHC.Internal.RealData WordDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataNum WordDefined in ghc-internal-10.0.0 · GHC.Internal.NumOrd WordDefined in ghc-internal-10.0.0 · GHC.Internal.ClassesRead WordDefined in ghc-internal-10.0.0 · GHC.Internal.ReadReal WordDefined in ghc-internal-10.0.0 · GHC.Internal.RealShow WordDefined in ghc-internal-10.0.0 · GHC.Internal.ShowIx WordDefined in ghc-internal-10.0.0 · GHC.Internal.IxBits WordDefined in ghc-internal-10.0.0 · GHC.Internal.BitsFiniteBits WordDefined in ghc-internal-10.0.0 · GHC.Internal.BitsStorable WordDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.StorablePrintfArg WordDefined in base-4.23.0.0 · Text.PrintfNFData WordDefined in deepseq-1.5.2.0 · Control.DeepSeqBinary WordDefined in binary-0.8.9.3 · Data.Binary.ClassOutputable WordDefined in ghc-10.0.0.20260917 · GHC.Utils.OutputableBinary WordDefined in ghc-10.0.0.20260917 · GHC.Utils.BinaryLift WordDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftIArray UArray WordDefined in array-0.5.8.0 · Data.Array.BaseMArray IOUArray Word IODefined in array-0.5.8.0 · Data.Array.IO.InternalsGeneric1 (URec Word)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (BCOByteArray Word)Defined in ghci-10.0.0.20260917 · GHCi.ResolvedBCOFoldable UWordDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UWordDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsBinary (BCOByteArray Word)Defined in ghci-10.0.0.20260917 · GHCi.ResolvedBCOMArray (STUArray s) Word (ST s)Defined in array-0.5.8.0 · Data.Array.BaseFunctor (URec Word)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsEq (URec Word p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsOrd (URec Word p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Word p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsGeneric (URec Word p)Defined in ghc-internal-10.0.0 · GHC.Internal.Genericstype Rep (URec Word p) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UWord"
'PrefixI 'True) (S1 ('MetaSel ('Just"uWord#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UWord))type Rep1 (URec Word) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UWord"
'PrefixI 'True) (S1 ('MetaSel ('Just"uWord#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UWord))data URec WordDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsUsed for marking occurrences of Word#
Lifted, homogeneous equality. By lifted, we mean that it
can be bogus (deferred type error). By homogeneous, the two
types a and b must have the same kinds.
A functor with application, providing operations to
A minimal complete definition must include implementations of pure and one of either <*> or liftA2. If it defines both, then they must behave the same as their default definitions:
(<*>) = liftA2 idliftA2 f x y = f Prelude.<$> x <*> yFurther, any definition must satisfy the following:
- 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 yit follows from the above that
liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g vIf f is also a Monad, it should satisfy
(which implies that pure and <*> satisfy the applicative functor laws).
Methods
pure :: a -> f aLift a value into the Structure.
Examples
Example1 expression pure 1 :: Maybe IntJust 1
Example1 expression pure 'z' :: [Char]"z"
Example1 expression pure (pure ":D") :: Maybe [String]Just [":D"]
(<*>) :: f (a -> b) -> f a -> f binfixl 4Sequential application.
A few functors support an implementation of <*> that is more efficient than the default one.
Example
Used in combination with
,(Data.Functor.<$>)can be used to build a record.(<*>)Example1 expression data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}Example3 expressions produceFoo :: Applicative f => f FooproduceBar :: Applicative f => f BarproduceBaz :: Applicative f => f Baz
Example2 expressions mkState :: Applicative f => f MyStatemkState = MyState <$> produceFoo <*> produceBar <*> produceBaz
liftA2 :: (a -> b -> c) -> f a -> f b -> f cLift a binary function to actions.
Some functors support an implementation of liftA2 that is more efficient than the default one. In particular, if fmap is an expensive operation, it is likely better to use liftA2 than to fmap over the structure and then use <*>.
This became a typeclass method in 4.10.0.0. Prior to that, it was a function defined in terms of <*> and fmap.
Example
Example1 expression liftA2 (,) (Just 3) (Just 5)Just (3,5)
Example1 expression liftA2 (+) [1, 2, 3] [4, 5, 6][5,6,7,6,7,8,7,8,9]
(*>) :: f a -> f b -> f binfixl 4Sequence actions, discarding the value of the first argument.
Examples
If used in conjunction with the Applicative instance for Maybe, you can chain Maybe computations, with a possible "early return" in case of Nothing.
Example1 expression Just 2 *> Just 3Just 3
Example1 expression Nothing *> Just 3Nothing
Of course a more interesting use case would be to have effectful computations instead of just returning pure values.
Example4 expressions import Data.Charimport GHC.Internal.Text.ParserCombinators.ReadPlet p = string "my name is " *> munch1 isAlpha <* eofreadP_to_S p "my name is Simon"[("Simon","")]
(<*) :: f a -> f b -> f ainfixl 4Sequence actions, discarding the value of the second argument.
Instances158Applicative, …
Applicative ComplexDefined in base-4.23.0.0 · Data.ComplexApplicative FirstDefined in base-4.23.0.0 · Data.SemigroupApplicative LastDefined in base-4.23.0.0 · Data.SemigroupApplicative MaxDefined in base-4.23.0.0 · Data.SemigroupApplicative MinDefined in base-4.23.0.0 · Data.SemigroupApplicative GetDefined in binary-0.8.9.3 · Data.Binary.Get.InternalApplicative PutMDefined in binary-0.8.9.3 · Data.Binary.PutApplicative PutDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.InternalApplicative SeqDefined in containers-0.8 · Data.Sequence.InternalApplicative TreeDefined in containers-0.8 · Data.TreeApplicative InspectAsmDefined in ghc-10.0.0.20260917 · GHC.ByteCode.AsmApplicative RunAsmDefined in ghc-10.0.0.20260917 · GHC.ByteCode.AsmApplicative CmmOptMDefined in ghc-10.0.0.20260917 · GHC.Cmm.GenericOptApplicative CmmLintDefined in ghc-10.0.0.20260917 · GHC.Cmm.LintApplicative PDDefined in ghc-10.0.0.20260917 · GHC.Cmm.Parser.MonadApplicative NatMDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.MonadApplicative WasmAsmMDefined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.AsmApplicative TEDefined in ghc-10.0.0.20260917 · GHC.CmmToCApplicative LlvmMDefined in ghc-10.0.0.20260917 · GHC.CmmToLlvm.BaseApplicative NormMDefined in ghc-10.0.0.20260917 · GHC.Core.FamInstEnvApplicative LintMDefined in ghc-10.0.0.20260917 · GHC.Core.LintApplicative RuleMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.ConstantFoldApplicative CoreMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.MonadApplicative SimplMDefined in ghc-10.0.0.20260917 · GHC.Core.Opt.Simplify.MonadApplicative UMDefined in ghc-10.0.0.20260917 · GHC.Core.UnifyApplicative UnifyResultMDefined in ghc-10.0.0.20260917 · GHC.Core.UnifyApplicative CtsMDefined in ghc-10.0.0.20260917 · GHC.CoreToStgApplicative NullCollapseVizDefined in ghc-10.0.0.20260917 · GHC.Data.Graph.CollapseApplicative InfiniteDefined in ghc-10.0.0.20260917 · GHC.Data.List.InfiniteApplicative PairDefined in ghc-10.0.0.20260917 · GHC.Data.PairApplicative MaybeDefined in ghc-10.0.0.20260917 · GHC.Data.StrictApplicative HscDefined in ghc-10.0.0.20260917 · GHC.Driver.Env.TypesApplicative GhcDefined in ghc-10.0.0.20260917 · GHC.Driver.MonadApplicative HookedUseDefined in ghc-10.0.0.20260917 · GHC.Driver.Pipeline.ExecuteApplicative MatchResultDefined in ghc-10.0.0.20260917 · GHC.HsToCore.MonadProduct is an "or" on fallibility---the combined match result is infallible only if the left and right argument match results both were.
This is useful for combining a bunch of alternatives together and then getting the overall fallibility of the entire group. See
mkDataConCasefor an example.Applicative TMDefined in ghc-10.0.0.20260917 · GHC.HsToCore.TicksApplicative DFFVDefined in ghc-10.0.0.20260917 · GHC.Iface.TidyApplicative PDefined in ghc-10.0.0.20260917 · GHC.Parser.LexerApplicative PVDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcessApplicative HdkADefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockApplicative HdkMDefined in ghc-10.0.0.20260917 · GHC.Parser.PostProcess.HaddockApplicative CpsRnDefined in ghc-10.0.0.20260917 · GHC.Rename.PatApplicative TPRnMDefined in ghc-10.0.0.20260917 · GHC.Rename.PatApplicative RMDefined in ghc-10.0.0.20260917 · GHC.Stg.EnforceEpt.RewriteApplicative LiftMDefined in ghc-10.0.0.20260917 · GHC.Stg.Lift.MonadApplicative LintMDefined in ghc-10.0.0.20260917 · GHC.Stg.LintApplicative StgMDefined in ghc-10.0.0.20260917 · GHC.Stg.PipelineApplicative BcMDefined in ghc-10.0.0.20260917 · GHC.StgToByteCodeApplicative CmmParseDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.ExtCodeApplicative FCodeDefined in ghc-10.0.0.20260917 · GHC.StgToCmm.MonadApplicative KindRepMDefined in ghc-10.0.0.20260917 · GHC.Tc.Instance.TypeableApplicative SolverStageDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.MonadApplicative TcSDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.MonadApplicative RewriteMDefined in ghc-10.0.0.20260917 · GHC.Tc.Solver.RewriteApplicative RoleMDefined in ghc-10.0.0.20260917 · GHC.Tc.TyCl.UtilsApplicative SynCycleMDefined in ghc-10.0.0.20260917 · GHC.Tc.TyCl.UtilsApplicative TcPluginMDefined in ghc-10.0.0.20260917 · GHC.Tc.TypesApplicative ZonkMDefined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.MonadApplicative UniqDSMDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSMApplicative UniqSMDefined in ghc-10.0.0.20260917 · GHC.Types.Unique.SupplyApplicative PprMDefined in ghc-boot-th-10.0.0.20260917 · GHC.Boot.TH.PprLibApplicative NonEmptyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.NonEmpty · orphanApplicative IdentityDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityApplicative FirstDefined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidApplicative LastDefined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidApplicative DownDefined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdApplicative DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalApplicative ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalApplicative SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalApplicative ZipListDefined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListf <$> ZipList xs1 <*> ... <*> ZipList xsN = ZipList (zipWithN f xs1 ... xsN)where
zipWithNrefers to thezipWithfunction of the appropriate arity (zipWith,zipWith3,zipWith4, ...). For example:(\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..] = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..]) = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}Applicative NoIODefined in ghc-internal-10.0.0 · GHC.Internal.GHCiApplicative Par1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsApplicative MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.BaseApplicative STMDefined in ghc-internal-10.0.0 · GHC.Internal.STMApplicative QDefined in ghc-internal-10.0.0 · GHC.Internal.TH.MonadApplicative PDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPApplicative ReadPDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPApplicative ReadPrecDefined in ghc-internal-10.0.0 · GHC.Internal.Text.ParserCombinators.ReadPrecApplicative SoloDefined in ghc-internal-10.0.0 · GHC.Internal.BaseApplicative IODefined in ghc-internal-10.0.0 · GHC.Internal.BaseApplicative MDefined in ghc-toolchain-0.1.0.0 · GHC.Toolchain.MonadApplicative GHCiQDefined in ghci-10.0.0.20260917 · GHCi.THApplicative STMDefined in stm-2.5.3.1 · Control.Sequential.STMApplicative []Defined in ghc-internal-10.0.0 · GHC.Internal.BaseApplicative ProxyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyApplicative U1Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsApplicative (State s)Defined in containers-0.8 · Utils.Containers.Internal.StateApplicative (RegM freeRegs)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Reg.Linear.StateApplicative (WasmCodeGenM w)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.Wasm.TypesApplicative (IOEnv m)Defined in ghc-10.0.0.20260917 · GHC.Data.IOEnvApplicative (MaybeErr err)Defined in ghc-10.0.0.20260917 · GHC.Data.MaybeApplicative (CmdLineP s)Defined in ghc-10.0.0.20260917 · GHC.Driver.SessionApplicative (PuResult a)Defined in ghc-10.0.0.20260917 · GHC.Tc.Utils.UnifyApplicative (ZonkBndrT m)Defined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.EnvApplicative (CvtM' err)Defined in ghc-10.0.0.20260917 · GHC.ThToHsApplicative (Codensity f)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.CodensityApplicative (State s)Defined in ghc-10.0.0.20260917 · GHC.Utils.Monad.State.StrictApplicative (ST s)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ST.Lazy.ImpApplicative (Either e)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.EitherApplicative (StateL s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsApplicative (StateR s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsApplicative (ST s)Defined in ghc-internal-10.0.0 · GHC.Internal.STApplicative (IParser t)Defined in text-2.1.4 · Data.Text.Internal.ReadApplicative f => Applicative (Lift f)Defined in transformers-0.6.3.0 · Control.Applicative.LiftA combination is Pure only if both parts are.
Applicative m => Applicative (GhcT m)Defined in ghc-10.0.0.20260917 · GHC.Driver.MonadApplicative m => Applicative (ZonkT m)Defined in ghc-10.0.0.20260917 · GHC.Tc.Zonk.EnvMonad m => Applicative (WrappedMonad m)Defined in base-4.23.0.0 · Control.ApplicativeMonad m => Applicative (CatchT m)Defined in exceptions-0.10.12 · Control.Monad.Catch.PureMonad m => Applicative (EwM m)Defined in ghc-10.0.0.20260917 · GHC.Driver.CmdLineMonad m => Applicative (UniqDSMT m)Defined in ghc-10.0.0.20260917 · GHC.Types.Unique.DSMMonoid a => Applicative (Tuple2 a)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseArrow a => Applicative (ArrowMonad a)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.Arrow(Functor m, Monad m) => Applicative (MaybeT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.MaybeApplicative (S z s)Defined in ghc-10.0.0.20260917 · GHC.CmmToAsm.CFG.DominatorsApplicative (Stream m a)Defined in ghc-10.0.0.20260917 · GHC.Data.StreamApplicative (t m) => Applicative (LiftingAccum t m)Defined in mtl-2.3.2 · Control.Monad.AccumApplicative (t m) => Applicative (LiftingSelect t m)Defined in mtl-2.3.2 · Control.Monad.SelectApplicative f => Applicative (Ap f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidApplicative f => Applicative (Alt f)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalApplicative f => Applicative (Rec1 f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsApplicative f => Applicative (Backwards f)Defined in transformers-0.6.3.0 · Control.Applicative.BackwardsApply
f-actions in the reverse order.Applicative f => Applicative (Reverse f)Defined in transformers-0.6.3.0 · Data.Functor.ReverseDerived instance.
Applicative m => Applicative (Kleisli m a)Defined in ghc-internal-10.0.0 · GHC.Internal.Control.ArrowApplicative m => Applicative (IdentityT m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.IdentityApplicative m => Applicative (ReaderT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ReaderMonad m => Applicative (StreamS m a)Defined in ghc-10.0.0.20260917 · GHC.Data.StreamMonad m => Applicative (StateT s m)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.UtilsMonoid a => Applicative (Constant a)Defined in transformers-0.6.3.0 · Data.Functor.ConstantMonoid m => Applicative (Const m)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.ConstArrow a => Applicative (WrappedArrow a b)Defined in base-4.23.0.0 · Control.Applicative(Applicative f, Monad f) => Applicative (WhenMissing f x)Defined in containers-0.8 · Data.IntMap.InternalEquivalent to
ReaderT k (ReaderT x (MaybeT f)).(Applicative f, Monad f) => Applicative (WhenMissing f x)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalEquivalent to
ReaderT k (ReaderT x (MaybeT f)).(Functor m, Monad m) => Applicative (ExceptT e m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Except(Functor m, Monad m) => Applicative (SelectT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Select(Functor m, Monad m) => Applicative (StateT s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.State.Lazy(Functor m, Monad m) => Applicative (StateT s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.State.Strict(Functor m, Monad m) => Applicative (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.CPS(Monoid a, Monoid b) => Applicative (Tuple3 a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Base(Monoid w, Applicative m) => Applicative (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Lazy(Monoid w, Applicative m) => Applicative (WriterT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Writer.Strict(Monoid w, Functor m, Monad m) => Applicative (AccumT w m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.Accum(Generic1 f, Applicative (Rep1 f)) => Applicative (Generically1 f)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsApplicative (ContT r m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.ContApplicative ((->) r)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseMonoid c => Applicative (K1 i c)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Applicative f, Applicative g) => Applicative (Product f g)Defined in base-4.23.0.0 · Data.Functor.Product(Applicative f, Applicative g) => Applicative (f :*: g)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Applicative f, Monad f) => Applicative (WhenMissing f k x)Defined in containers-0.8 · Data.Map.InternalEquivalent to
ReaderT k (ReaderT x (MaybeT f)).(Monad f, Applicative f) => Applicative (WhenMatched f x y)Defined in containers-0.8 · Data.IntMap.InternalEquivalent to
ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))(Monad f, Applicative f) => Applicative (WhenMatched f x y)Defined in ghc-10.0.0.20260917 · GHC.Data.Word64Map.InternalEquivalent to
ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))(Monoid a, Monoid b, Monoid c) => Applicative (Tuple4 a b c)Defined in ghc-internal-10.0.0 · GHC.Internal.BaseApplicative f => Applicative (M1 i c f)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Applicative f, Applicative g) => Applicative (Compose f g)Defined in base-4.23.0.0 · Data.Functor.Compose(Applicative f, Applicative g) => Applicative (f :.: g)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Functor m, Monad m) => Applicative (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.CPS(Monad f, Applicative f) => Applicative (WhenMatched f k x y)Defined in containers-0.8 · Data.Map.InternalEquivalent to
ReaderT k (ReaderT x (ReaderT y (MaybeT f)))(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.Lazy(Monoid w, Functor m, Monad m) => Applicative (RWST r w s m)Defined in transformers-0.6.3.0 · Control.Monad.Trans.RWS.Strict
Default implementation for popCount.
This implementation is intentionally naive. Instances are expected to provide an optimized implementation for their size.
Default implementation for testBit.
Note that: testBitDefault x i = (x .&. bit i) /= 0
Attempt to convert an Integral type a to an Integral type b using
the size of the types as measured by Bits methods.
A simpler version of this function is:
toIntegral :: (Integral a, Integral b) => a -> Maybe b
toIntegral x
| toInteger x == toInteger y = Just y
| otherwise = Nothing
where
y = fromIntegral xThis version requires going through Integer, which can be inefficient.
However, toIntegralSized is optimized to allow GHC to statically determine
the relative type sizes (as measured by bitSizeMaybe and isSigned) and
avoid going through Integer for many types. (The implementation uses
fromIntegral, which is itself optimized with rules for base types but may
go through Integer for some type pairs.)
The Bits class defines bitwise operations over integral types.
Bits are numbered from 0 with bit 0 being the least significant bit.
Methods
(.&.) :: a -> a -> ainfixl 7Bitwise "and"
(.|.) :: a -> a -> ainfixl 5Bitwise "or"
xor :: a -> a -> ainfixl 6Bitwise "xor"
complement :: a -> aReverse all the bits in the argument
shift :: a -> Int -> ainfixl 8shift x ishiftsxleft byibits ifiis positive, or right by-ibits otherwise. Right shifts perform sign extension on signed number types; i.e. they fill the top bits with 1 if thexis negative and with 0 otherwise.An instance can define either this unified shift or shiftL and shiftR, depending on which is more convenient for the type in question.
rotate :: a -> Int -> ainfixl 8zeroBits :: azeroBits is the value with all bits unset.
The following laws ought to hold (for all valid bit indices
n):clearBit zeroBits n == zeroBitssetBit zeroBits n == bit ntestBit zeroBits n == FalsepopCount zeroBits == 0
This method uses
clearBit (bit 0) 0as its default implementation (which ought to be equivalent to zeroBits for types which possess a 0th bit).complementBit :: a -> Int -> ax `complementBit` iis the same asx `xor` bit itestBit :: a -> Int -> Boolx `testBit` iis the same asx .&. bit n /= 0In other words it returns True if the bit at offset @n is set.
Can be implemented using
testBitDefaultifais also an instance of Num.bitSizeMaybe :: a -> Maybe IntReturn the number of bits in the type of the argument. The actual value of the argument is ignored. Returns Nothing for types that do not have a fixed bitsize, like Integer.
bitSize :: a -> IntReturn the number of bits in the type of the argument. The actual value of the argument is ignored. The function bitSize is undefined for types that do not have a fixed bitsize, like Integer.
Default implementation based upon bitSizeMaybe provided since 4.12.0.0.
isSigned :: a -> BoolReturn True if the argument is a signed type. The actual value of the argument is ignored
unsafeShiftL :: a -> Int -> aunsafeShiftR :: a -> Int -> aShift the first argument right by the specified number of bits, which must be non-negative and smaller than the number of bits in the type.
Right shifts perform sign extension on signed number types; i.e. they fill the top bits with 1 if the
xis negative and with 0 otherwise.Defaults to shiftR unless defined explicitly by an instance.
rotateL :: a -> Int -> ainfixl 8rotateR :: a -> Int -> ainfixl 8popCount :: a -> IntReturn the number of set bits in the argument. This number is known as the population count or the Hamming weight.
Can be implemented using
popCountDefaultifais also an instance of Num.
Instances70Bits, …
Bits RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesBits StgWordDefined in ghc-10.0.0.20260917 · GHC.Runtime.Heap.LayoutBits IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.BitsBits NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.BitsBits EventTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollBits EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.PollBits CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesBits IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrBits WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrBits Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntBits Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntBits Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntBits Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntBits CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesBits BoolDefined in ghc-internal-10.0.0 · GHC.Internal.BitsInterpret Bool as 1-bit bit-field
Bits IntDefined in ghc-internal-10.0.0 · GHC.Internal.BitsBits WordDefined in ghc-internal-10.0.0 · GHC.Internal.BitsBits Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordBits Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordBits Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordBits Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordBits CAttributesDefined in unix-2.8.8.0 · System.Posix.Files.CommonBits StatxFlagsDefined in unix-2.8.8.0 · System.Posix.Files.CommonBits StatxMaskDefined in unix-2.8.8.0 · System.Posix.Files.CommonBits a => Bits (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBits a => Bits (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBits a => Bits (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBits a => Bits (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsBits a => Bits (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityBits a => Bits (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdBits a => Bits (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.Const
The FiniteBits class denotes types with a finite, fixed number of bits.
Methods
finiteBitSize :: b -> IntReturn the number of bits in the type of the argument. The actual value of the argument is ignored. Moreover, finiteBitSize is total, in contrast to the deprecated bitSize function it replaces.
finiteBitSize = bitSize bitSizeMaybe = Just . finiteBitSizecountLeadingZeros :: b -> IntCount number of zero bits preceding the most significant set bit.
countLeadingZeros (zeroBits :: a) = finiteBitSize (zeroBits :: a)countLeadingZeros can be used to compute log base 2 via
logBase2 x = finiteBitSize x - 1 - countLeadingZeros xNote: The default implementation for this method is intentionally naive. However, the instances provided for the primitive integral types are implemented using CPU specific machine instructions.
countTrailingZeros :: b -> IntCount number of zero bits following the least significant set bit.
countTrailingZeros (zeroBits :: a) = finiteBitSize (zeroBits :: a) countTrailingZeros . negate = countTrailingZerosThe related find-first-set operation can be expressed in terms of countTrailingZeros as follows
findFirstSet x = 1 + countTrailingZeros xNote: The default implementation for this method is intentionally naive. However, the instances provided for the primitive integral types are implemented using CPU specific machine instructions.
Instances64FiniteBits, …
FiniteBits RegBitmapDefined in ghc-10.0.0.20260917 · GHC.ByteCode.TypesFiniteBits EventTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollFiniteBits EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.PollFiniteBits CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesFiniteBits IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrFiniteBits WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrFiniteBits Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntFiniteBits Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntFiniteBits Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntFiniteBits Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntFiniteBits CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesFiniteBits BoolDefined in ghc-internal-10.0.0 · GHC.Internal.BitsFiniteBits IntDefined in ghc-internal-10.0.0 · GHC.Internal.BitsFiniteBits WordDefined in ghc-internal-10.0.0 · GHC.Internal.BitsFiniteBits Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordFiniteBits Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordFiniteBits Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordFiniteBits Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordFiniteBits a => FiniteBits (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsFiniteBits a => FiniteBits (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsFiniteBits a => FiniteBits (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsFiniteBits a => FiniteBits (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsFiniteBits a => FiniteBits (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityFiniteBits a => FiniteBits (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdFiniteBits a => FiniteBits (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.Const
The genericLength function defined in base can't be specialised due to the
NOINLINE pragma.
It is also not strict in the accumulator, and strictGenericLength is not exported.
See #25706 for why it is important to use a strict, specialised version.