Modulelinear-base-0.8.1
Prelude.Linear
- 28 types
- 28 classes
- 139 values
- Packagelinear-base-0.8.1
- Exports196
- LicenceMIT
- SourceBase.hs
until p f yields the result of applying f until p holds.
\mathcal{O}(n). The insert function takes an element and a list and
inserts the element into the list at the first position where it is less than
or equal to the next element. In particular, if the list is sorted before the
call, the result will also be sorted. It is a special case of insertBy,
which allows the programmer to supply their own comparison function.
Examples
insert (-1) [1, 2, 3][-1,1,2,3]
insert 'd' "abcefg""abcdefg"
insert 4 [1, 2, 3, 5, 6, 7][1,2,3,4,5,6,7]
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"]
The sort function implements a stable sorting algorithm. It is a special case of sortBy, which allows the programmer to supply their own comparison function.
Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input.
The argument must be finite.
Examples
sort [1,6,4,3,2,5][1,2,3,4,5,6]
sort "haskell""aehklls"
import Data.Semigroup(Arg(..))sort [Arg ":)" 0, Arg ":D" 0, Arg ":)" 1, Arg ":3" 0, Arg ":D" 1][Arg ":)" 0,Arg ":)" 1,Arg ":3" 0,Arg ":D" 0,Arg ":D" 1]
Sort a list by comparing the results of a key function applied to each
element. sortOn f is equivalent to sortBy (, but has the
performance advantage of only evaluating comparing f)f once for each element in the
input list. This is called the decorate-sort-undecorate paradigm, or
Schwartzian transform.
Elements are arranged from lowest to highest, keeping duplicates in the order they appeared in the input.
The argument must be finite.
Examples
sortOn fst [(2, "world"), (4, "!"), (1, "Hello")][(1,"Hello"),(2,"world"),(4,"!")]
sortOn length ["jim", "creed", "pam", "michael", "dwight", "kevin"]["jim","pam","creed","kevin","dwight","michael"]
Performance notes
This function minimises the projections performed, by materialising the projections in an intermediate list.
For trivial projections, you should prefer using sortBy with
comparing, for example:
sortBy (comparing fst) [(3, 1), (2, 2), (1, 3)][(1,3),(2,2),(3,1)]
Or, for the exact same API as sortOn, you can use `sortBy . comparing`:
(sortBy . comparing) fst [(3, 1), (2, 2), (1, 3)][(1,3),(2,2),(3,1)]
However, sortOn may still be faster for instances with a more efficient
implementation of (>) than compare.
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"]
Extract the first component of a pair.
Extract the second component of a pair.
error stops execution and displays an error message.
A variant of error that does not produce a stack trace.
This is a partial function, it throws an error on empty lists. Use pattern matching, Data.List.uncons or listToMaybe instead. Consider refactoring to use Data.List.NonEmpty.
\mathcal{O}(1). Extract the first element of a list, which must be non-empty.
To disable the warning about partiality put {-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-}
at the top of the file. To disable it throughout a package put the same
options into ghc-options section of Cabal file. To disable it in GHCi
put :set -Wno-x-partial -Wno-unrecognised-warning-flags into ~/.ghci config file.
See also the migration guide.
Examples
head [1, 2, 3]1
head [1..]1
head []*** Exception: Prelude.head: empty list
This is a partial function, it throws an error on empty lists. Use Data.List.unsnoc instead. Consider refactoring to use Data.List.NonEmpty.
\mathcal{O}(n). Return all the elements of a list except the last one.
The list must be non-empty.
To disable the warning about partiality put
{-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-}
at the top of the file. To disable it throughout a package put the same
options into ghc-options section of Cabal file. To disable it in GHCi
put :set -Wno-x-partial -Wno-unrecognised-warning-flags into ~/.ghci
config file. See also the
migration guide.
Examples
init [1, 2, 3][1,2]
init [1][]
init []*** Exception: Prelude.init: empty list
This is a partial function, it throws an error on empty lists. Use Data.List.unsnoc instead. Consider refactoring to use Data.List.NonEmpty.
\mathcal{O}(n). Extract the last element of a list, which must be
finite and non-empty.
To disable the warning about partiality put
{-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-}
at the top of the file. To disable it throughout a package put the same
options into ghc-options section of Cabal file. To disable it in GHCi
put :set -Wno-x-partial -Wno-unrecognised-warning-flags into ~/.ghci
config file. See also the
migration guide.
Examples
last [1, 2, 3]3
last [1..]* Hangs forever *
last []*** Exception: Prelude.last: empty list
\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"
This is a partial function, it throws an error on empty lists. Replace it with drop 1, or use pattern matching or Data.List.uncons instead. Consider refactoring to use Data.List.NonEmpty.
\mathcal{O}(1). Extract the elements after the head of a list, which
must be non-empty.
To disable the warning about partiality put {-# OPTIONS_GHC -Wno-x-partial -Wno-unrecognised-warning-flags #-}
at the top of the file. To disable it throughout a package put the same
options into ghc-options section of Cabal file. To disable it in GHCi
put :set -Wno-x-partial -Wno-unrecognised-warning-flags into ~/.ghci config file.
See also the migration guide.
Examples
tail [1, 2, 3][2,3]
tail [1][]
tail []*** Exception: Prelude.tail: empty list
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.
Deprecated. The result cannot be consumed linearly, so this function is not useful.
Deprecated. The result cannot be consumed linearly, so this function is not useful.
Deprecated. The result cannot be consumed linearly, so this function is not useful.
Beware that Data.Semigroup.First is different from
Data.Monoid.First. The former simply returns the first value,
so Data.Semigroup.First Nothing <> x = Data.Semigroup.First Nothing.
The latter returns the first non-Nothing,
thus Data.Monoid.First Nothing <> x = x.
Examples
First 0 <> First 10First {getFirst = 0}
sconcat $ First 1 :| [ First n | n <- [2 ..] ]First {getFirst = 1}
Instances38Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
Monad FirstDefined in base-4.23.0.0 · Data.SemigroupFunctor FirstDefined in base-4.23.0.0 · Data.SemigroupMonadFix FirstDefined in base-4.23.0.0 · Data.SemigroupApplicative FirstDefined in base-4.23.0.0 · Data.SemigroupFoldable FirstDefined in base-4.23.0.0 · Data.SemigroupTraversable FirstDefined in base-4.23.0.0 · Data.SemigroupFoldable1 FirstDefined in base-4.23.0.0 · Data.Foldable1NFData1 FirstDefined in deepseq-1.5.2.0 · Control.DeepSeqGeneric1 FirstDefined in base-4.23.0.0 · Data.SemigroupGeneric1 FirstDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanUnbox a => MVector MVector (First a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseUnbox a => Vector Vector (First a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseBounded a => Bounded (First a)Defined in base-4.23.0.0 · Data.SemigroupEnum a => Enum (First a)Defined in base-4.23.0.0 · Data.SemigroupEq a => Eq (First a)Defined in base-4.23.0.0 · Data.SemigroupData a => Data (First a)Defined in base-4.23.0.0 · Data.SemigroupOrd a => Ord (First a)Defined in base-4.23.0.0 · Data.SemigroupRead a => Read (First a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (First a)Defined in base-4.23.0.0 · Data.SemigroupGeneric (First a)Defined in base-4.23.0.0 · Data.SemigroupSemigroup (First a)Defined in base-4.23.0.0 · Data.SemigroupNFData a => NFData (First a)Defined in deepseq-1.5.2.0 · Control.DeepSeqArbitrary a => Arbitrary (First a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary a => CoArbitrary (First a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction a => Function (First a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary a => Binary (First a)Defined in binary-0.8.9.3 · Data.Binary.ClassHashable a => Hashable (First a)Defined in hashable-1.5.1.0 · Data.Hashable.ClassPrim a => Prim (First a)Defined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox a => Unbox (First a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric (First a)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanConsumable a => Consumable (First a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Semigroup (First a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigrouptype Rep (First a) = D1 ('MetaDataDefined in base-4.23.0.0 · Data.Semigroup"First"
"Data.Semigroup"
"base-4.23.0.0-3279"
'True) (C1 ('MetaCons"First"
'PrefixI 'True) (S1 ('MetaSel ('Just"getFirst"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 First = D1 ('MetaDataDefined in base-4.23.0.0 · Data.Semigroup"First"
"Data.Semigroup"
"base-4.23.0.0-3279"
'True) (C1 ('MetaCons"First"
'PrefixI 'True) (S1 ('MetaSel ('Just"getFirst"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))data MVector s (First a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector (First a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep (First a) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"First"
"Data.Semigroup"
"base-4.23.0.0-3279"
'True) (C1 ('MetaCons"First"
'PrefixI 'True) (S1 ('MetaSel ('Just"getFirst"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 First = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"First"
"Data.Semigroup"
"base-4.23.0.0-3279"
'True) (C1 ('MetaCons"First"
'PrefixI 'True) (S1 ('MetaSel ('Just"getFirst"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
Beware that Data.Semigroup.Last is different from
Data.Monoid.Last. The former simply returns the last value,
so x <> Data.Semigroup.Last Nothing = Data.Semigroup.Last Nothing.
The latter returns the last non-Nothing,
thus x <> Data.Monoid.Last Nothing = x.
Examples
Last 0 <> Last 10Last {getLast = 10}
sconcat $ Last 1 :| [ Last n | n <- [2..]]* Hangs forever *
Instances38Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
Monad LastDefined in base-4.23.0.0 · Data.SemigroupFunctor LastDefined in base-4.23.0.0 · Data.SemigroupMonadFix LastDefined in base-4.23.0.0 · Data.SemigroupApplicative LastDefined in base-4.23.0.0 · Data.SemigroupFoldable LastDefined in base-4.23.0.0 · Data.SemigroupTraversable LastDefined in base-4.23.0.0 · Data.SemigroupFoldable1 LastDefined in base-4.23.0.0 · Data.Foldable1NFData1 LastDefined in deepseq-1.5.2.0 · Control.DeepSeqGeneric1 LastDefined in base-4.23.0.0 · Data.SemigroupGeneric1 LastDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanUnbox a => MVector MVector (Last a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseUnbox a => Vector Vector (Last a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseBounded a => Bounded (Last a)Defined in base-4.23.0.0 · Data.SemigroupEnum a => Enum (Last a)Defined in base-4.23.0.0 · Data.SemigroupEq a => Eq (Last a)Defined in base-4.23.0.0 · Data.SemigroupData a => Data (Last a)Defined in base-4.23.0.0 · Data.SemigroupOrd a => Ord (Last a)Defined in base-4.23.0.0 · Data.SemigroupRead a => Read (Last a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (Last a)Defined in base-4.23.0.0 · Data.SemigroupGeneric (Last a)Defined in base-4.23.0.0 · Data.SemigroupSemigroup (Last a)Defined in base-4.23.0.0 · Data.SemigroupNFData a => NFData (Last a)Defined in deepseq-1.5.2.0 · Control.DeepSeqArbitrary a => Arbitrary (Last a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary a => CoArbitrary (Last a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction a => Function (Last a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary a => Binary (Last a)Defined in binary-0.8.9.3 · Data.Binary.ClassHashable a => Hashable (Last a)Defined in hashable-1.5.1.0 · Data.Hashable.ClassPrim a => Prim (Last a)Defined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox a => Unbox (Last a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric (Last a)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanConsumable a => Consumable (Last a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Semigroup (Last a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigrouptype Rep (Last a) = D1 ('MetaDataDefined in base-4.23.0.0 · Data.Semigroup"Last"
"Data.Semigroup"
"base-4.23.0.0-3279"
'True) (C1 ('MetaCons"Last"
'PrefixI 'True) (S1 ('MetaSel ('Just"getLast"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Last = D1 ('MetaDataDefined in base-4.23.0.0 · Data.Semigroup"Last"
"Data.Semigroup"
"base-4.23.0.0-3279"
'True) (C1 ('MetaCons"Last"
'PrefixI 'True) (S1 ('MetaSel ('Just"getLast"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))data MVector s (Last a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector (Last a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep (Last a) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Last"
"Data.Semigroup"
"base-4.23.0.0-3279"
'True) (C1 ('MetaCons"Last"
'PrefixI 'True) (S1 ('MetaSel ('Just"getLast"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Last = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Last"
"Data.Semigroup"
"base-4.23.0.0-3279"
'True) (C1 ('MetaCons"Last"
'PrefixI 'True) (S1 ('MetaSel ('Just"getLast"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
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"
Instances73Bifoldable, Bifoldable1, Bitraversable, Eq2, Ord2, Read2, …
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.DeepSeqArbitrary2 EitherDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryHashable2 EitherDefined in hashable-1.5.1.0 · Data.Hashable.ClassBifunctor EitherDefined in linear-base-0.8.1 · Data.Bifunctor.Linear.Internal.BifunctorSymmetricMonoidal Either VoidDefined in linear-base-0.8.1 · Data.Bifunctor.Linear.Internal.SymmetricMonoidalApplicative f => Strong Either Void (Kleisli f)Defined in linear-base-0.8.1 · Data.Profunctor.LinearApplicative f => Strong Either Void (Kleisli f)Defined in linear-base-0.8.1 · Data.Profunctor.Kleisli.LinearStrong Either Void (CoKleisli (Const x))Defined in linear-base-0.8.1 · Data.Profunctor.Kleisli.LinearFunctor f => Monoidal Either Void (Kleisli f)Defined in linear-base-0.8.1 · Data.Profunctor.LinearFunctor f => Monoidal Either Void (Kleisli f)Defined in linear-base-0.8.1 · Data.Profunctor.Kleisli.LinearStrong Either Void (->)Defined in linear-base-0.8.1 · Data.Profunctor.LinearStrong Either Void (Market a b)Defined in linear-base-0.8.1 · Data.Profunctor.LinearMonoidal Either Void (->)Defined in linear-base-0.8.1 · Data.Profunctor.LinearStrong Either Void (FUN 'One)Defined in linear-base-0.8.1 · Data.Profunctor.LinearMonoidal Either Void (FUN 'One)Defined in linear-base-0.8.1 · Data.Profunctor.LinearGeneric1 (Either a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonadError e (Either e)Defined in mtl-2.3.2 · Control.Monad.Error.ClassGeneric1 (Either a)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan(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.DeepSeqArbitrary a => Arbitrary1 (Either a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrarye ~ 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.CatchHashable a => Hashable1 (Either a)Defined in hashable-1.5.1.0 · Data.Hashable.ClassFunctor (Either e)Defined in linear-base-0.8.1 · Data.Functor.Linear.Internal.FunctorTraversable (Either a)Defined in linear-base-0.8.1 · Data.Functor.Linear.Internal.Traversable(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(Finite a, Finite b) => Finite (Either a b)Defined in random-1.3.1 · System.Random.GFinite(Finite a, Uniform a, Finite b, Uniform b) => Uniform (Either a b)Defined in random-1.3.1 · System.Random.Internal(Arbitrary a, Arbitrary b) => Arbitrary (Either a b)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary(CoArbitrary a, CoArbitrary b) => CoArbitrary (Either a b)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary(Function a, Function b) => Function (Either a b)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function(Binary a, Binary b) => Binary (Either a b)Defined in binary-0.8.9.3 · Data.Binary.Class(Hashable a, Hashable b) => Hashable (Either a b)Defined in hashable-1.5.1.0 · Data.Hashable.ClassGeneric (Either a b)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan(Consumable e, Consumable a) => Consumable (Either e a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable(Dupable a, Dupable b) => Dupable (Either a b)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable(Movable a, Movable b) => Movable (Either a b)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable(Consumable a, Consumable b) => Semigroup (Either a b)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Consumable a, Consumable b, Eq a, Eq b) => Eq (Either a b)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Consumable a, Consumable b, Ord a, Ord b) => Ord (Either a b)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ordtype 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))type Rep (Either a b) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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 linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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))
Test whether the structure is empty. The default implementation is Left-associative and lazy in both the initial element and the accumulator. Thus optimised for structures where the first element can be accessed in constant time. Structures where this is not the case should have a non-default implementation.
Examples
Basic usage:
null []True
null [1]False
null is expected to terminate even for infinite structures. The default implementation terminates provided the structure is bounded on the left (there is a leftmost element).
null [1..]False
Boolean monoid under conjunction (&&).
All x <> All y = All (x && y)Examples
All True <> mempty <> All False)All {getAll = False}
mconcat (map (\x -> All (even x)) [2,4,6,7,8])All {getAll = False}
All True <> memptyAll {getAll = True}
Instances27Bounded, Eq, Data, Ord, Read, Show, …
Bounded AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalData AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataOrd AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalGeneric AllDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonoid AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNFData AllDefined in deepseq-1.5.2.0 · Control.DeepSeqArbitrary AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary AllDefined in binary-0.8.9.3 · Data.Binary.ClassUnbox AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric AllDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanMonoid AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidConsumable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableSemigroup AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupMVector MVector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseVector Vector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep All = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"All"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"All"
'PrefixI 'True) (S1 ('MetaSel ('Just"getAll"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))data MVector s AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep All = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"All"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"All"
'PrefixI 'True) (S1 ('MetaSel ('Just"getAll"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))
Boolean monoid under disjunction (||).
Any x <> Any y = Any (x || y)Examples
Any True <> mempty <> Any FalseAny {getAny = True}
mconcat (map (\x -> Any (even x)) [2,4,6,7,8])Any {getAny = True}
Any False <> memptyAny {getAny = False}
Instances27Bounded, Eq, Data, Ord, Read, Show, …
Bounded AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalData AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataOrd AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalGeneric AnyDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonoid AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNFData AnyDefined in deepseq-1.5.2.0 · Control.DeepSeqArbitrary AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary AnyDefined in binary-0.8.9.3 · Data.Binary.ClassUnbox AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric AnyDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanMonoid AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidConsumable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableSemigroup AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupMVector MVector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseVector Vector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep Any = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Any"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Any"
'PrefixI 'True) (S1 ('MetaSel ('Just"getAny"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))data MVector s AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep Any = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Any"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Any"
'PrefixI 'True) (S1 ('MetaSel ('Just"getAny"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))
The dual of a Monoid, obtained by swapping the arguments of (<>).
Dual a <> Dual b == Dual (b <> a)Examples
Dual "Hello" <> Dual "World"Dual {getDual = "WorldHello"}
Dual (Dual "Hello") <> Dual (Dual "World")Dual {getDual = Dual {getDual = "HelloWorld"}}
Instances39Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
Monad DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFunctor DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonadFix DualDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FixApplicative DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFoldable DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableTraversable DualDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableMonadZip DualDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ZipFoldable1 DualDefined in base-4.23.0.0 · Data.Foldable1NFData1 DualDefined in deepseq-1.5.2.0 · Control.DeepSeqGeneric1 DualDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsGeneric1 DualDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanUnbox a => MVector MVector (Dual a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseUnbox a => Vector Vector (Dual a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseBounded a => Bounded (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalEq a => Eq (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalData a => Data (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.DataOrd a => Ord (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalRead a => Read (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalGeneric (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsSemigroup a => Semigroup (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonoid a => Monoid (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNFData a => NFData (Dual a)Defined in deepseq-1.5.2.0 · Control.DeepSeqArbitrary a => Arbitrary (Dual a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary a => CoArbitrary (Dual a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction a => Function (Dual a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary a => Binary (Dual a)Defined in binary-0.8.9.3 · Data.Binary.ClassPrim a => Prim (Dual a)Defined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox a => Unbox (Dual a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric (Dual a)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanMonoid a => Monoid (Dual a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidConsumable a => Consumable (Dual a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableSemigroup a => Semigroup (Dual a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigrouptype Rep (Dual a) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Dual"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Dual"
'PrefixI 'True) (S1 ('MetaSel ('Just"getDual"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Dual = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Dual"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Dual"
'PrefixI 'True) (S1 ('MetaSel ('Just"getDual"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))data MVector s (Dual a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector (Dual a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep (Dual a) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Dual"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Dual"
'PrefixI 'True) (S1 ('MetaSel ('Just"getDual"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Dual = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Dual"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Dual"
'PrefixI 'True) (S1 ('MetaSel ('Just"getDual"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
Monoid under multiplication.
Product x <> Product y == Product (x * y)Examples
Product 3 <> Product 4 <> memptyProduct {getProduct = 12}
mconcat [ Product n | n <- [2 .. 10]]Product {getProduct = 3628800}
Constructors
ProductgetProduct :: a
Instances42Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
Monad ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFunctor ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonadFix ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FixApplicative ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFoldable ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableTraversable ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableMonadZip ProductDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ZipFoldable1 ProductDefined in base-4.23.0.0 · Data.Foldable1NFData1 ProductDefined in deepseq-1.5.2.0 · Control.DeepSeqGeneric1 ProductDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsGeneric1 ProductDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanUnbox a => MVector MVector (Product a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseUnbox a => Vector Vector (Product a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseBounded a => Bounded (Product 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.InternalData a => Data (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.DataNum a => Num (Product 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.InternalRead a => Read (Product 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.InternalGeneric (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsNum a => Semigroup (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNum a => Monoid (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalNFData a => NFData (Product a)Defined in deepseq-1.5.2.0 · Control.DeepSeqArbitrary a => Arbitrary (Product a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary a => CoArbitrary (Product a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction a => Function (Product a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary a => Binary (Product a)Defined in binary-0.8.9.3 · Data.Binary.ClassPrim a => Prim (Product a)Defined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox a => Unbox (Product a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric (Product a)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanMultIdentity a => Monoid (Product a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphanConsumable a => Consumable (Product a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable a => Dupable (Product a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable a => Movable (Product a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMultiplicative a => Semigroup (Product a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphantype Rep (Product a) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Product"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Product"
'PrefixI 'True) (S1 ('MetaSel ('Just"getProduct"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Product = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Product"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Product"
'PrefixI 'True) (S1 ('MetaSel ('Just"getProduct"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))data MVector s (Product a)MV_Product (MVector s a)
data Vector (Product a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep (Product a) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Product"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Product"
'PrefixI 'True) (S1 ('MetaSel ('Just"getProduct"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Product = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Product"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Product"
'PrefixI 'True) (S1 ('MetaSel ('Just"getProduct"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
Monoid under addition.
Sum a <> Sum b = Sum (a + b)Examples
Sum 1 <> Sum 2 <> memptySum {getSum = 3}
mconcat [ Sum n | n <- [3 .. 9]]Sum {getSum = 42}
Instances42Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
Monad SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFunctor SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalMonadFix SumDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.FixApplicative SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalFoldable SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.FoldableTraversable SumDefined in ghc-internal-10.0.0 · GHC.Internal.Data.TraversableMonadZip SumDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Monad.ZipFoldable1 SumDefined in base-4.23.0.0 · Data.Foldable1NFData1 SumDefined in deepseq-1.5.2.0 · Control.DeepSeqGeneric1 SumDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsGeneric1 SumDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanUnbox a => MVector MVector (Sum a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseUnbox a => Vector Vector (Sum a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseBounded a => Bounded (Sum 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.InternalData a => Data (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.DataNum a => Num (Sum 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.InternalRead a => Read (Sum 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.InternalGeneric (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsNum a => Semigroup (Sum 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.InternalNFData a => NFData (Sum a)Defined in deepseq-1.5.2.0 · Control.DeepSeqArbitrary a => Arbitrary (Sum a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary a => CoArbitrary (Sum a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction a => Function (Sum a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary a => Binary (Sum a)Defined in binary-0.8.9.3 · Data.Binary.ClassPrim a => Prim (Sum a)Defined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox a => Unbox (Sum a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric (Sum a)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanAddIdentity a => Monoid (Sum a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphanConsumable a => Consumable (Sum a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable a => Dupable (Sum a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable a => Movable (Sum a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableAdditive a => Semigroup (Sum a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphantype Rep (Sum a) = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Sum"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Sum"
'PrefixI 'True) (S1 ('MetaSel ('Just"getSum"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Sum = D1 ('MetaDataDefined in ghc-internal-10.0.0 · GHC.Internal.Generics"Sum"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Sum"
'PrefixI 'True) (S1 ('MetaSel ('Just"getSum"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))data MVector s (Sum a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector (Sum a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep (Sum a) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Sum"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Sum"
'PrefixI 'True) (S1 ('MetaSel ('Just"getSum"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Sum = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Sum"
"GHC.Internal.Data.Semigroup.Internal"
"ghc-internal"
'True) (C1 ('MetaCons"Sum"
'PrefixI 'True) (S1 ('MetaSel ('Just"getSum"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
IsString is used in combination with the -XOverloadedStrings
language extension to convert the literals to different string types.
For example, if you use the text package, you can say
{-# LANGUAGE OverloadedStrings #-}
myText = "hello world" :: Text
Internally, the extension will convert this to the equivalent of
myText = fromString @Text ("hello world" :: String)
Note: You can use fromString in normal code as well,
but the usual performance/memory efficiency problems with String apply.
Methods
fromString :: String -> a
Instances14IsString, …
IsString BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphanIsString ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.TypeBeware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�
IsString ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.InternalBeware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�
IsString ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.InternalBeware: fromString truncates multi-byte characters to octets. e.g. "枯朶に烏のとまりけり秋の暮" becomes �6k�nh~�Q��n�
IsString DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJIsString TextDefined in text-2.1.4 · Data.Text · orphanPerforms replacement on invalid scalar values:
Example2 expressions :set -XOverloadedStrings"\55555" :: Text"\65533"
IsString BuilderDefined in text-2.1.4 · Data.Text.Internal.BuilderPerforms replacement on invalid scalar values:
Example2 expressions :set -XOverloadedStrings"\55555" :: Builder"\65533"
IsString TextDefined in text-2.1.4 · Data.Text.Lazy · orphanPerforms replacement on invalid scalar values:
Example2 expressions :set -XOverloadedStrings"\55555" :: Data.Text.Lazy.Text"\65533"
IsString (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJIsString a => IsString (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.String(IsString a, Hashable a) => IsString (Hashed a)Defined in hashable-1.5.1.0 · Data.Hashable.Classa ~ Char => IsString (Seq a)Defined in containers-0.8 · Data.Sequence.Internala ~ Char => IsString [a]Defined in ghc-internal-10.0.0 · GHC.Internal.Data.String(a ~ Char)context was introduced in4.9.0.0IsString a => IsString (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.String
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.
Instances107Bounded, …
Bounded 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 ()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 (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] = []
Instances131Enum, …
Enum IoManagerFlagDefined in base-4.23.0.0 · GHC.RTS.FlagsEnum 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 GenericClassDefined in linear-generics-0.2.3 · Generics.Linear.TH.InternalEnum CardinalityDefined in random-1.3.1 · System.Random.GFiniteThis is needed only as a superclass of Integral.
Enum I8Defined in text-2.1.4 · Data.Text.ForeignEnum FPFormatDefined in text-2.1.4 · Data.Text.Lazy.Builder.RealFloatEnum ()Defined in ghc-internal-10.0.0 · GHC.Internal.EnumEnum a => Enum (Blind a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (Negative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (NonNegative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (NonPositive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (NonZero a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (Positive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum a => Enum (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersEnum 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.
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]
Instances211Read, …
Read ASCIIStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead PrintableStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead UnicodeStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead QCGenDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.RandomRead ArgsDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.TestRead 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 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 SMGenDefined in splitmix-0.1.3.2 · System.Random.SplitMixExample1 expression readMaybe "SMGen 1 1" :: Maybe SMGenJust (SMGen 1 1)
Example1 expression readMaybe "SMGen 1 2" :: Maybe SMGenNothing
Example1 expression readMaybe (show (mkSMGen 42)) :: Maybe SMGenJust (SMGen 9297814886316923340 13679457532755275413)
Read SMGenDefined in splitmix-0.1.3.2 · System.Random.SplitMix32Example1 expression readMaybe "SMGen 1 1" :: Maybe SMGenJust (SMGen 1 1)
Example1 expression readMaybe "SMGen 1 2" :: Maybe SMGenNothing
Example1 expression readMaybe (show (mkSMGen 42)) :: Maybe SMGenJust (SMGen 142593372 1604540297)
Read 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 DatatypeVariantDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.DatatypeRead ()Defined in ghc-internal-10.0.0 · GHC.Internal.ReadRead a => Read (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (Negative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (NonEmptyList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (NonNegative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (NonPositive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (NonZero a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (OrderedList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (Positive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead a => Read (SortedList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersRead 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 (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 (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.ArrayRead a => Read (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArrayRead a => Read (Vector a)Defined in vector-0.13.2.0 · Data.VectorRead a => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.StrictRead 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 e => Read (IntMap e)Defined in containers-0.8 · Data.IntMap.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(Read a, Storable a) => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Storable(Read a, Prim a) => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Primitive(Read a, Unbox a) => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed · orphan(Integral a, Read a) => Read (Ratio a)Defined in ghc-internal-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 (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 (f a) => Read (MP1 m f a)Defined in linear-generics-0.2.3 · Generics.Linear.ClassRead 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 (g x)) => Read ((:.:) f g x)Defined in linear-generics-0.2.3 · Generics.Linear.ClassRead (f p) => Read (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(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.
Instances12Fractional, …
Fractional 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]
RealFloat 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.
Instances71Integral, …
Integral 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 CardinalityDefined in random-1.3.1 · System.Random.GFiniteIntegral I8Defined in text-2.1.4 · Data.Text.ForeignIntegral a => Integral (Blind a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersIntegral a => Integral (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersIntegral a => Integral (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersIntegral a => Integral (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersIntegral a => Integral (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersIntegral a => Integral (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersIntegral 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.
Instances84Real, …
Real 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 CardinalityDefined in random-1.3.1 · System.Random.GFiniteThis is needed only as a superclass of Integral.
Real I8Defined in text-2.1.4 · Data.Text.ForeignIntegral a => Real (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealReal a => Real (Blind a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersReal a => Real (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersReal a => Real (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersReal a => Real (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersReal a => Real (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersReal a => Real (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersReal 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
Instances10RealFrac, …
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.
Integral 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
Instances498Show, …
Show ASCIIStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow PrintableStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow UnicodeStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow ADefined in QuickCheck-2.19.0.0 · Test.QuickCheck.PolyShow BDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.PolyShow CDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.PolyShow OrdADefined in QuickCheck-2.19.0.0 · Test.QuickCheck.PolyShow OrdBDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.PolyShow OrdCDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.PolyShow WitnessDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.PropertyShow QCGenDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.RandomShow ConfidenceDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.StateShow TestProgressDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.StateShow ArgsDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.TestShow ResultDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.TestShow CellDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.TextShow StrDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.TextShow 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 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 PSLDefined in linear-base-0.8.1 · Data.HashMap.Mutable.Linear.InternalShow 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 CardinalityDefined in random-1.3.1 · System.Random.GFiniteShow StdGenDefined in random-1.3.1 · System.Random.InternalShow SMGenDefined in splitmix-0.1.3.2 · System.Random.SplitMixShow SMGenDefined in splitmix-0.1.3.2 · System.Random.SplitMix32Show 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 ConstructorInfoDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.DatatypeShow ConstructorVariantDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.DatatypeShow DatatypeInfoDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.DatatypeShow DatatypeVariantDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.DatatypeShow FieldStrictnessDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.DatatypeShow StrictnessDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.DatatypeShow UnpackednessDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.DatatypeShow SizeDefined in vector-0.13.2.0 · Data.Vector.Fusion.Bundle.SizeShow ()Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow (Blind a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow (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 (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJShow (Seed g)Defined in random-1.3.1 · System.Random.InternalShow a => Show (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (InfiniteList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (Negative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (NonEmptyList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (NonNegative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (NonPositive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (NonZero a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (OrderedList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (Positive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (Smart a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (SortedList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow 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 (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 (Hashed a)Defined in hashable-1.5.1.0 · Data.Hashable.ClassShow a => Show (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearShow a => Show (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearShow 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 (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.ArrayShow a => Show (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArrayShow a => Show (Tuple a)Defined in storable-record-0.0.7 · Foreign.Storable.Record.TupleShow a => Show (Vector a)Defined in vector-0.13.2.0 · Data.VectorShow a => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.StrictShow 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 (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 g => Show (StateGen g)Defined in random-1.3.1 · System.Random.InternalShow g => Show (AtomicGen g)Defined in random-1.3.1 · System.Random.StatefulShow g => Show (IOGen g)Defined in random-1.3.1 · System.Random.StatefulShow g => Show (STGen g)Defined in random-1.3.1 · System.Random.StatefulShow g => Show (TGen g)Defined in random-1.3.1 · System.Random.StatefulShow m => Show (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupShow p => Show (Par1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow vertex => Show (SCC vertex)Defined in containers-0.8 · Data.Graph(Show a, Storable a) => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Storable(Show a, Prim a) => Show (PrimArray a)Defined in primitive-0.9.1.0 · Data.Primitive.PrimArray(Show a, Prim a) => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Primitive(Show a, Unbox a) => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Unboxed · orphanHasResolution a => Show (Fixed a)Defined in base-4.23.0.0 · Data.FixedShow (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 (Shrinking s a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ModifiersShow a => Show (V n a)Defined in linear-base-0.8.1 · Data.V.Linear.Internal(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 (Fun a b)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function(Show a, Show b) => Show (Arg a b)Defined in base-4.23.0.0 · Data.Semigroup(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 a, Show b) => Show (a :-> b)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function(Show k, Show a) => Show (Map k a)Defined in containers-0.8 · Data.Map.Internal(Show k, Show v) => Show (RobinVal k v)Defined in linear-base-0.8.1 · Data.HashMap.Mutable.Linear.InternalShow (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 (f a) => Show (MP1 m f a)Defined in linear-generics-0.2.3 · Generics.Linear.ClassShow 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 (g x)) => Show ((:.:) f g x)Defined in linear-generics-0.2.3 · Generics.Linear.ClassShow (f p) => Show (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(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 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.
Instances42Monad, 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.CatchPrimBase IODefined in primitive-0.9.1.0 · Control.Monad.PrimitivePrimMonad IODefined in primitive-0.9.1.0 · Control.Monad.PrimitiveMonadError 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.Printftype PrimState IO = RealWorldDefined in primitive-0.9.1.0 · Control.Monad.Primitive
Instances30Bounded, Enum, Data, Read, Show, Ix, …
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.HughesPJClassFinite OrderingDefined in random-1.3.1 · System.Random.GFiniteArbitrary OrderingDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary OrderingDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction OrderingDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary OrderingDefined in binary-0.8.9.3 · Data.Binary.ClassHashable OrderingDefined in hashable-1.5.1.0 · Data.Hashable.ClassGeneric OrderingDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanMonoid OrderingDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidConsumable OrderingDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable OrderingDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable OrderingDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableSemigroup OrderingDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupEq OrderingDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqOrd OrderingDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ordtype 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))type Rep Ordering = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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))
Methods
mempty :: a
Instances31Monoid, …
Monoid AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid OrderingDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid ()Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid a => Monoid (Ur a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid (Array a)Defined in linear-base-0.8.1 · Data.Array.Polarized.PushMonoid (ArrayWriter a)Defined in linear-base-0.8.1 · Data.Array.Polarized.PushMonoid (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid [a]Defined in linear-base-0.8.1 · Data.List.Linear · orphanMonoid a => Monoid (Identity a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid a => Monoid (Down a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid a => Monoid (Dual a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid a => Monoid (IO a)Defined in linear-base-0.8.1 · System.IO.LinearMonoid a => Monoid (RIO a)Defined in linear-base-0.8.1 · System.IO.Resource.Linear.InternalSemigroup a => Monoid (Maybe a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidAddIdentity a => Monoid (Sum a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphanAddIdentity a => Monoid (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity a => Monoid (Product a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphanMultIdentity a => Monoid (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearConsumable a => Monoid (First a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidConsumable a => Monoid (Last a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid(Movable a, Monoid a) => Monoid (MovableMonoid a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.InstancesMonoid (Proxy a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid(Monoid a, Monoid b) => Monoid (a, b)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid a => Monoid (Const a b)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid(Applicative f, Monoid a) => Monoid (Ap f a)Defined in linear-base-0.8.1 · Data.Functor.Linear.Internal.Applicative · orphan(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid(Monoid (f a), Monoid (g a)) => Monoid (Product f g a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidMonoid (f (g a)) => Monoid (Compose f g a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
Constructors
Endo (a %1 -> a)
Instances4Monoid, Semigroup
Semigroup (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupMonoid (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid · orphanMonoid (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidSemigroup (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
Constructors
Methods
(<>) :: a %1 -> a %1 -> ainfixr 6
Instances41Semigroup, …
Semigroup VoidDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup OrderingDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup ()Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup a => Semigroup (Ur a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup (NonEmpty a)Defined in linear-base-0.8.1 · Data.List.Linear · orphanSemigroup (Array a)Defined in linear-base-0.8.1 · Data.Array.Polarized.Pull.InternalSemigroup (Array a)Defined in linear-base-0.8.1 · Data.Array.Polarized.PushSemigroup (ArrayWriter a)Defined in linear-base-0.8.1 · Data.Array.Polarized.PushSemigroup (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup (Vector a)Defined in linear-base-0.8.1 · Data.Vector.Mutable.Linear.InternalSemigroup [a]Defined in linear-base-0.8.1 · Data.List.Linear · orphanSemigroup a => Semigroup (Identity a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup a => Semigroup (Down a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup a => Semigroup (Dual a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup a => Semigroup (Maybe a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup a => Semigroup (IO a)Defined in linear-base-0.8.1 · System.IO.LinearSemigroup a => Semigroup (RIO a)Defined in linear-base-0.8.1 · System.IO.Resource.Linear.InternalSemigroup a => Semigroup (a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupAdditive a => Semigroup (Sum a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphanAdditive a => Semigroup (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative a => Semigroup (Product a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphanMultiplicative a => Semigroup (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearKeyed a => Semigroup (Set a)Defined in linear-base-0.8.1 · Data.Set.Mutable.Linear.InternalConsumable a => Semigroup (First a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupConsumable a => Semigroup (Last a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupConsumable a => Semigroup (First a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupConsumable a => Semigroup (Last a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Movable a, Semigroup a) => Semigroup (MovableMonoid a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.InstancesKeyed k => Semigroup (HashMap k v)Defined in linear-base-0.8.1 · Data.HashMap.Mutable.Linear.InternalSemigroup (Proxy a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Semigroup a, Semigroup b) => Semigroup (a, b)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Consumable a, Consumable b) => Semigroup (Either a b)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup a => Semigroup (Const a b)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Applicative f, Semigroup a) => Semigroup (Ap f a)Defined in linear-base-0.8.1 · Data.Functor.Linear.Internal.Applicative · orphan(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Semigroup (f a), Semigroup (g a)) => Semigroup (Product f g a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupSemigroup (f (g a)) => Semigroup (Compose f g a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
Methods
zero :: a
Instances15AddIdentity, …
AddIdentity IntegerDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity NaturalDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity Int16Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity Int32Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity Int64Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity Int8Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity DoubleDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity FloatDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity IntDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity WordDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity Word16Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity Word32Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity Word64Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => AddIdentity (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Instances7Eq, Ord, Show, Monoid, Semigroup, …
Eq a => Eq (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearOrd a => Ord (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearShow a => Show (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearAdditive a => Semigroup (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity a => Monoid (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearAddIdentity a => Monoid (Adding a)Defined in linear-base-0.8.1 · Data.Num.LinearAdditive a => Semigroup (Adding a)Defined in linear-base-0.8.1 · Data.Num.Linear
Methods
(+) :: a %1 -> a %1 -> ainfixl 6
Instances15Additive, …
Additive IntegerDefined in linear-base-0.8.1 · Data.Num.LinearAdditive NaturalDefined in linear-base-0.8.1 · Data.Num.LinearAdditive Int16Defined in linear-base-0.8.1 · Data.Num.LinearAdditive Int32Defined in linear-base-0.8.1 · Data.Num.LinearAdditive Int64Defined in linear-base-0.8.1 · Data.Num.LinearAdditive Int8Defined in linear-base-0.8.1 · Data.Num.LinearAdditive DoubleDefined in linear-base-0.8.1 · Data.Num.LinearAdditive FloatDefined in linear-base-0.8.1 · Data.Num.LinearAdditive IntDefined in linear-base-0.8.1 · Data.Num.LinearAdditive WordDefined in linear-base-0.8.1 · Data.Num.LinearAdditive Word16Defined in linear-base-0.8.1 · Data.Num.LinearAdditive Word32Defined in linear-base-0.8.1 · Data.Num.LinearAdditive Word64Defined in linear-base-0.8.1 · Data.Num.LinearAdditive Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => Additive (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Instances15AdditiveGroup, …
AdditiveGroup IntegerDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup NaturalDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup Int16Defined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup Int32Defined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup Int64Defined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup Int8Defined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup DoubleDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup FloatDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup IntDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup WordDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup Word16Defined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup Word32Defined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup Word64Defined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => AdditiveGroup (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Methods
fromInteger :: Integer %1 -> a
Instances15FromInteger, …
FromInteger IntegerDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger NaturalDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger Int16Defined in linear-base-0.8.1 · Data.Num.LinearFromInteger Int32Defined in linear-base-0.8.1 · Data.Num.LinearFromInteger Int64Defined in linear-base-0.8.1 · Data.Num.LinearFromInteger Int8Defined in linear-base-0.8.1 · Data.Num.LinearFromInteger DoubleDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger FloatDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger IntDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger WordDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger Word16Defined in linear-base-0.8.1 · Data.Num.LinearFromInteger Word32Defined in linear-base-0.8.1 · Data.Num.LinearFromInteger Word64Defined in linear-base-0.8.1 · Data.Num.LinearFromInteger Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => FromInteger (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Methods
one :: a
Instances15MultIdentity, …
MultIdentity IntegerDefined in linear-base-0.8.1 · Data.Num.LinearMultIdentity NaturalDefined in linear-base-0.8.1 · Data.Num.LinearMultIdentity Int16Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity Int32Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity Int64Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity Int8Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity DoubleDefined in linear-base-0.8.1 · Data.Num.LinearMultIdentity FloatDefined in linear-base-0.8.1 · Data.Num.LinearMultIdentity IntDefined in linear-base-0.8.1 · Data.Num.LinearMultIdentity WordDefined in linear-base-0.8.1 · Data.Num.LinearMultIdentity Word16Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity Word32Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity Word64Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => MultIdentity (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Methods
(*) :: a %1 -> a %1 -> ainfixl 7
Instances15Multiplicative, …
Multiplicative IntegerDefined in linear-base-0.8.1 · Data.Num.LinearMultiplicative NaturalDefined in linear-base-0.8.1 · Data.Num.LinearMultiplicative Int16Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative Int32Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative Int64Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative Int8Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative DoubleDefined in linear-base-0.8.1 · Data.Num.LinearMultiplicative FloatDefined in linear-base-0.8.1 · Data.Num.LinearMultiplicative IntDefined in linear-base-0.8.1 · Data.Num.LinearMultiplicative WordDefined in linear-base-0.8.1 · Data.Num.LinearMultiplicative Word16Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative Word32Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative Word64Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => Multiplicative (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Constructors
Instances7Eq, Ord, Show, Monoid, Semigroup, …
Eq a => Eq (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearOrd a => Ord (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearShow a => Show (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative a => Semigroup (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity a => Monoid (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearMultIdentity a => Monoid (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.LinearMultiplicative a => Semigroup (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.Linear
Instances14Num, …
Num IntegerDefined in linear-base-0.8.1 · Data.Num.LinearNum Int16Defined in linear-base-0.8.1 · Data.Num.LinearNum Int32Defined in linear-base-0.8.1 · Data.Num.LinearNum Int64Defined in linear-base-0.8.1 · Data.Num.LinearNum Int8Defined in linear-base-0.8.1 · Data.Num.LinearNum DoubleDefined in linear-base-0.8.1 · Data.Num.LinearNum FloatDefined in linear-base-0.8.1 · Data.Num.LinearNum IntDefined in linear-base-0.8.1 · Data.Num.LinearNum WordDefined in linear-base-0.8.1 · Data.Num.LinearNum Word16Defined in linear-base-0.8.1 · Data.Num.LinearNum Word32Defined in linear-base-0.8.1 · Data.Num.LinearNum Word64Defined in linear-base-0.8.1 · Data.Num.LinearNum Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => Num (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Instances14Ring, …
Ring IntegerDefined in linear-base-0.8.1 · Data.Num.LinearRing Int16Defined in linear-base-0.8.1 · Data.Num.LinearRing Int32Defined in linear-base-0.8.1 · Data.Num.LinearRing Int64Defined in linear-base-0.8.1 · Data.Num.LinearRing Int8Defined in linear-base-0.8.1 · Data.Num.LinearRing DoubleDefined in linear-base-0.8.1 · Data.Num.LinearRing FloatDefined in linear-base-0.8.1 · Data.Num.LinearRing IntDefined in linear-base-0.8.1 · Data.Num.LinearRing WordDefined in linear-base-0.8.1 · Data.Num.LinearRing Word16Defined in linear-base-0.8.1 · Data.Num.LinearRing Word32Defined in linear-base-0.8.1 · Data.Num.LinearRing Word64Defined in linear-base-0.8.1 · Data.Num.LinearRing Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => Ring (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Instances15Semiring, …
Semiring IntegerDefined in linear-base-0.8.1 · Data.Num.LinearSemiring NaturalDefined in linear-base-0.8.1 · Data.Num.LinearSemiring Int16Defined in linear-base-0.8.1 · Data.Num.LinearSemiring Int32Defined in linear-base-0.8.1 · Data.Num.LinearSemiring Int64Defined in linear-base-0.8.1 · Data.Num.LinearSemiring Int8Defined in linear-base-0.8.1 · Data.Num.LinearSemiring DoubleDefined in linear-base-0.8.1 · Data.Num.LinearSemiring FloatDefined in linear-base-0.8.1 · Data.Num.LinearSemiring IntDefined in linear-base-0.8.1 · Data.Num.LinearSemiring WordDefined in linear-base-0.8.1 · Data.Num.LinearSemiring Word16Defined in linear-base-0.8.1 · Data.Num.LinearSemiring Word32Defined in linear-base-0.8.1 · Data.Num.LinearSemiring Word64Defined in linear-base-0.8.1 · Data.Num.LinearSemiring Word8Defined in linear-base-0.8.1 · Data.Num.Linear(Movable a, Num a) => Semiring (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
Instances24Eq, …
Eq Int16Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq Int32Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq Int64Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq Int8Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq BoolDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq CharDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq DoubleDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq IntDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq OrderingDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq Word16Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq Word32Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq Word64Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq Word8Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq ()Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqEq a => Eq (Ur a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Eq a, Movable a) => Eq (MovableEq a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Eq a, Movable a) => Eq (MovableOrd a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Consumable a, Eq a) => Eq (NonEmpty a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Consumable a, Eq a) => Eq (Maybe a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Consumable a, Eq a) => Eq [a]Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Eq a, Eq b) => Eq (a, b)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Consumable a, Consumable b, Eq a, Eq b) => Eq (Either a b)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Eq a, Eq b, Eq c) => Eq (a, b, c)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
Instances23Ord, …
Ord Int16Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd Int32Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd Int64Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd Int8Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd BoolDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd CharDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd DoubleDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd IntDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd OrderingDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd Word16Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd Word32Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd Word64Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd Word8Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd ()Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdOrd a => Ord (Ur a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Ord a, Movable a) => Ord (MovableOrd a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Consumable a, Ord a) => Ord (NonEmpty a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Consumable a, Ord a) => Ord (Maybe a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Consumable a, Ord a) => Ord [a]Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Ord a, Ord b) => Ord (a, b)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Consumable a, Consumable b, Ord a, Ord b) => Ord (Either a b)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Ord a, Ord b, Ord c) => Ord (a, b, c)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
Methods
consume :: a %1 -> ()
Instances60Consumable, …
Consumable ByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable ShortByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable VoidDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable NaturalDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable Int16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable Int32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable Int64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable Int8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable CharDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable IntDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable OrderingDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable WordDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable Word16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable Word32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable Word64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable Word8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable PoolDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.InternalConsumable TextDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanConsumable ()Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable (Array a)Defined in linear-base-0.8.1 · Data.Array.Mutable.Linear.InternalConsumable (Replicator a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable (ReplicationStream a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable (Set a)Defined in linear-base-0.8.1 · Data.Set.Mutable.Linear.InternalConsumable (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable (Vector a)Defined in linear-base-0.8.1 · Data.Vector.Mutable.Linear.InternalConsumable a => Consumable (First a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (Last a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (Max a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (Min a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (WrappedMonoid a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (NonEmpty a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (First a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (Last a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (Dual a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (Product a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (Sum a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (Maybe a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.LinearConsumable a => Consumable (Vector a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable (a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable a => Consumable [a]Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableMovable a => Consumable (AsMovable a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances(Generic a, GConsumable (Rep a)) => Consumable (Generically a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable (HashMap k v)Defined in linear-base-0.8.1 · Data.HashMap.Mutable.Linear.InternalConsumable (VDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan0
a)(KnownNat n, Consumable a) => Consumable (V n a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan(Consumable a, Consumable b) => Consumable (Arg a b)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable(Consumable a, Consumable b) => Consumable (a, b)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable(Consumable e, Consumable a) => Consumable (Either e a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable (f a) => Consumable (Ap f a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableConsumable (f a) => Consumable (Alt f a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable(Consumable a, Consumable b, Consumable c) => Consumable (a, b, c)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable(Consumable a, Consumable b, Consumable c, Consumable d) => Consumable (a, b, c, d)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable(Consumable a, Consumable b, Consumable c, Consumable d, Consumable e) => Consumable (a, b, c, d, e)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable
Methods
dupR :: a %1 -> Replicator adup2 :: a %1 -> (a, a)
Instances46Dupable, …
Dupable ByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable ShortByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable NaturalDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable Int16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable Int32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable Int64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable Int8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable CharDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable IntDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable OrderingDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable WordDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable Word16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable Word32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable Word64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable Word8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable PoolDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.InternalDupable TextDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable ()Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable (Array a)Defined in linear-base-0.8.1 · Data.Array.Mutable.Linear.InternalDupable (Replicator a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable (ReplicationStream a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable (Set a)Defined in linear-base-0.8.1 · Data.Set.Mutable.Linear.InternalDupable (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable (Vector a)Defined in linear-base-0.8.1 · Data.Vector.Mutable.Linear.InternalDupable a => Dupable (NonEmpty a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable a => Dupable (Product a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable a => Dupable (Sum a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable a => Dupable (Maybe a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable a => Dupable (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.LinearDupable a => Dupable (a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable a => Dupable [a]Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable a => Dupable (AsMovable a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances(Generic a, GDupable (Rep a)) => Dupable (Generically a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableDupable (HashMap k v)Defined in linear-base-0.8.1 · Data.HashMap.Mutable.Linear.Internal(KnownNat n, Dupable a) => Dupable (V n a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan(Dupable a, Dupable b) => Dupable (Either a b)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable(Dupable a, Dupable b) => Dupable (a, b)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable(Dupable a, Dupable b, Dupable c) => Dupable (a, b, c)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable(Dupable a, Dupable b, Dupable c, Dupable d) => Dupable (a, b, c, d)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable(Dupable a, Dupable b, Dupable c, Dupable d, Dupable e) => Dupable (a, b, c, d, e)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
Instances38Movable, …
Movable ByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable ShortByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable NaturalDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable Int16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable Int32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable Int64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable Int8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable CharDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable IntDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable OrderingDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable WordDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable Word16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable Word32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable Word64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable Word8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable TextDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMovable ()Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable a => Movable (NonEmpty a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable a => Movable (Product a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable a => Movable (Sum a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable a => Movable (Maybe a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable a => Movable (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.LinearMovable a => Movable (AsMovable a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.InstancesMovable a => Movable (a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMovable a => Movable [a]Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable(Generic a, GMovable (Rep a)) => Movable (Generically a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable(Movable a, Movable b) => Movable (Either a b)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable(Movable a, Movable b) => Movable (a, b)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable(Movable a, Movable b, Movable c) => Movable (a, b, c)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable(Movable a, Movable b, Movable c, Movable d) => Movable (a, b, c, d)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable(Movable a, Movable b, Movable c, Movable d, Movable e) => Movable (a, b, c, d, e)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
Instances24Monad, Foldable, Traversable, Functor, Applicative, Generic1, …
Monad UrDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrFunctor UrDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrApplicative UrDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrFoldable UrDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrTraversable UrDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrFunctor UrDefined in linear-base-0.8.1 · Data.Functor.Linear.Internal.FunctorApplicative UrDefined in linear-base-0.8.1 · Data.Functor.Linear.Internal.ApplicativeGeneric1 UrDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrGeneric1 UrDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrGeneric (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrStorable a => Storable (Ur a)Defined in linear-base-0.8.1 · Foreign.Marshal.Pure.Internal · orphanGeneric (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.UrMonoid a => Monoid (Ur a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidConsumable (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableSemigroup a => Semigroup (Ur a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.SemigroupEq a => Eq (Ur a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqOrd a => Ord (Ur a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdKnownRepresentable a => KnownRepresentable (Ur a)Defined in linear-base-0.8.1 · Foreign.Marshal.Pure.Internaltype Rep (Ur a) = D1 ('MetaDataDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Ur"Ur"
"Data.Unrestricted.Linear.Internal.Ur"
"linear-base-0.8.1-6Jev64B5sXbJD6krIue2YK"
'False) (C1 ('MetaCons"Ur"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))type Rep1 Ur = D1 ('MetaDataDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Ur"Ur"
"Data.Unrestricted.Linear.Internal.Ur"
"linear-base-0.8.1-6Jev64B5sXbJD6krIue2YK"
'False) (C1 ('MetaCons"Ur"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))type Rep (Ur a) = FixupMetaData (Ur a) (D1 Any (C1 Any (S1 Any (MP1 'Many (Rec0 a)))))Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Urtype Rep1 Ur = FixupMetaData1 Ur (D1 Any (C1 Any (S1 Any (MP1 'Many Par1))))Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Ur
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.
Instances35Enum, Eq, Integral, Data, Ord, Read, …
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.HughesPJClassRandom IntegerDefined in random-1.3.1 · System.RandomUniformRange IntegerDefined in random-1.3.1 · System.Random.InternalArbitrary IntegerDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary IntegerDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction IntegerDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary IntegerDefined in binary-0.8.9.3 · Data.Binary.ClassHashable IntegerDefined in hashable-1.5.1.0 · Data.Hashable.ClassConsumable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanDupable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMultIdentity IntegerDefined in linear-base-0.8.1 · Data.Num.LinearMovable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphanMultiplicative IntegerDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity IntegerDefined in linear-base-0.8.1 · Data.Num.LinearAdditive IntegerDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup IntegerDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger IntegerDefined in linear-base-0.8.1 · Data.Num.LinearNum IntegerDefined in linear-base-0.8.1 · Data.Num.LinearRing IntegerDefined in linear-base-0.8.1 · Data.Num.LinearSemiring IntegerDefined in linear-base-0.8.1 · Data.Num.LinearLift 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.
Instances64Monad, MonadFix, MonadFail, Applicative, Foldable, Alternative, …
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.DeepSeqArbitrary1 MaybeDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryMonadThrow MaybeDefined in exceptions-0.10.12 · Control.Monad.CatchHashable1 MaybeDefined in hashable-1.5.1.0 · Data.Hashable.ClassFunctor MaybeDefined in linear-base-0.8.1 · Data.Functor.Linear.Internal.FunctorTraversable MaybeDefined in linear-base-0.8.1 · Data.Functor.Linear.Internal.TraversableGeneric1 MaybeDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsMonadError () MaybeDefined in mtl-2.3.2 · Control.Monad.Error.ClassGeneric1 MaybeDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanLift a => Lift (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftEq 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.Storable a => Storable (Maybe a)Defined in linear-base-0.8.1 · Foreign.Marshal.Pure.Internal · orphanSingKind 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.HughesPJClassFinite a => Finite (Maybe a)Defined in random-1.3.1 · System.Random.GFinite(Finite a, Uniform a) => Uniform (Maybe a)Defined in random-1.3.1 · System.Random.InternalArbitrary a => Arbitrary (Maybe a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary a => CoArbitrary (Maybe a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction a => Function (Maybe a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionTestable prop => Testable (Maybe prop)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.PropertyBinary a => Binary (Maybe a)Defined in binary-0.8.9.3 · Data.Binary.ClassHashable a => Hashable (Maybe a)Defined in hashable-1.5.1.0 · Data.Hashable.ClassGeneric (Maybe a)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanSemigroup a => Monoid (Maybe a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.MonoidConsumable a => Consumable (Maybe a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable a => Dupable (Maybe a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable a => Movable (Maybe a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableSemigroup a => Semigroup (Maybe a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup(Consumable a, Eq a) => Eq (Maybe a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq(Consumable a, Ord a) => Ord (Maybe a)Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdKnownRepresentable a => KnownRepresentable (Maybe a)Defined in linear-base-0.8.1 · Foreign.Marshal.Pure.InternalRepresentable a => Representable (Maybe a)Defined in linear-base-0.8.1 · Foreign.Marshal.Pure.InternalSingI '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 Rep (Maybe a) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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 linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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 AsKnown (Maybe a) = Maybe (AsKnown a)Defined in linear-base-0.8.1 · Foreign.Marshal.Pure.Internal
Instances47Bounded, Enum, Data, Read, Show, Ix, …
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.HughesPJClassRandom BoolDefined in random-1.3.1 · System.RandomFinite BoolDefined in random-1.3.1 · System.Random.GFiniteUniform BoolDefined in random-1.3.1 · System.Random.InternalUniformRange BoolDefined in random-1.3.1 · System.Random.InternalArbitrary BoolDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary BoolDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction BoolDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionTestable BoolDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.PropertyBinary BoolDefined in binary-0.8.9.3 · Data.Binary.ClassHashable BoolDefined in hashable-1.5.1.0 · Data.Hashable.ClassUnbox BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric BoolDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanConsumable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableEq BoolDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqOrd BoolDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdLift 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.BaseMVector MVector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseVector Vector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.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.Genericsdata MVector s BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep Bool = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Bool"
"GHC.Internal.Types"
"ghc-internal"
'False) (C1 ('MetaCons"False"
'PrefixI 'False) U1 :+: C1 ('MetaCons"True"
'PrefixI 'False) U1)
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 |
Instances58Bounded, 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.HughesPJClassRandom CharDefined in random-1.3.1 · System.RandomFinite CharDefined in random-1.3.1 · System.Random.GFiniteUniform CharDefined in random-1.3.1 · System.Random.InternalUniformRange CharDefined in random-1.3.1 · System.Random.InternalArbitrary CharDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary CharDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction CharDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary CharDefined in binary-0.8.9.3 · Data.Binary.ClassHashable CharDefined in hashable-1.5.1.0 · Data.Hashable.ClassPrim CharDefined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox CharDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric CharDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanConsumable CharDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable CharDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMovable CharDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableEq CharDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqOrd CharDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdLift 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.BaseMVector MVector CharDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseVector Vector CharDefined in vector-0.13.2.0 · Data.Vector.Unboxed.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.GenericsGeneric1 (URec Char)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanFoldable 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.GenericsEq (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.GenericsGeneric (URec Char p)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphantype 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#
data MVector s CharDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector CharDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep Char = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Char"
"GHC.Internal.Types"
"ghc-internal"
'False) (C1 ('MetaCons"C#"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UChar))type Rep (URec Char p) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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 linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UChar"
'PrefixI 'True) (S1 ('MetaSel ('Just"uChar#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UChar))
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.
Instances65Enum, Floating, Fractional, Data, Read, Real, …
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.HughesPJClassRandom DoubleDefined in random-1.3.1 · System.RandomNote - random produces values in the closed range
[0,1].UniformRange DoubleDefined in random-1.3.1 · System.Random.InternalArbitrary DoubleDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary DoubleDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction DoubleDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary DoubleDefined in binary-0.8.9.3 · Data.Binary.ClassUses non-IEEE754 encoding. Does not round-trip NaN.
Hashable DoubleDefined in hashable-1.5.1.0 · Data.Hashable.ClassNote: prior to
hashable-1.3.0.0,hash 0.0 /= hash (-0.0)The hash of NaN is not well defined.
Prim DoubleDefined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric DoubleDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanConsumable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMultIdentity DoubleDefined in linear-base-0.8.1 · Data.Num.LinearMovable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMultiplicative DoubleDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity DoubleDefined in linear-base-0.8.1 · Data.Num.LinearAdditive DoubleDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup DoubleDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger DoubleDefined in linear-base-0.8.1 · Data.Num.LinearNum DoubleDefined in linear-base-0.8.1 · Data.Num.LinearRing DoubleDefined in linear-base-0.8.1 · Data.Num.LinearSemiring DoubleDefined in linear-base-0.8.1 · Data.Num.LinearEq DoubleDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqOrd DoubleDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdLift DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftIArray UArray DoubleDefined in array-0.5.8.0 · Data.Array.BaseMVector MVector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseVector Vector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.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.GenericsGeneric1 (URec Double)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanFoldable 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.GenericsGeneric (URec Double p)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphantype 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#
data MVector s DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep Double = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Double"
"GHC.Internal.Types"
"ghc-internal"
'False) (C1 ('MetaCons"D#"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))type Rep (URec Double p) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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 linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UDouble"
'PrefixI 'True) (S1 ('MetaSel ('Just"uDouble#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))
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.
Instances63Enum, Floating, Fractional, Data, Read, Real, …
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.HughesPJClassRandom FloatDefined in random-1.3.1 · System.RandomNote - random produces values in the closed range
[0,1].UniformRange FloatDefined in random-1.3.1 · System.Random.InternalArbitrary FloatDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary FloatDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction FloatDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary FloatDefined in binary-0.8.9.3 · Data.Binary.ClassUses non-IEEE754 encoding. Does not round-trip NaN.
Hashable FloatDefined in hashable-1.5.1.0 · Data.Hashable.ClassNote: prior to
hashable-1.3.0.0,hash 0.0 /= hash (-0.0)The hash of NaN is not well defined.
Prim FloatDefined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric FloatDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanConsumable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMultIdentity FloatDefined in linear-base-0.8.1 · Data.Num.LinearMovable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMultiplicative FloatDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity FloatDefined in linear-base-0.8.1 · Data.Num.LinearAdditive FloatDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup FloatDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger FloatDefined in linear-base-0.8.1 · Data.Num.LinearNum FloatDefined in linear-base-0.8.1 · Data.Num.LinearRing FloatDefined in linear-base-0.8.1 · Data.Num.LinearSemiring FloatDefined in linear-base-0.8.1 · Data.Num.LinearLift FloatDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftIArray UArray FloatDefined in array-0.5.8.0 · Data.Array.BaseMVector MVector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseVector Vector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.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.GenericsGeneric1 (URec Float)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanFoldable 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.GenericsGeneric (URec Float p)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphantype 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#
data MVector s FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep Float = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Float"
"GHC.Internal.Types"
"ghc-internal"
'False) (C1 ('MetaCons"F#"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))type Rep (URec Float p) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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 linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UFloat"
'PrefixI 'True) (S1 ('MetaSel ('Just"uFloat#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))
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.
Instances71Bounded, Enum, Integral, Data, Read, Real, …
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.HughesPJClassRandom IntDefined in random-1.3.1 · System.RandomFinite IntDefined in random-1.3.1 · System.Random.GFiniteUniform IntDefined in random-1.3.1 · System.Random.InternalUniformRange IntDefined in random-1.3.1 · System.Random.InternalArbitrary IntDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary IntDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction IntDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary IntDefined in binary-0.8.9.3 · Data.Binary.ClassHashable IntDefined in hashable-1.5.1.0 · Data.Hashable.ClassPrim IntDefined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox IntDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric IntDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanConsumable IntDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable IntDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMultIdentity IntDefined in linear-base-0.8.1 · Data.Num.LinearMovable IntDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMultiplicative IntDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity IntDefined in linear-base-0.8.1 · Data.Num.LinearAdditive IntDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup IntDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger IntDefined in linear-base-0.8.1 · Data.Num.LinearNum IntDefined in linear-base-0.8.1 · Data.Num.LinearRing IntDefined in linear-base-0.8.1 · Data.Num.LinearSemiring IntDefined in linear-base-0.8.1 · Data.Num.LinearEq IntDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.EqOrd IntDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.OrdKnownRepresentable IntDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.InternalRepresentable IntDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.InternalLift IntDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftIArray UArray IntDefined in array-0.5.8.0 · Data.Array.BaseMVector MVector IntDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseVector Vector IntDefined in vector-0.13.2.0 · Data.Vector.Unboxed.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.GenericsGeneric1 (URec Int)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanFoldable UIntDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UIntDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsMArray (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.GenericsGeneric (URec Int p)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphantype 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#
data MVector s IntDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector IntDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep Int = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Int"
"GHC.Internal.Types"
"ghc-internal"
'False) (C1 ('MetaCons"I#"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UInt))type Rep (URec Int p) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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 linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UInt"
'PrefixI 'True) (S1 ('MetaSel ('Just"uInt#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UInt))type AsKnown Int = IntDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.Internal
Instances67Bounded, Enum, Integral, Data, Read, Real, …
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.DeepSeqRandom WordDefined in random-1.3.1 · System.RandomFinite WordDefined in random-1.3.1 · System.Random.GFiniteUniform WordDefined in random-1.3.1 · System.Random.InternalUniformRange WordDefined in random-1.3.1 · System.Random.InternalArbitrary WordDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryCoArbitrary WordDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.ArbitraryFunction WordDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.FunctionBinary WordDefined in binary-0.8.9.3 · Data.Binary.ClassHashable WordDefined in hashable-1.5.1.0 · Data.Hashable.ClassPrim WordDefined in primitive-0.9.1.0 · Data.Primitive.TypesUnbox WordDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseGeneric WordDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanConsumable WordDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.ConsumableDupable WordDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.DupableMultIdentity WordDefined in linear-base-0.8.1 · Data.Num.LinearMovable WordDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.MovableMultiplicative WordDefined in linear-base-0.8.1 · Data.Num.LinearAddIdentity WordDefined in linear-base-0.8.1 · Data.Num.LinearAdditive WordDefined in linear-base-0.8.1 · Data.Num.LinearAdditiveGroup WordDefined in linear-base-0.8.1 · Data.Num.LinearFromInteger WordDefined in linear-base-0.8.1 · Data.Num.LinearNum WordDefined in linear-base-0.8.1 · Data.Num.LinearRing WordDefined in linear-base-0.8.1 · Data.Num.LinearSemiring WordDefined in linear-base-0.8.1 · Data.Num.LinearKnownRepresentable WordDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.InternalRepresentable WordDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.InternalLift WordDefined in ghc-internal-10.0.0 · GHC.Internal.TH.LiftIArray UArray WordDefined in array-0.5.8.0 · Data.Array.BaseMVector MVector WordDefined in vector-0.13.2.0 · Data.Vector.Unboxed.BaseVector Vector WordDefined in vector-0.13.2.0 · Data.Vector.Unboxed.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.GenericsGeneric1 (URec Word)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphanFoldable UWordDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsTraversable UWordDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsMArray (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.GenericsGeneric (URec Word p)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphantype 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#
data MVector s WordDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basedata Vector WordDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Basetype Rep Word = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"Word"
"GHC.Internal.Types"
"ghc-internal"
'False) (C1 ('MetaCons"W#"
'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UWord))type Rep (URec Word p) = D1 ('MetaDataDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"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 linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan"URec"
"GHC.Internal.Generics"
"ghc-internal"
'False) (C1 ('MetaCons"UWord"
'PrefixI 'True) (S1 ('MetaSel ('Just"uWord#"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UWord))type AsKnown Word = WordDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.Internal
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.