HORIZON HASKELLDocslts/ghc-9.14.x45dd5372026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 2026-10-11

Modulelinear-base-0.8.1

Prelude.Linear

  • 28 types
  • 28 classes
  • 139 values
valueotherwise :: Bool
#

otherwise is defined as the value True. It helps to make guards more readable. eg.

 f x | x < 0     = ...
     | otherwise = ...
valueuntil :: (a -> Bool) -> (a -> a) -> a -> a
#

until p f yields the result of applying f until p holds.

valuefind :: Foldable t => (a -> Bool) -> t a -> Maybe a
#

The find function takes a predicate and a structure and returns the leftmost element of the structure matching the predicate, or Nothing if there is no such element.

Examples

Basic usage:

Example1 expression
find (> 42) [0, 5..]Just 45
Example1 expression
find (> 12) [1..7]Nothing
valueinsert :: Ord a => a -> [a] -> [a]
#

\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
Example1 expression
insert (-1) [1, 2, 3][-1,1,2,3]
Example1 expression
insert 'd' "abcefg""abcdefg"
Example1 expression
insert 4 [1, 2, 3, 5, 6, 7][1,2,3,4,5,6,7]
valuelines :: String -> [String]
#

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
Example1 expression
lines ""           -- empty input contains no lines[]
Example1 expression
lines "\n"         -- single empty line[""]
Example1 expression
lines "one"        -- single unterminated line["one"]
Example1 expression
lines "one\n"      -- single non-empty line["one"]
Example1 expression
lines "one\n\n"    -- second line is empty["one",""]
Example1 expression
lines "one\ntwo"   -- second line is unterminated["one","two"]
Example1 expression
lines "one\ntwo\n" -- two non-empty lines["one","two"]
valuesort :: Ord a => [a] -> [a]
#

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
Example1 expression
sort [1,6,4,3,2,5][1,2,3,4,5,6]
Example1 expression
sort "haskell""aehklls"
Example2 expressions
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]
valuesortOn :: Ord b => (a -> b) -> [a] -> [a]
#

Sort a list by comparing the results of a key function applied to each element. sortOn f is equivalent to sortBy (comparing f), but has the performance advantage of only evaluating 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
Example1 expression
sortOn fst [(2, "world"), (4, "!"), (1, "Hello")][(1,"Hello"),(2,"world"),(4,"!")]
Example1 expression
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:

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

Example1 expression
(sortBy . comparing) fst [(3, 1), (2, 2), (1, 3)][(1,3),(2,2),(3,1)]
valueunlines :: [String] -> String
#

Appends a \n character to each input string, then concatenates the results. Equivalent to foldMap (s -> s ++ "\n").

Examples
Example1 expression
unlines ["Hello", "World", "!"]"Hello\nWorld\n!\n"

Note that unlines . lines /= id when the input is not \n-terminated:

Example1 expression
unlines . lines $ "foo\nbar""foo\nbar\n"
valueunwords :: [String] -> String
#

unwords joins words with separating spaces (U+0020 SPACE).

unwords is neither left nor right inverse of words:

Example2 expressions
words (unwords [" "])[]unwords (words "foo\nbar")"foo bar"
Examples
Example1 expression
unwords ["Lorem", "ipsum", "dolor"]"Lorem ipsum dolor"
Example1 expression
unwords ["foo", "bar", "", "baz"]"foo bar  baz"
valuewords :: String -> [String]
#

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
Example1 expression
words "Lorem ipsum\ndolor"["Lorem","ipsum","dolor"]
Example1 expression
words " foo bar "["foo","bar"]
valuefst :: (a, b) -> a
#

Extract the first component of a pair.

valuesnd :: (a, b) -> b
#

Extract the second component of a pair.

valueundefined :: HasCallStack => a
#

A special case of error. It is expected that compilers will recognize this and insert error messages which are more appropriate to the context in which undefined appears.

valuehead :: HasCallStack => [a] -> a
#

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
Example1 expression
head [1, 2, 3]1
Example1 expression
head [1..]1
Example1 expression
head []*** Exception: Prelude.head: empty list
valueinit :: HasCallStack => [a] -> [a]
#

\mathcal{O}(n). Return all the elements of a list except the last one. The list must be non-empty.

WARNING: This function is partial. Consider using unsnoc instead.

Examples
Example1 expression
init [1, 2, 3][1,2]
Example1 expression
init [1][]
Example1 expression
init []*** Exception: Prelude.init: empty list
valuelast :: HasCallStack => [a] -> a
#

\mathcal{O}(n). Extract the last element of a list, which must be finite and non-empty.

WARNING: This function is partial. Consider using unsnoc instead.

Examples
Example1 expression
last [1, 2, 3]3
Example1 expression
last [1..]* Hangs forever *
Example1 expression
last []*** Exception: Prelude.last: empty list
valuelookup :: Eq a => a -> [(a, b)] -> Maybe b
#

\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
Example1 expression
lookup 2 []Nothing
Example1 expression
lookup 2 [(1, "first")]Nothing
Example1 expression
lookup 2 [(1, "first"), (2, "second"), (3, "third")]Just "second"
valuetail :: HasCallStack => [a] -> [a]
#

This is a partial function, it throws an error on empty lists. Replace it with drop 1, or use pattern matching or 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
Example1 expression
tail [1, 2, 3][2,3]
Example1 expression
tail [1][]
Example1 expression
tail []*** Exception: Prelude.tail: empty list
valuesubtract :: Num a => a -> a -> a
#

the same as flip (-).

Because - is treated specially in the Haskell grammar, (- e) is not a section, but an application of prefix negation. However, (subtract exp) is equivalent to the disallowed section.

valuelex :: ReadS String
#

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

value(^) :: (Num a, Integral b) => a -> b -> a
#

raise a number to a non-negative integral power

valuefromIntegral :: (Integral a, Num b) => a -> b
#

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.

valuegcd :: Integral a => a -> a -> a
#

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.

valuelcm :: Integral a => a -> a -> a
#

lcm x y is the smallest positive integer that both x and y divide.

valuerealToFrac :: (Real a, Fractional b) => a -> b
#

General coercion to Fractional types.

WARNING: This function goes through the Rational type, which does not have values for NaN for example. This means it does not round-trip.

For Double it also behaves differently with or without -O0:

Prelude> realToFrac nan -- With -O0
-Infinity
Prelude> realToFrac nan
NaN
valueshowChar :: Char -> ShowS
#

utility function converting a Char to a show function that simply prepends the character unchanged.

valueappendFile :: FilePath -> String -> IO ()
#

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.

Example2 expressions
let fn = "hello_world"in writeFile fn "hello" >> appendFile fn " world!" >> (readFile fn >>= putStrLn)"hello world!"
Example2 expressions
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]
valuegetChar :: IO Char
#

Read a single character from the standard input device.

getChar is implemented as hGetChar stdin.

This operation may fail with the same errors as hGetChar.

Examples
Example1 expression
getChara'a'
Example1 expression
getChar>'\n'
valuegetContents :: IO String
#

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
Example1 expression
getContents >>= putStr> aaabbbccc :Daaabbbccc :D> I hope you have a great dayI hope you have a great day> ^D
Example1 expression
getContents >>= print . length> abc> <3> def ^D11
valuegetLine :: IO String
#

Read a line from the standard input device.

getLine is implemented as hGetLine stdin.

This operation may fail with the same errors as hGetLine.

Examples
Example1 expression
getLine> Hello World!"Hello World!"
Example1 expression
getLine>""
valueinteract :: (String -> String) -> IO ()
#

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.

Examples
Example1 expression
interact (\str -> str ++ str)> hi :)hi :)> ^Dhi :)
Example1 expression
interact (const ":D"):D
Example1 expression
interact (show . words)> hello world!> I hope you have a great day> ^D["hello","world!","I","hope","you","have","a","great","day"]
valueprint :: Show a => a -> IO ()
#

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

Example1 expression
print "λ :D""\995 :D"

A program to print the first 8 integers and their powers of 2 could be written as:

Example1 expression
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)]
valueputChar :: Char -> IO ()
#

Write a character to the standard output device

putChar is implemented as hPutChar stdout.

This operation may fail with the same errors as hPutChar.

Examples

Note that the following do not put a newline.

Example1 expression
putChar 'x'x
Example1 expression
putChar '\0042'*
valueputStr :: String -> IO ()
#

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.

Example1 expression
putStr "Hello, World!"Hello, World!
Example1 expression
putStr "\0052\0042\0050"4*2
valueputStrLn :: String -> IO ()
#

The same as putStr, but adds a newline character.

This operation may fail with the same errors, and has the same issues with concurrency, as hPutStr!

valuereadFile :: FilePath -> IO String
#

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
Example1 expression
readFile "~/hello_world""Greetings!"
Example1 expression
take 5 <$> readFile "/dev/zero""\NUL\NUL\NUL\NUL\NUL"
valuereadIO :: Read a => String -> IO a
#

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:

Examples
Example1 expression
fmap (+ 1) (readIO "1")2
Example1 expression
readIO "not quite ()" :: IO ()*** Exception: user error (Prelude.readIO: no parse)
valuereadLn :: Read a => IO a
#

The readLn function combines getLine and readIO.

This operation may fail with the same errors as getLine and readIO.

Examples
Example1 expression
fmap (+ 5) readLn> 2530
Example1 expression
readLn :: IO String> this is not a string literal*** Exception: user error (Prelude.readIO: no parse)
valuewriteFile :: FilePath -> String -> IO ()
#

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
Example1 expression
writeFile "hello" "world" >> readFile "hello""world"
Example1 expression
writeFile "~/" "D:"*** Exception: ~/: withFile: inappropriate type (Is a directory)
valueread :: Read a => String -> a
#

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.

Example1 expression
read "123" :: Int123
Example1 expression
read "hello" :: Int*** Exception: Prelude.read: no parse
valueeither :: (a %1 -> c) -> (b %1 -> c) -> Either a b %1 -> c
#
value(++) :: [a] %1 -> [a] %1 -> [a]
#
valueconcat :: [[a]] %1 -> [a]
#
valueconcatMap :: (a %1 -> [b]) -> [a] %1 -> [b]
#
valuecycle :: (HasCallStack, Dupable a) => [a] %1 -> [a]
#

Deprecated. The result cannot be consumed linearly, so this function is not useful.

valuefoldl :: (b %1 -> a %1 -> b) -> b %1 -> [a] %1 -> b
#
valuefoldl' :: (b %1 -> a %1 -> b) -> b %1 -> [a] %1 -> b
#
valuefoldr :: (a %1 -> b %1 -> b) -> b %1 -> [a] %1 -> b
#
valueiterate :: Dupable a => (a %1 -> a) -> a %1 -> [a]
#

Deprecated. The result cannot be consumed linearly, so this function is not useful.

valuemap :: (a %1 -> b) -> [a] %1 -> [b]
#
valuerepeat :: Dupable a => a %1 -> [a]
#

Deprecated. The result cannot be consumed linearly, so this function is not useful.

valuescanl :: Dupable b => (b %1 -> a %1 -> b) -> b %1 -> [a] %1 -> [b]
#
valuescanl1 :: Dupable a => (a %1 -> a %1 -> a) -> [a] %1 -> [a]
#
valuescanr :: Dupable b => (a %1 -> b %1 -> b) -> b %1 -> [a] %1 -> [b]
#
valuescanr1 :: Dupable a => (a %1 -> a %1 -> a) -> [a] %1 -> [a]
#
valueunzip :: [(a, b)] %1 -> ([a], [b])
#
valueunzip3 :: [(a, b, c)] %1 -> ([a], [b], [c])
#
valuezipFold
  1. :: a %1 -> b %1 -> r %1 -> r
  2. -> r
  3. -> a %1 -> [a] %1 -> r
  4. -> b %1 -> [b] %1 -> r
  5. -> [a]
  6. -> [b]
  7. -> r
#
valuemaybe :: b -> (a %1 -> b) -> Maybe a %1 -> b
#
valuegetAdded :: Adding a %1 -> a
#

Deprecated. Use Sum (reexported as Sum) and pattern-match to extract the inner value linearly

valueflip :: (a %p -> b %q -> c) %r -> b %q -> a %p -> c
#
value($) :: (a %p -> b) %q -> a %p -> b
#
value($!) :: (a %p -> b) %q -> a %p -> b
#
value(&) :: a %p -> (a %p -> b) %q -> b
#
value(.) :: (b %1 -> c) %q -> (a %1 -> b) %m -> a %n -> c
#
valueconst :: a %q -> b -> a
#
valuecurry :: ((a, b) %p -> c) %q -> a %p -> b %p -> c
#
valueforget :: (a %1 -> b) %1 -> a -> b
#
valueid :: a %q -> a
#
valueseq :: a -> b %q -> b
#
valueuncurry :: (a %p -> b %p -> c) %q -> (a, b) %p -> c
#
newtypenewtype First a
#

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
Example1 expression
First 0 <> First 10First {getFirst = 0}
Example1 expression
sconcat $ First 1 :| [ First n | n <- [2 ..] ]First {getFirst = 1}

Constructors

Instances38Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype Last a
#

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
Example1 expression
Last 0 <> Last 10Last {getLast = 10}
Example1 expression
sconcat $ Last 1 :| [ Last n | n <- [2..]]* Hangs forever *

Constructors

Instances38Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
datadata Either a b
#

The Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b.

The Either type is sometimes used to represent a value which is either correct or an error; by convention, the Left constructor is used to hold an error value and the Right constructor is used to hold a correct value (mnemonic: "right" also means "correct").

Examples

The type Either String Int is the type of values which can be either a String or an Int. The Left constructor can be used only on Strings, and the Right constructor can be used only on Ints:

Example6 expressions
let s = Left "foo" :: Either String IntsLeft "foo"let n = Right 3 :: Either String IntnRight 3:type ss :: Either String Int:type nn :: Either String Int

The fmap from our Functor instance will ignore Left values, but will apply the supplied function to values contained in a Right:

Example4 expressions
let s = Left "foo" :: Either String Intlet n = Right 3 :: Either String Intfmap (*2) sLeft "foo"fmap (*2) nRight 6

The Monad instance for Either allows us to chain together multiple actions which may fail, and fail overall if any of the individual steps failed. First we'll write a function that can either parse an Int from a Char, or fail.

Example3 expressions
import Data.Char ( digitToInt, isDigit ):{    let parseEither :: Char -> Either String Int        parseEither c          | isDigit c = Right (digitToInt c)          | otherwise = Left "parse error":}

The following should work, since both '1' and '2' can be parsed as Ints.

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

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

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

Constructors

Instances73Bifoldable, Bifoldable1, Bitraversable, Eq2, Ord2, Read2, …
methodnull :: t a -> Bool
#

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:

Example1 expression
null []True
Example1 expression
null [1]False

null is expected to terminate even for infinite structures. The default implementation terminates provided the structure is bounded on the left (there is a leftmost element).

Example1 expression
null [1..]False
newtypenewtype All
#

Boolean monoid under conjunction (&&).

All x <> All y = All (x && y)
Examples
Example1 expression
All True <> mempty <> All False)All {getAll = False}
Example1 expression
mconcat (map (\x -> All (even x)) [2,4,6,7,8])All {getAll = False}
Example1 expression
All True <> memptyAll {getAll = True}

Constructors

Instances27Bounded, Eq, Data, Ord, Read, Show, …
  • Bounded AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Data AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Ord AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Semigroup AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • NFData AllDefined in deepseq-1.5.1.0 · Control.DeepSeq
  • Arbitrary AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • CoArbitrary AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • Function AllDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function
  • Binary AllDefined in binary-0.8.9.3 · Data.Binary.Class
  • Unbox AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Generic AllDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Monoid AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Consumable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable
  • Dupable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Movable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Semigroup AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
  • MVector MVector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Vector Vector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep All = D1 ('MetaData "All" "GHC.Internal.Data.Semigroup.Internal" "ghc-internal" 'True) (C1 ('MetaCons "All" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • data MVector s AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector AllDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep All = D1 ('MetaData "All" "GHC.Internal.Data.Semigroup.Internal" "ghc-internal" 'True) (C1 ('MetaCons "All" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAll") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
newtypenewtype Any
#

Boolean monoid under disjunction (||).

Any x <> Any y = Any (x || y)
Examples
Example1 expression
Any True <> mempty <> Any FalseAny {getAny = True}
Example1 expression
mconcat (map (\x -> Any (even x)) [2,4,6,7,8])Any {getAny = True}
Example1 expression
Any False <> memptyAny {getAny = False}

Constructors

Instances27Bounded, Eq, Data, Ord, Read, Show, …
  • Bounded AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Eq AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Data AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Ord AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Generic AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Semigroup AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Monoid AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • NFData AnyDefined in deepseq-1.5.1.0 · Control.DeepSeq
  • Arbitrary AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • CoArbitrary AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • Function AnyDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function
  • Binary AnyDefined in binary-0.8.9.3 · Data.Binary.Class
  • Unbox AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Generic AnyDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Monoid AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Consumable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable
  • Dupable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Movable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Semigroup AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
  • MVector MVector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Vector Vector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep Any = D1 ('MetaData "Any" "GHC.Internal.Data.Semigroup.Internal" "ghc-internal" 'True) (C1 ('MetaCons "Any" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAny") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • data MVector s AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector AnyDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep Any = D1 ('MetaData "Any" "GHC.Internal.Data.Semigroup.Internal" "ghc-internal" 'True) (C1 ('MetaCons "Any" 'PrefixI 'True) (S1 ('MetaSel ('Just "getAny") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
newtypenewtype Dual a
#

The dual of a Monoid, obtained by swapping the arguments of (<>).

Dual a <> Dual b == Dual (b <> a)
Examples
Example1 expression
Dual "Hello" <> Dual "World"Dual {getDual = "WorldHello"}
Example1 expression
Dual (Dual "Hello") <> Dual (Dual "World")Dual {getDual = Dual {getDual = "HelloWorld"}}

Constructors

Instances39Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype Product a
#

Monoid under multiplication.

Product x <> Product y == Product (x * y)
Examples
Example1 expression
Product 3 <> Product 4 <> memptyProduct {getProduct = 12}
Example1 expression
mconcat [ Product n | n <- [2 .. 10]]Product {getProduct = 3628800}

Constructors

Instances42Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
newtypenewtype Sum a
#

Monoid under addition.

Sum a <> Sum b = Sum (a + b)
Examples
Example1 expression
Sum 1 <> Sum 2 <> memptySum {getSum = 3}
Example1 expression
mconcat [ Sum n | n <- [3 .. 9]]Sum {getSum = 42}

Constructors

Instances42Monad, Functor, MonadFix, Applicative, Foldable, Traversable, …
classclass IsString a where
#

IsString is used in combination with the -XOverloadedStrings language extension to convert the literals to different string types.

For example, if you use the text package, you can say

{-# LANGUAGE OverloadedStrings  #-}

myText = "hello world" :: Text

Internally, the extension will convert this to the equivalent of

myText = fromString @Text ("hello world" :: String)

Note: You can use fromString in normal code as well, but the usual performance/memory efficiency problems with String apply.

Methods

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

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

  • IsString ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal

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

  • IsString ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal

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

  • IsString DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • IsString TextDefined in text-2.1.3 · Data.Text · orphan

    Performs replacement on invalid scalar values:

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

    Performs replacement on invalid scalar values:

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

    Performs replacement on invalid scalar values:

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

    (a ~ Char) context was introduced in 4.9.0.0

  • IsString a => IsString (Const a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.String
classclass Bounded a where
#

The Bounded class is used to name the upper and lower limits of a type. Ord is not a superclass of Bounded since types that are not totally ordered may also have upper and lower bounds.

The Bounded class may be derived for any enumeration type; minBound is the first constructor listed in the data declaration and maxBound is the last. Bounded may also be derived for single-constructor datatypes whose constituent types are in Bounded.

Methods

Instances107Bounded, …
classclass Enum a where
#

Class Enum defines operations on sequentially ordered types.

The enumFrom... methods are used in Haskell's translation of arithmetic sequences.

Instances of Enum may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by fromEnum from 0 through n-1. See Chapter 10 of the Haskell Report for more details.

For any type that is an instance of class Bounded as well as Enum, the following should hold:

   enumFrom     x   = enumFromTo     x maxBound
   enumFromThen x y = enumFromThenTo x y bound
     where
       bound | fromEnum y >= fromEnum x = maxBound
             | otherwise                = minBound

Methods

  • succ :: a -> a

    Successor of a value. For numeric types, succ adds 1.

  • pred :: a -> a

    Predecessor of a value. For numeric types, pred subtracts 1.

  • toEnum :: Int -> a

    Convert from an Int.

  • fromEnum :: a -> Int

    Convert to an Int. It is implementation-dependent what fromEnum returns when applied to a value that is too large to fit in an Int.

  • enumFrom :: a -> [a]

    Used in Haskell's translation of [n..] with [n..] = enumFrom n, a possible implementation being enumFrom 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 being enumFromThen n n' = n : n' : worker (f x) (f x n'), worker s v = v : worker s (s v), x = fromEnum n' - fromEnum n and

      f n y
        | n > 0 = f (n - 1) (succ y)
        | n < 0 = f (n + 1) (pred y)
        | otherwise = y
      
    Examples
    • enumFromThen 4 6 :: [Integer] = [4,6,8,10...]
    • enumFromThen 6 2 :: [Int] = [6,2,-2,-6,...,minBound :: Int]
  • enumFromTo :: a -> a -> [a]

    Used in Haskell's translation of [n..m] with [n..m] = enumFromTo n m, a possible implementation being

      enumFromTo n m
         | n <= m = n : enumFromTo (succ n) m
         | otherwise = []
      
    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 being enumFromThenTo n n' m = worker (f x) (c x) n m, x = fromEnum n' - fromEnum n, c x = bool (>=) ((x 0)

      f n y
         | n > 0 = f (n - 1) (succ y)
         | n < 0 = f (n + 1) (pred y)
         | otherwise = y
      

    and

      worker s c v m
         | c v m = v : worker s c (s v) m
         | otherwise = []
      
    Examples
    • enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6]
    • enumFromThenTo 6 8 2 :: [Int] = []
Instances131Enum, …
  • Enum IoManagerFlagDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Enum IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum NaturalDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum ByteOrderDefined in ghc-internal-9.1401.0 · GHC.Internal.ByteOrder
  • Enum ClosureTypeDefined in ghc-internal-9.1401.0 · GHC.Internal.ClosureTypes
  • Enum CBoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CClockDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CDoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CFloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CIntDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CIntMaxDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CIntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CLLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CPtrdiffDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CSCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CSUSecondsDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CShortDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CSigAtomicDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CSizeDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CTimeDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CUCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CUIntDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CUIntMaxDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CUIntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CULLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CULongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CUSecondsDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CUShortDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum CWcharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Enum IntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Ptr
  • Enum WordPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Ptr
  • Enum AssociativityDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Enum DecidedStrictnessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Enum SourceStrictnessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Enum SourceUnpackednessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Enum HalfWordDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.InfoTable.Types
  • Enum SeekModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Device
  • Enum IOModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.IOMode
  • Enum IoSubSystemDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.SubSystem
  • Enum Int16Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Enum Int32Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Enum Int64Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Enum Int8Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Enum ExtensionDefined in ghc-internal-9.1401.0 · GHC.Internal.LanguageExtensions
  • Enum DoCostCentresDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Enum DoHeapProfileDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Enum DoTraceDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Enum GiveGCStatsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Enum IoManagerFlagDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Enum ByteOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.Constants
  • Enum WordOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.Constants
  • Enum ByteOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.ConstantsProf
  • Enum WordOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.ConstantsProf
  • Enum CBlkCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CBlkSizeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CCcDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CClockIdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CDevDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CFsBlkCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CFsFilCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CGidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CIdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CInoDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CKeyDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CModeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CNfdsDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CNlinkDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum COffDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CPidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CRLimDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CSocklenDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CSpeedDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CSsizeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CTcflagDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum CUidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum FdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Enum BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum CharDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

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

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

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

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

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

    Example1 expression
    [0..1.5 :: Float][0.0,1.0,2.0]
  • Enum IntDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum LevityDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum OrderingDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum VecCountDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum VecElemDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum WordDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum GeneralCategoryDefined in ghc-internal-9.1401.0 · GHC.Internal.Unicode
  • Enum Word16Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Enum Word32Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Enum Word64Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Enum Word8Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Enum GenericClassDefined in linear-generics-0.2.3 · Generics.Linear.TH.Internal
  • Enum CardinalityDefined in random-1.3.1 · System.Random.GFinite

    This is needed only as a superclass of Integral.

  • Enum I8Defined in text-2.1.3 · Data.Text.Foreign
  • Enum FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Enum ()Defined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum a => Enum (Blind a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (Negative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (NonNegative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (NonPositive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (NonZero a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (Positive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Enum a => Enum (First a)Defined in base-4.22.0.0 · Data.Semigroup
  • Enum a => Enum (Last a)Defined in base-4.22.0.0 · Data.Semigroup
  • Enum a => Enum (Max a)Defined in base-4.22.0.0 · Data.Semigroup
  • Enum a => Enum (Min a)Defined in base-4.22.0.0 · Data.Semigroup
  • Enum a => Enum (WrappedMonoid a)Defined in base-4.22.0.0 · Data.Semigroup
  • Enum a => Enum (And a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Enum a => Enum (Iff a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Enum a => Enum (Ior a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Enum a => Enum (Xor a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Enum a => Enum (Identity a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Identity
  • Enum a => Enum (a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Integral a => Enum (Ratio a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • (Enum a, Bounded a, Eq a) => Enum (Down a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Ord

    Swaps succ and pred of the underlying type.

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

    Recall that, for numeric types, succ and pred typically add and subtract 1, respectively. This is not true in the case of Fixed, whose successor and predecessor functions intuitively return the "next" and "previous" values in the enumeration. The results of these functions thus depend on the resolution of the Fixed value. For example, when enumerating values of resolution 10^-3 of type Milli = Fixed E3,

    Example1 expression
    succ (0.000 :: Milli)0.001

    and likewise

    Example1 expression
    pred (0.000 :: Milli)-0.001

    In other words, succ and pred increment and decrement a fixed-precision value by the least amount such that the value's resolution is unchanged. For example, 10^-12 is the smallest (positive) amount that can be added to a value of type Pico = Fixed E12 without changing its resolution, and so

    Example1 expression
    succ (0.000000000000 :: Pico)0.000000000001

    and similarly

    Example1 expression
    pred (0.000000000000 :: Pico)-0.000000000001

    This is worth bearing in mind when defining Fixed arithmetic sequences. In particular, you may be forgiven for thinking the sequence

      [1..10] :: [Pico]
    

    evaluates to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] :: [Pico].

    However, this is not true. On the contrary, similarly to the above implementations of succ and pred, enumFromTo :: Pico -> Pico -> [Pico] has a "step size" of 10^-12. Hence, the list [1..10] :: [Pico] has the form

      [1.000000000000, 1.00000000001, 1.00000000002, ..., 10.000000000000]
    

    and contains 9 * 10^12 + 1 values.

  • Enum (Proxy s)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Proxy
  • Enum (f a) => Enum (Ap f a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Monoid
  • Enum (f a) => Enum (Alt f a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Enum a => Enum (Const a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Const
  • Coercible a b => Enum (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • a ~ b => Enum (a :~: b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Equality
  • a ~~ b => Enum (a :~~: b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Equality
  • Enum (f (g a)) => Enum (Compose f g a)Defined in base-4.22.0.0 · Data.Functor.Compose
classclass Fractional a => Floating a where
#

Trigonometric and hyperbolic functions and related functions.

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

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

  • exp (fromInteger 0) = fromInteger 1

Methods

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

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

Methods

  • floatRadix :: a -> Integer

    a constant function, returning the radix of the representation (often 2)

  • floatDigits :: a -> Int

    a 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 x may assume for a normal x. The relation to IEEE emin and emax is floatRange 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 x yields (m,n), then x is equal in value to m*b^^n, where b is the floating-point radix, and furthermore, either m and n are both zero or else b^(d-1) <= abs m < b^d, where d is the value of floatDigits x. In particular, decodeFloat 0 = (0,0). If the type contains a negative zero, also decodeFloat (-0.0) = (0,0). The result of decodeFloat x is unspecified if either of isNaN x or isInfinite x is True.

  • encodeFloat :: Integer -> Int -> a

    encodeFloat performs the inverse of decodeFloat in the sense that for finite x with the exception of -0.0, Prelude.uncurry encodeFloat (decodeFloat x) = x. encodeFloat m n is one of the two closest representable floating-point numbers to m*b^^n (or ±Infinity if overflow occurs); usually the closer, but if m contains too many bits, the result may be rounded in the wrong direction.

  • exponent :: a -> Int

    exponent corresponds to the second component of decodeFloat. exponent 0 = 0 and for finite nonzero x, exponent x = snd (decodeFloat x) + floatDigits x. If x is a finite floating-point number, it is equal in value to significand x * b ^^ exponent x, where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values.

  • significand :: a -> a

    The first component of decodeFloat, scaled to lie in the open interval (-1,1), either 0.0 or of absolute value >= 1/b, where b is the floating-point radix. The behaviour is unspecified on infinite or NaN values.

  • scaleFloat :: Int -> a -> a

    multiplies a floating-point number by an integer power of the radix

  • isNaN :: a -> Bool

    True if the argument is an IEEE "not-a-number" (NaN) value

  • isInfinite :: a -> Bool

    True if the argument is an IEEE infinity or negative infinity

  • isDenormalized :: a -> Bool

    True if the argument is too small to be represented in normalized format

  • isNegativeZero :: a -> Bool

    True if the argument is an IEEE negative zero

  • isIEEE :: a -> Bool

    True if the argument is an IEEE floating point number

  • atan2 :: a -> a -> a

    a version of arctangent taking two real floating-point arguments. For real floating x and y, atan2 y x computes the angle (from the positive x-axis) of the vector from the origin to the point (x,y). atan2 y x returns a value in the range [-pi, pi]. It follows the Common Lisp semantics for the origin when signed zeroes are supported. atan2 y 1, with y in a type that is RealFloat, should return the same value as atan y. A default definition of atan2 is provided, but implementors can provide a more accurate implementation.

Instances8RealFloat, …
typetype FilePath = String
#

File and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.

classclass Read a where
#

Parsing of Strings, producing values.

Derived instances of Read make the following assumptions, which derived instances of Text.Show.Show obey:

  • If the constructor is defined to be an infix operator, then the derived Read instance will parse only infix applications of the constructor (not the prefix form).

  • Associativity is not used to reduce the occurrence of parentheses, although precedence may be.

  • If the constructor is defined using record syntax, the derived Read will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.

  • The derived Read instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.

For example, given the declarations

infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of Read in Haskell 2010 is equivalent to

instance (Read a) => Read (Tree a) where

        readsPrec d r =  readParen (d > app_prec)
                         (\r -> [(Leaf m,t) |
                                 ("Leaf",s) <- lex r,
                                 (m,t) <- readsPrec (app_prec+1) s]) r

                      ++ readParen (d > up_prec)
                         (\r -> [(u:^:v,w) |
                                 (u,s) <- readsPrec (up_prec+1) r,
                                 (":^:",t) <- lex s,
                                 (v,w) <- readsPrec (up_prec+1) t]) r

          where app_prec = 10
                up_prec = 5

Note that right-associativity of :^: is unused.

The derived instance in GHC is equivalent to

instance (Read a) => Read (Tree a) where

        readPrec = parens $ (prec app_prec $ do
                                 Ident "Leaf" <- lexP
                                 m <- step readPrec
                                 return (Leaf m))

                     +++ (prec up_prec $ do
                                 u <- step readPrec
                                 Symbol ":^:" <- lexP
                                 v <- step readPrec
                                 return (u :^: v))

          where app_prec = 10
                up_prec = 5

        readListPrec = readListPrecDefault

Why do both readsPrec and readPrec exist, and why does GHC opt to implement readPrec in derived Read instances instead of readsPrec? The reason is that readsPrec is based on the ReadS type, and although ReadS is mentioned in the Haskell 2010 Report, it is not a very efficient parser data structure.

readPrec, on the other hand, is based on a much more efficient ReadPrec datatype (a.k.a "new-style parsers"), but its definition relies on the use of the RankNTypes language extension. Therefore, readPrec (and its cousin, readListPrec) are marked as GHC-only. Nevertheless, it is recommended to use readPrec instead of readsPrec whenever possible for the efficiency improvements it brings.

As mentioned above, derived Read instances in GHC will implement readPrec instead of readsPrec. The default implementations of readsPrec (and its cousin, readList) will simply use readPrec under the hood. If you are writing a Read instance by hand, it is recommended to write it like so:

instance Read T where
  readPrec     = ...
  readListPrec = readListPrecDefault

Methods

  • readsPrec :: Int -> ReadS a

    attempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty.

    Derived instances of Read and Text.Show.Show satisfy the following:

    That is, readsPrec parses the string produced by showsPrec, and delivers the value that showsPrec started with.

  • readList :: ReadS [a]

    The method readList is provided to allow the programmer to give a specialised way of parsing lists of values. For example, this is used by the predefined Read instance of the Char type, where values of type String are expected to use double quotes, rather than square brackets.

Instances211Read, …
  • Read ASCIIStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read PrintableStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read UnicodeStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read QCGenDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Random
  • Read ArgsDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Test
  • Read GCDetailsDefined in base-4.22.0.0 · GHC.Stats
  • Read RTSStatsDefined in base-4.22.0.0 · GHC.Stats
  • Read ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Read ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Read ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Read IntSetDefined in containers-0.8 · Data.IntSet.Internal
  • Read VoidDefined in ghc-internal-9.1401.0 · GHC.Internal.Read

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

  • Read IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read NaturalDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read ByteOrderDefined in ghc-internal-9.1401.0 · GHC.Internal.ByteOrder
  • Read AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read VersionDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Version
  • Read CBoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CClockDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CDoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CFloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CIntDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CIntMaxDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CIntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CLLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CPtrdiffDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CSCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CSUSecondsDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CShortDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CSigAtomicDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CSizeDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CTimeDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CUCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CUIntDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CUIntMaxDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CUIntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CULLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CULongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CUSecondsDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CUShortDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read CWcharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Read IntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Ptr
  • Read WordPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Ptr
  • Read AssociativityDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read DecidedStrictnessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read FixityDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read SourceStrictnessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read SourceUnpackednessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read SeekModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Device
  • Read ExitCodeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Read BufferModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Types
  • Read NewlineDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Types
  • Read NewlineModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Types
  • Read IOModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.IOMode
  • Read Int16Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Read Int32Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Read Int64Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Read Int8Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Read GCDetailsDefined in ghc-internal-9.1401.0 · GHC.Internal.Stats
  • Read RTSStatsDefined in ghc-internal-9.1401.0 · GHC.Internal.Stats
  • Read CBlkCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CBlkSizeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CCcDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CClockIdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CDevDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CFsBlkCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CFsFilCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CGidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CIdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CInoDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CKeyDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CModeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CNfdsDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CNlinkDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read COffDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CPidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CRLimDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CSocklenDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CSpeedDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CSsizeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CTcflagDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read CUidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read FdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Read LexemeDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read SomeCharDefined in ghc-internal-9.1401.0 · GHC.Internal.TypeLits
  • Read SomeSymbolDefined in ghc-internal-9.1401.0 · GHC.Internal.TypeLits
  • Read SomeNatDefined in ghc-internal-9.1401.0 · GHC.Internal.TypeNats
  • Read BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read CharDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read IntDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read OrderingDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read WordDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read GeneralCategoryDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read Word16Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read Word32Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read Word64Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read Word8Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read SMGenDefined in splitmix-0.1.3.2 · System.Random.SplitMix
    Example1 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.SplitMix32
    Example1 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.3 · Data.Text.Foreign
  • Read TextDefined in text-2.1.3 · Data.Text · orphan
  • Read TextDefined in text-2.1.3 · Data.Text.Lazy · orphan
  • Read FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Read DatatypeVariantDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.Datatype
  • Read ()Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read a => Read (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (Negative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (NonEmptyList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (NonNegative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (NonPositive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (NonZero a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (OrderedList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (Positive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (SortedList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Read a => Read (Complex a)Defined in base-4.22.0.0 · Data.Complex
  • Read a => Read (First a)Defined in base-4.22.0.0 · Data.Semigroup
  • Read a => Read (Last a)Defined in base-4.22.0.0 · Data.Semigroup
  • Read a => Read (Max a)Defined in base-4.22.0.0 · Data.Semigroup
  • Read a => Read (Min a)Defined in base-4.22.0.0 · Data.Semigroup
  • Read a => Read (Seq a)Defined in containers-0.8 · Data.Sequence.Internal
  • Read a => Read (ViewL a)Defined in containers-0.8 · Data.Sequence.Internal
  • Read a => Read (ViewR a)Defined in containers-0.8 · Data.Sequence.Internal
  • Read a => Read (PostOrder a)Defined in containers-0.8 · Data.Tree
  • Read a => Read (Tree a)Defined in containers-0.8 · Data.Tree
  • Read a => Read (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read a => Read (And a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Read a => Read (Iff a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Read a => Read (Ior a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Read a => Read (Xor a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Read a => Read (Identity a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Identity

    This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

  • Read a => Read (First a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Monoid
  • Read a => Read (Last a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Monoid
  • Read a => Read (Down a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Ord

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

  • Read a => Read (Dual a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read a => Read (Product a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read a => Read (Sum a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read a => Read (ZipList a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Functor.ZipList
  • Read a => Read (Maybe a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read a => Read (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • Read a => Read (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Read a => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector
  • Read a => Read (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Strict
  • Read a => Read (a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read a => Read [a]Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read e => Read (IntMap e)Defined in containers-0.8 · Data.IntMap.Internal
  • Read m => Read (WrappedMonoid m)Defined in base-4.22.0.0 · Data.Semigroup
  • Read p => Read (Par1 p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read 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-9.1401.0 · GHC.Internal.Read
  • HasResolution a => Read (Fixed a)Defined in base-4.22.0.0 · Data.Fixed
  • Read (Proxy t)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Proxy
  • Read (U1 p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read (V1 p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Read1 f, Read a) => Read (Lift f a)Defined in transformers-0.6.1.2 · Control.Applicative.Lift
  • (Read1 m, Read a) => Read (MaybeT m a)Defined in transformers-0.6.1.2 · 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-9.1401.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.22.0.0 · Data.Semigroup
  • (Read a, Read b) => Read (Either a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Either
  • (Read a, Read b) => Read (a, b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Read (f a) => Read (Ap f a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Monoid
  • Read (f a) => Read (Alt f a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Read (f p) => Read (Rec1 f p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read a => Read (Const a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Const

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

  • Read a => Read (Constant a b)Defined in transformers-0.6.1.2 · Data.Functor.Constant
  • Coercible a b => Read (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • (Read1 f, Read a) => Read (Backwards f a)Defined in transformers-0.6.1.2 · Control.Applicative.Backwards
  • (Read1 f, Read a) => Read (IdentityT f a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Identity
  • (Read1 f, Read a) => Read (Reverse f a)Defined in transformers-0.6.1.2 · Data.Functor.Reverse
  • (Read a, Read b, Read c) => Read (a, b, c)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read e, Read1 m, Read a) => Read (ExceptT e m a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Except
  • (Read w, Read1 m, Read a) => Read (WriterT w m a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Writer.Lazy
  • (Read w, Read1 m, Read a) => Read (WriterT w m a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Writer.Strict
  • a ~ b => Read (a :~: b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Equality
  • Read (f a) => Read (MP1 m f a)Defined in linear-generics-0.2.3 · Generics.Linear.Class
  • Read c => Read (K1 i c p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Read (f a), Read (g a)) => Read (Product f g a)Defined in base-4.22.0.0 · Data.Functor.Product
  • (Read (f a), Read (g a)) => Read (Sum f g a)Defined in base-4.22.0.0 · Data.Functor.Sum
  • (Read (f p), Read (g p)) => Read ((:*:) f g p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Read (f p), Read (g p)) => Read ((:+:) f g p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Read a, Read b, Read c, Read d) => Read (a, b, c, d)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • a ~~ b => Read (a :~~: b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Equality
  • Read (f (g a)) => Read (Compose f g a)Defined in base-4.22.0.0 · Data.Functor.Compose
  • Read (f (g p)) => Read ((:.:) f g p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Read (f (g x)) => Read ((:.:) f g x)Defined in linear-generics-0.2.3 · Generics.Linear.Class
  • Read (f p) => Read (M1 i c f p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h) => Read (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i) => Read (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j) => Read (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k) => Read (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l) => Read (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • (Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n, Read o) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1401.0 · GHC.Internal.Read
classclass Num a => Fractional a where
#

Fractional numbers, supporting real division.

The Haskell Report defines no laws for Fractional. However, (+) and (*) are customarily expected to define a division ring and have the following properties:

recip gives the multiplicative inverse

x * recip x

=

recip x * x

=

fromInteger 1

Totality of toRational

toRational

is total

Coherence with toRational

if the type also implements

Real

, then

fromRational

is a left inverse for

toRational

, i.e.

fromRational (toRational i) = i

Note that it isn't customarily expected that a type instance of Fractional implement a field. However, all instances in base do.

Methods

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

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

    Example4 expressions
    0 == (-0 :: Double)Truerecip 0 == recip (-0 :: Double)Falsemap (/ 0) [-1, 0, 1][-Infinity,NaN,Infinity]map (* 0) $ map (/ 0) [-1, 0, 1][NaN,NaN,NaN]
  • Fractional FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

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

    Example4 expressions
    0 == (-0 :: Float)Truerecip 0 == recip (-0 :: Float)Falsemap (/ 0) [-1, 0, 1 :: Float][-Infinity,NaN,Infinity]map (* 0) $ map (/ 0) [-1, 0, 1 :: Float][NaN,NaN,NaN]
  • RealFloat a => Fractional (Complex a)Defined in base-4.22.0.0 · Data.Complex
  • Fractional a => Fractional (Identity a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Identity
  • Fractional a => Fractional (Down a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Ord
  • Integral a => Fractional (Ratio a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • HasResolution a => Fractional (Fixed a)Defined in base-4.22.0.0 · Data.Fixed
  • Fractional a => Fractional (Op a b)Defined in base-4.22.0.0 · Data.Functor.Contravariant
  • Fractional a => Fractional (Const a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Const
  • Fractional (f (g a)) => Fractional (Compose f g a)Defined in base-4.22.0.0 · Data.Functor.Compose
classclass (Real a, Enum a) => Integral a where
#

Integral numbers, supporting integer division.

The Haskell Report defines no laws for Integral. However, Integral instances are customarily expected to define a Euclidean domain and have the following properties for the div/mod and quot/rem pairs, given suitable Euclidean functions f and g:

  • x = y * quot x y + rem x y with rem x y = fromInteger 0 or g (rem x y) < g y

  • x = y * div x y + mod x y with mod x y = fromInteger 0 or f (mod x y) < f y

An example of a suitable Euclidean function, for Integer's instance, is abs.

In addition, toInteger should be total, and fromInteger should be a left inverse for it, i.e. fromInteger (toInteger i) = i.

Methods

  • quot :: a -> a -> ainfixl 7

    Integer 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 7

    Integer remainder, satisfying

    (x `quot` y)*y + (x `rem` y) == x

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

    Integer 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 7

    Integer modulus, satisfying

    (x `div` y)*y + (x `mod` y) == x

    WARNING: 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)

    Simultaneous quot and rem.

    WARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.

  • divMod :: a -> a -> (a, a)

    simultaneous div and mod.

    WARNING: This function is partial (because it throws when 0 is passed as the divisor) for all the integer types in base.

  • toInteger :: a -> Integer

    Conversion to Integer.

Instances71Integral, …
  • Integral IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Integral NaturalDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Integral CBoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CIntDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CIntMaxDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CIntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CLLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CPtrdiffDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CSCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CShortDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CSigAtomicDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CSizeDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CUCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CUIntDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CUIntMaxDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CUIntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CULLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CULongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CUShortDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral CWcharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Integral IntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Ptr
  • Integral WordPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Ptr
  • Integral HalfWordDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.InfoTable.Types
  • Integral Int16Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Integral Int32Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Integral Int64Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Integral Int8Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Integral ByteOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.Constants
  • Integral WordOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.Constants
  • Integral ByteOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.ConstantsProf
  • Integral WordOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.ConstantsProf
  • Integral CBlkCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CBlkSizeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CClockIdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CDevDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CFsBlkCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CFsFilCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CGidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CIdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CInoDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CKeyDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CModeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CNfdsDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CNlinkDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral COffDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CPidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CRLimDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CSocklenDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CSsizeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CTcflagDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral CUidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral FdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Integral IntDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Integral WordDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Integral Word16Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Integral Word32Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Integral Word64Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Integral Word8Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Integral CardinalityDefined in random-1.3.1 · System.Random.GFinite
  • Integral I8Defined in text-2.1.3 · Data.Text.Foreign
  • Integral a => Integral (Blind a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Integral a => Integral (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Integral a => Integral (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Integral a => Integral (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Integral a => Integral (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Integral a => Integral (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Integral a => Integral (Identity a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Identity
  • Integral a => Integral (Const a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Const
  • Integral (f (g a)) => Integral (Compose f g a)Defined in base-4.22.0.0 · Data.Functor.Compose
typetype Rational = Ratio Integer
#

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

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

Real numbers.

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

Coherence with fromRational

if the type also implements

Fractional

, then

fromRational

is a left inverse for

toRational

, i.e.

fromRational (toRational i) = i

The law does not hold for Float, Double, CFloat, CDouble, etc., because these types contain non-finite values, which cannot be roundtripped through Rational.

Methods

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

    Beware that toRational generates garbage for non-finite arguments:

    Example2 expressions
    toRational (1/0)179769313 (and 300 more digits...) % 1toRational (0/0)269653970 (and 300 more digits...) % 1
  • Real FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

    Beware that toRational generates garbage for non-finite arguments:

    Example2 expressions
    toRational (1/0 :: Float)340282366920938463463374607431768211456 % 1toRational (0/0 :: Float)510423550381407695195061911147652317184 % 1
  • Real IntDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Real WordDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Real Word16Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Real Word32Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Real Word64Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Real Word8Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Real CardinalityDefined in random-1.3.1 · System.Random.GFinite

    This is needed only as a superclass of Integral.

  • Real I8Defined in text-2.1.3 · Data.Text.Foreign
  • Integral a => Real (Ratio a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Real a => Real (Blind a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Real a => Real (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Real a => Real (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Real a => Real (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Real a => Real (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Real a => Real (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Real a => Real (Identity a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Identity
  • Real a => Real (Down a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Ord
  • HasResolution a => Real (Fixed a)Defined in base-4.22.0.0 · Data.Fixed
  • Real a => Real (Const a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Const
  • Real (f (g a)) => Real (Compose f g a)Defined in base-4.22.0.0 · Data.Functor.Compose
classclass (Real a, Fractional a) => RealFrac a where
#

Extracting components of fractions.

Methods

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

    Beware that results for non-finite arguments are garbage:

    Example2 expressions
    [ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0] ] :: [Int][0,0,0,0,0,0,0,0,0]map properFraction [-1/0, 0/0, 1/0] :: [(Int, Double)][(0,0.0),(0,0.0),(0,0.0)]

    and get even more non-sensical if you ask for Integer instead of Int.

  • RealFrac FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

    Beware that results for non-finite arguments are garbage:

    Example2 expressions
    [ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0 :: Float] ] :: [Int][0,0,0,0,0,0,0,0,0]map properFraction [-1/0, 0/0, 1/0] :: [(Int, Float)][(0,0.0),(0,0.0),(0,0.0)]

    and get even more non-sensical if you ask for Integer instead of Int.

  • Integral a => RealFrac (Ratio a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • RealFrac a => RealFrac (Identity a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Identity
  • RealFrac a => RealFrac (Down a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Ord
  • HasResolution a => RealFrac (Fixed a)Defined in base-4.22.0.0 · Data.Fixed
  • RealFrac a => RealFrac (Const a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Const
  • RealFrac (f (g a)) => RealFrac (Compose f g a)Defined in base-4.22.0.0 · Data.Functor.Compose
classclass Show a where
#

Conversion of values to readable Strings.

Derived instances of Show have the following properties, which are compatible with derived instances of Text.Read.Read:

  • The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.

  • If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.

  • the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression.

  • If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.

For example, given the declarations

infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of Show is equivalent to

instance (Show a) => Show (Tree a) where

       showsPrec d (Leaf m) = showParen (d > app_prec) $
            showString "Leaf " . showsPrec (app_prec+1) m
         where app_prec = 10

       showsPrec d (u :^: v) = showParen (d > up_prec) $
            showsPrec (up_prec+1) u .
            showString " :^: "      .
            showsPrec (up_prec+1) v
         where up_prec = 5

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

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

Methods

  • showsPrec :: Int -> a -> ShowS

    Convert a value to a readable String.

    showsPrec should satisfy the law

    showsPrec d x r ++ s  ==  showsPrec d x (r ++ s)

    Derived instances of Text.Read.Read and Show satisfy the following:

    That is, readsPrec parses the string produced by showsPrec, and delivers the value that showsPrec started with.

  • show :: a -> String

    A specialised variant of showsPrec, using precedence context zero, and returning an ordinary String.

  • showList :: [a] -> ShowS

    The method showList is provided to allow the programmer to give a specialised way of showing lists of values. For example, this is used by the predefined Show instance of the Char type, where values of type String should be shown in double quotes, rather than between square brackets.

Instances498Show, …
  • Show ASCIIStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show PrintableStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show UnicodeStringDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show ADefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Poly
  • Show BDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Poly
  • Show CDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Poly
  • Show OrdADefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Poly
  • Show OrdBDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Poly
  • Show OrdCDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Poly
  • Show WitnessDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Property
  • Show QCGenDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Random
  • Show ConfidenceDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.State
  • Show TestProgressDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.State
  • Show ArgsDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Test
  • Show ResultDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Test
  • Show CellDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Text
  • Show StrDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Text
  • Show ByteArrayDefined in base-4.22.0.0 · Data.Array.Byte
  • Show CCFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show ConcFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show DebugFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show DoCostCentresDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show DoHeapProfileDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show DoTraceDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show GCFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show GiveGCStatsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show HpcFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show IoManagerFlagDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show MiscFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show ParFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show ProfFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show RTSFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show TickyFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show TraceFlagsDefined in base-4.22.0.0 · GHC.RTS.Flags
  • Show GCDetailsDefined in base-4.22.0.0 · GHC.Stats
  • Show RTSStatsDefined in base-4.22.0.0 · GHC.Stats
  • Show TimeoutDefined in base-4.22.0.0 · System.Timeout
  • Show BuilderDefined in bytestring-0.12.2.0 · Data.ByteString.Builder · orphan
  • Show FormatModeDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat
  • Show FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.D2S
  • Show FloatingDecimalDefined in bytestring-0.12.2.0 · Data.ByteString.Builder.RealFloat.F2S
  • Show ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Show SizeOverflowExceptionDefined in bytestring-0.12.2.0 · Data.ByteString.Internal.Type
  • Show ByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Lazy.Internal
  • Show ShortByteStringDefined in bytestring-0.12.2.0 · Data.ByteString.Short.Internal
  • Show IntSetDefined in containers-0.8 · Data.IntSet.Internal
  • Show IntersectionDefined in containers-0.8 · Data.IntSet.Internal
  • Show BitQueueDefined in containers-0.8 · Utils.Containers.Internal.BitQueue
  • Show BitQueueBDefined in containers-0.8 · Utils.Containers.Internal.BitQueue
  • Show ForallVisFlagDefined in ghc-boot-th-9.14.1 · GHC.Boot.TH.Ppr
  • Show DocDefined in ghc-boot-th-9.14.1 · GHC.Boot.TH.PprLib
  • Show VoidDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show NaturalDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show ByteOrderDefined in ghc-internal-9.1401.0 · GHC.Internal.ByteOrder
  • Show ClosureTypeDefined in ghc-internal-9.1401.0 · GHC.Internal.ClosureTypes
  • Show BlockReasonDefined in ghc-internal-9.1401.0 · GHC.Internal.Conc.Sync
  • Show ThreadIdDefined in ghc-internal-9.1401.0 · GHC.Internal.Conc.Sync
  • Show ThreadStatusDefined in ghc-internal-9.1401.0 · GHC.Internal.Conc.Sync
  • Show NestedAtomicallyDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show NoMatchingContinuationPromptDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show NoMethodErrorDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show NonTerminationDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show PatternMatchFailDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show RecConErrorDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show RecSelErrorDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show RecUpdErrorDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show TypeErrorDefined in ghc-internal-9.1401.0 · GHC.Internal.Control.Exception.Base
  • Show ConstrDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Show ConstrRepDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Show DataRepDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Show DataTypeDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Show FixityDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Show DynamicDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Dynamic
  • Show AllDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show AnyDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show SomeTypeRepDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Typeable.Internal
  • Show VersionDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Version
  • Show ControlMessageDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Control
  • Show EPollFdDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.EPoll
  • Show EventDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.EPoll
  • Show EventTypeDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.EPoll
  • Show EventDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Internal.Types
  • Show EventLifetimeDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Internal.Types
  • Show LifetimeDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Internal.Types
  • Show TimeoutDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Internal.Types
  • Show FdKeyDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Manager
  • Show StateDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Manager
  • Show EventDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Poll
  • Show PollFdDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Poll
  • Show StateDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.TimerManager
  • Show UniqueDefined in ghc-internal-9.1401.0 · GHC.Internal.Event.Unique
  • Show ErrorCallDefined in ghc-internal-9.1401.0 · GHC.Internal.Exception
  • Show ArithExceptionDefined in ghc-internal-9.1401.0 · GHC.Internal.Exception.Type
  • Show SomeExceptionDefined in ghc-internal-9.1401.0 · GHC.Internal.Exception.Type
  • Show WhileHandlingDefined in ghc-internal-9.1401.0 · GHC.Internal.Exception.Type
  • Show FingerprintDefined in ghc-internal-9.1401.0 · GHC.Internal.Fingerprint.Type
  • Show CBoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CClockDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CDoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CFloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CIntDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CIntMaxDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CIntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CLLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CPtrdiffDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CSCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CSUSecondsDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CShortDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CSigAtomicDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CSizeDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CTimeDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CUCharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CUIntDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CUIntMaxDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CUIntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CULLongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CULongDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CUSecondsDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CUShortDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show CWcharDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.Types
  • Show IntPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Ptr
  • Show WordPtrDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Ptr
  • Show ForeignSrcLangDefined in ghc-internal-9.1401.0 · GHC.Internal.ForeignSrcLang
  • Show AssociativityDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show DecidedStrictnessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show FixityDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show SourceStrictnessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show SourceUnpackednessDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show BoxDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show PrimTypeDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show TsoFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show WhatNextDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show WhyBlockedDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show HalfWordDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.InfoTable.Types
  • Show StgInfoTableDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.InfoTable.Types
  • Show CostCentreDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.ProfInfo.Types
  • Show CostCentreStackDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.ProfInfo.Types
  • Show IndexTableDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.ProfInfo.Types
  • Show StgTSOProfInfoDefined in ghc-internal-9.1401.0 · GHC.Internal.Heap.ProfInfo.Types
  • Show MaskingStateDefined in ghc-internal-9.1401.0 · GHC.Internal.IO
  • Show SeekModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Device
  • Show CodingFailureModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Encoding.Failure
  • Show CodingProgressDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Encoding.Types
  • Show TextEncodingDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Encoding.Types
  • Show AllocationLimitExceededDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show ArrayExceptionDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show AssertionFailedDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show AsyncExceptionDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show BlockedIndefinitelyOnMVarDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show BlockedIndefinitelyOnSTMDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show CompactionFailedDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show DeadlockDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show ExitCodeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show FixIOExceptionDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show IOErrorTypeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show IOExceptionDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show SomeAsyncExceptionDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Exception
  • Show FDDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.FD
  • Show HandlePosnDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle
  • Show FileLockingNotSupportedDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Lock.Common
  • Show BufferModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Types
  • Show HandleDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Types
  • Show HandleTypeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Types
  • Show NewlineDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Types
  • Show NewlineModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.Handle.Types
  • Show IOModeDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.IOMode
  • Show IoSubSystemDefined in ghc-internal-9.1401.0 · GHC.Internal.IO.SubSystem
  • Show InfoProvDefined in ghc-internal-9.1401.0 · GHC.Internal.InfoProv.Types
  • Show Int16Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Show Int32Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Show Int64Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Show Int8Defined in ghc-internal-9.1401.0 · GHC.Internal.Int
  • Show ExtensionDefined in ghc-internal-9.1401.0 · GHC.Internal.LanguageExtensions
  • Show CCFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show ConcFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show DebugFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show DoCostCentresDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show DoHeapProfileDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show DoTraceDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show GCFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show GiveGCStatsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show HpcFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show IoManagerFlagDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show MiscFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show ParFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show ProfFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show RTSFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show TickyFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show TraceFlagsDefined in ghc-internal-9.1401.0 · GHC.Internal.RTS.Flags
  • Show FractionalExponentBaseDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Show ByteOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.Constants
  • Show WordOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.Constants
  • Show ByteOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.ConstantsProf
  • Show WordOffsetDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.ConstantsProf
  • Show PointernessDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.Decode
  • Show StackEntryDefined in ghc-internal-9.1401.0 · GHC.Internal.Stack.Decode
  • Show CallStackDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show SrcLocDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show StaticPtrInfoDefined in ghc-internal-9.1401.0 · GHC.Internal.StaticPtr
  • Show GCDetailsDefined in ghc-internal-9.1401.0 · GHC.Internal.Stats
  • Show RTSStatsDefined in ghc-internal-9.1401.0 · GHC.Internal.Stats
  • Show CBlkCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CBlkSizeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CCcDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CClockIdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CDevDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CFsBlkCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CFsFilCntDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CGidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CIdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CInoDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CKeyDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CModeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CNfdsDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CNlinkDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show COffDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CPidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CRLimDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CSocklenDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CSpeedDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CSsizeDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CTcflagDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CTimerDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show CUidDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show FdDefined in ghc-internal-9.1401.0 · GHC.Internal.System.Posix.Types
  • Show AnnLookupDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show AnnTargetDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show BangDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show BndrVisDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show BodyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show BytesDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show CallconvDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show ClauseDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show ConDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show DecDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show DecidedStrictnessDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show DerivClauseDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show DerivStrategyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show DocLocDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show ExpDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show FamilyResultSigDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show FixityDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show FixityDirectionDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show ForeignDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show FunDepDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show GuardDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show InfoDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show InjectivityAnnDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show InlineDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show LitDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show LocDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show MatchDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show ModNameDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show ModuleDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show ModuleInfoDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show NameDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show NameFlavourDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show NameSpaceDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show NamespaceSpecifierDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show OccNameDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show OverlapDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show PatDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show PatSynArgsDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show PatSynDirDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show PhasesDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show PkgNameDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show PragmaDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show RangeDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show RoleDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show RuleBndrDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show RuleMatchDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show SafetyDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show SourceStrictnessDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show SourceUnpackednessDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show SpecificityDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show StmtDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show TyLitDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show TySynEqnDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show TypeDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show TypeFamilyHeadDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show LexemeDefined in ghc-internal-9.1401.0 · GHC.Internal.Text.Read.Lex
  • Show NumberDefined in ghc-internal-9.1401.0 · GHC.Internal.Text.Read.Lex
  • Show SomeCharDefined in ghc-internal-9.1401.0 · GHC.Internal.TypeLits
  • Show SomeSymbolDefined in ghc-internal-9.1401.0 · GHC.Internal.TypeLits
  • Show SomeNatDefined in ghc-internal-9.1401.0 · GHC.Internal.TypeNats
  • Show BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show CharDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan
  • Show FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan
  • Show IntDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show KindRepDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show LevityDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show ModuleDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show OrderingDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show RuntimeRepDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show TrNameDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show TyConDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show TypeLitSortDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show VecCountDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show VecElemDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show WordDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show GeneralCategoryDefined in ghc-internal-9.1401.0 · GHC.Internal.Unicode
  • Show Word16Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Show Word32Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Show Word64Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Show Word8Defined in ghc-internal-9.1401.0 · GHC.Internal.Word
  • Show PSLDefined in linear-base-0.8.1 · Data.HashMap.Mutable.Linear.Internal
  • Show EncodingExceptionDefined in os-string-2.0.8 · System.OsString.Encoding.Internal
  • Show OsCharDefined in os-string-2.0.8 · System.OsString.Internal.Types
  • Show OsStringDefined in os-string-2.0.8 · System.OsString.Internal.Types

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

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

    Prints the raw bytes without decoding.

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

    Decodes as UCS-2.

  • Show ModeDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show StyleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show TextDetailsDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Show DocDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJ
  • Show PrettyLevelDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Show CardinalityDefined in random-1.3.1 · System.Random.GFinite
  • Show StdGenDefined in random-1.3.1 · System.Random.Internal
  • Show SMGenDefined in splitmix-0.1.3.2 · System.Random.SplitMix
  • Show SMGenDefined in splitmix-0.1.3.2 · System.Random.SplitMix32
  • Show DecodingDefined in text-2.1.3 · Data.Text.Encoding
  • Show UnicodeExceptionDefined in text-2.1.3 · Data.Text.Encoding.Error
  • Show I8Defined in text-2.1.3 · Data.Text.Foreign
  • Show TextDefined in text-2.1.3 · Data.Text.Show · orphan
  • Show BuilderDefined in text-2.1.3 · Data.Text.Internal.Builder
  • Show PartialUtf8CodePointDefined in text-2.1.3 · Data.Text.Internal.Encoding
  • Show Utf8StateDefined in text-2.1.3 · Data.Text.Internal.Encoding
  • Show DecoderStateDefined in text-2.1.3 · Data.Text.Internal.Encoding.Utf8
  • Show SizeDefined in text-2.1.3 · Data.Text.Internal.Fusion.Size
  • Show TextDefined in text-2.1.3 · Data.Text.Lazy · orphan
  • Show FPFormatDefined in text-2.1.3 · Data.Text.Lazy.Builder.RealFloat
  • Show IterDefined in text-2.1.3 · Data.Text.Unsafe
  • Show ConstructorInfoDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.Datatype
  • Show ConstructorVariantDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.Datatype
  • Show DatatypeInfoDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.Datatype
  • Show DatatypeVariantDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.Datatype
  • Show FieldStrictnessDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.Datatype
  • Show StrictnessDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.Datatype
  • Show UnpackednessDefined in th-abstraction-0.7.2.0 · Language.Haskell.TH.Datatype
  • Show SizeDefined in vector-0.13.2.0 · Data.Vector.Fusion.Bundle.Size
  • Show ()Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show (Blind a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show (ConstPtr a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.C.ConstPtr
  • Show (ForeignPtr a)Defined in ghc-internal-9.1401.0 · GHC.Internal.ForeignPtr
  • Show (FunPtr a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Ptr
  • Show (Ptr a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Ptr
  • Show (SChar c)Defined in ghc-internal-9.1401.0 · GHC.Internal.TypeLits
  • Show (SSymbol s)Defined in ghc-internal-9.1401.0 · GHC.Internal.TypeLits
  • Show (SNat n)Defined in ghc-internal-9.1401.0 · GHC.Internal.TypeNats
  • Show (Doc a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show (Seed g)Defined in random-1.3.1 · System.Random.Internal
  • Show a => Show (Fixed a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (InfiniteList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (Large a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (Negative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (NoShrink a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (NonEmptyList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (NonNegative a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (NonPositive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (NonZero a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (OrderedList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (Positive a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (Shrink2 a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (Small a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (Smart a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (SortedList a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show a => Show (Complex a)Defined in base-4.22.0.0 · Data.Complex
  • Show a => Show (First a)Defined in base-4.22.0.0 · Data.Semigroup
  • Show a => Show (Last a)Defined in base-4.22.0.0 · Data.Semigroup
  • Show a => Show (Max a)Defined in base-4.22.0.0 · Data.Semigroup
  • Show a => Show (Min a)Defined in base-4.22.0.0 · Data.Semigroup
  • Show a => Show (Decoder a)Defined in binary-0.8.9.3 · Data.Binary.Get.Internal
  • Show a => Show (IntMap a)Defined in containers-0.8 · Data.IntMap.Internal
  • Show a => Show (Seq a)Defined in containers-0.8 · Data.Sequence.Internal
  • Show a => Show (ViewL a)Defined in containers-0.8 · Data.Sequence.Internal
  • Show a => Show (ViewR a)Defined in containers-0.8 · Data.Sequence.Internal
  • Show a => Show (Intersection a)Defined in containers-0.8 · Data.Set.Internal
  • Show a => Show (Set a)Defined in containers-0.8 · Data.Set.Internal
  • Show a => Show (PostOrder a)Defined in containers-0.8 · Data.Tree
  • Show a => Show (Tree a)Defined in containers-0.8 · Data.Tree
  • Show a => Show (ExitCase a)Defined in exceptions-0.10.11 · Control.Monad.Catch
  • Show a => Show (NonEmpty a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show a => Show (And a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Show a => Show (Iff a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Show a => Show (Ior a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Show a => Show (Xor a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Bits
  • Show a => Show (Identity a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Identity

    This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

  • Show a => Show (First a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Monoid
  • Show a => Show (Last a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Monoid
  • Show a => Show (Down a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Ord

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

  • Show a => Show (Dual a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show a => Show (Product a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show a => Show (Sum a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show a => Show (ExceptionWithContext a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Exception.Type
  • Show a => Show (ZipList a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Functor.ZipList
  • Show a => Show (Maybe a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show a => Show (Ratio a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Show a => Show (Hashed a)Defined in hashable-1.5.1.0 · Data.Hashable.Class
  • Show a => Show (Adding a)Defined in linear-base-0.8.1 · Data.Num.Linear
  • Show a => Show (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.Linear
  • Show a => Show (AnnotDetails a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show a => Show (Span a)Defined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJ
  • Show a => Show (Array a)Defined in primitive-0.9.1.0 · Data.Primitive.Array
  • Show a => Show (SmallArray a)Defined in primitive-0.9.1.0 · Data.Primitive.SmallArray
  • Show a => Show (Tuple a)Defined in storable-record-0.0.7 · Foreign.Storable.Record.Tuple
  • Show a => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector
  • Show a => Show (Vector a)Defined in vector-0.13.2.0 · Data.Vector.Strict
  • Show a => Show (a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show a => Show [a]Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show b => Show (GenClosure b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show b => Show (GenStackField b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show b => Show (GenStackFrame b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show b => Show (GenStgStackClosure b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Heap.Closures
  • Show e => Show (NoBacktrace e)Defined in ghc-internal-9.1401.0 · GHC.Internal.Exception.Type
  • Show flag => Show (TyVarBndr flag)Defined in ghc-internal-9.1401.0 · GHC.Internal.TH.Syntax
  • Show g => Show (StateGen g)Defined in random-1.3.1 · System.Random.Internal
  • Show g => Show (AtomicGen g)Defined in random-1.3.1 · System.Random.Stateful
  • Show g => Show (IOGen g)Defined in random-1.3.1 · System.Random.Stateful
  • Show g => Show (STGen g)Defined in random-1.3.1 · System.Random.Stateful
  • Show g => Show (TGen g)Defined in random-1.3.1 · System.Random.Stateful
  • Show m => Show (WrappedMonoid m)Defined in base-4.22.0.0 · Data.Semigroup
  • Show p => Show (Par1 p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show 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 · orphan
  • HasResolution a => Show (Fixed a)Defined in base-4.22.0.0 · Data.Fixed
  • Show (Proxy s)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Proxy
  • Show (TypeRep a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Typeable.Internal
  • Show (U1 p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (UAddr p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (V1 p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (ST s a)Defined in ghc-internal-9.1401.0 · GHC.Internal.ST
  • Show (a -> b)Defined in base-4.22.0.0 · Text.Show.Functions · orphan
  • Show a => Show (Shrinking s a)Defined in QuickCheck-2.19.0.0 · Test.QuickCheck.Modifiers
  • Show 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.1.2 · Control.Applicative.Lift
  • (Show1 m, Show a) => Show (MaybeT m a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Maybe
  • (Ix a, Show a, Show b) => Show (Array a b)Defined in ghc-internal-9.1401.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.22.0.0 · Data.Semigroup
  • (Show a, Show b) => Show (Either a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Either
  • (Show a, Show b) => Show (a, b)Defined in ghc-internal-9.1401.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.Internal
  • Show (Coercion a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Coercion
  • Show (OrderingI a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Ord
  • Show (URec Char p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (URec Double p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (URec Float p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (URec Int p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (URec Word p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (a :~: b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Equality
  • Show (f a) => Show (Ap f a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Monoid
  • Show (f a) => Show (Alt f a)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Semigroup.Internal
  • Show (f p) => Show (Rec1 f p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show a => Show (Const a b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Functor.Const

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

  • Show a => Show (Constant a b)Defined in transformers-0.6.1.2 · Data.Functor.Constant
  • (Show1 f, Show a) => Show (Backwards f a)Defined in transformers-0.6.1.2 · Control.Applicative.Backwards
  • (Show1 f, Show a) => Show (IdentityT f a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Identity
  • (Show1 f, Show a) => Show (Reverse f a)Defined in transformers-0.6.1.2 · Data.Functor.Reverse
  • (Show a, Show b, Show c) => Show (a, b, c)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show e, Show1 m, Show a) => Show (ExceptT e m a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Except
  • (Show w, Show1 m, Show a) => Show (WriterT w m a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Writer.Lazy
  • (Show w, Show1 m, Show a) => Show (WriterT w m a)Defined in transformers-0.6.1.2 · Control.Monad.Trans.Writer.Strict
  • Show (a :~~: b)Defined in ghc-internal-9.1401.0 · GHC.Internal.Data.Type.Equality
  • Show (f a) => Show (MP1 m f a)Defined in linear-generics-0.2.3 · Generics.Linear.Class
  • Show c => Show (K1 i c p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Show (f a), Show (g a)) => Show (Product f g a)Defined in base-4.22.0.0 · Data.Functor.Product
  • (Show (f a), Show (g a)) => Show (Sum f g a)Defined in base-4.22.0.0 · Data.Functor.Sum
  • (Show (f p), Show (g p)) => Show ((:*:) f g p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Show (f p), Show (g p)) => Show ((:+:) f g p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Show a, Show b, Show c, Show d) => Show (a, b, c, d)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Show (f (g a)) => Show (Compose f g a)Defined in base-4.22.0.0 · Data.Functor.Compose
  • Show (f (g p)) => Show ((:.:) f g p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (f (g x)) => Show ((:.:) f g x)Defined in linear-generics-0.2.3 · Generics.Linear.Class
  • Show (f p) => Show (M1 i c f p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • (Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)Defined in ghc-internal-9.1401.0 · GHC.Internal.Show
typetype ShowS = String -> String
#

The shows functions return a function that prepends the output String to an existing String. This allows constant-time concatenation of results using function composition.

typetype ReadS a = String -> [(a, String)]
#

A parser for a type a, represented as a function that takes a String and returns a list of possible parses as (a,String) pairs.

Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf ReadP).

newtypenewtype IO a
#

A value of type IO a is a computation which, when performed, does some I/O before returning a value of type a.

There is really only one way to "perform" an I/O action: bind it to Main.main in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the IO monad and called at some point, directly or indirectly, from Main.main.

IO is a monad, so IO actions can be combined using either the do-notation or the Prelude.>> and Prelude.>>= operations from the Prelude.Monad class.

Instances42Monad, Functor, MonadFix, MonadFail, Applicative, GHCiSandboxIO, …
datadata Ordering
#
Instances30Bounded, Enum, Data, Read, Show, Ix, …
classclass Semigroup a => Monoid a where
#

Methods

Instances31Monoid, …
  • Monoid AllDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid AnyDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid OrderingDefined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid ()Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid a => Monoid (Ur a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid (Array a)Defined in linear-base-0.8.1 · Data.Array.Polarized.Push
  • Monoid (ArrayWriter a)Defined in linear-base-0.8.1 · Data.Array.Polarized.Push
  • Monoid (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid [a]Defined in linear-base-0.8.1 · Data.List.Linear · orphan
  • Monoid a => Monoid (Identity a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid a => Monoid (Down a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid a => Monoid (Dual a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Monoid a => Monoid (IO a)Defined in linear-base-0.8.1 · System.IO.Linear
  • Monoid a => Monoid (RIO a)Defined in linear-base-0.8.1 · System.IO.Resource.Linear.Internal
  • Semigroup a => Monoid (Maybe a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • AddIdentity a => Monoid (Sum a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphan
  • AddIdentity a => Monoid (Adding a)Defined in linear-base-0.8.1 · Data.Num.Linear
  • MultIdentity a => Monoid (Product a)Defined in linear-base-0.8.1 · Data.Num.Linear · orphan
  • MultIdentity a => Monoid (Multiplying a)Defined in linear-base-0.8.1 · Data.Num.Linear
  • Consumable a => Monoid (First a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Consumable 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.Instances
  • Monoid (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.Monoid
  • Monoid 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.Monoid
  • Monoid (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
newtypenewtype Endo a
#

Constructors

Instances4Monoid, Semigroup
  • Semigroup (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
  • Monoid (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid · orphan
  • Monoid (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Monoid
  • Semigroup (Endo a)Defined in linear-base-0.8.1 · Data.Monoid.Linear.Internal.Semigroup
classclass Semigroup a where
#

Methods

  • (<>) :: a %1 -> a %1 -> ainfixr 6
Instances41Semigroup, …
classclass Additive a => AddIdentity a where
#

Methods

Instances15AddIdentity, …
newtypenewtype Adding a
#

Deprecated. Use Sum (reexported as Sum) instead

Constructors

Instances7Eq, Ord, Show, Monoid, Semigroup, …
classclass Additive a where
#

Methods

  • (+) :: a %1 -> a %1 -> ainfixl 6
Instances15Additive, …
classclass AddIdentity a => AdditiveGroup a where
#

Methods

  • negate :: a %1 -> a
  • (-) :: a %1 -> a %1 -> ainfixl 6
Instances15AdditiveGroup, …
classclass FromInteger a where
#

Methods

Instances15FromInteger, …
classclass Multiplicative a => MultIdentity a where
#

Methods

Instances15MultIdentity, …
classclass Multiplicative a where
#

Methods

  • (*) :: a %1 -> a %1 -> ainfixl 7
Instances15Multiplicative, …
newtypenewtype Multiplying a
#

Deprecated. Use Product (reexported as Product) instead

Constructors

Instances7Eq, Ord, Show, Monoid, Semigroup, …
classclass (Ring a, FromInteger a) => Num a where
#

Methods

Instances14Num, …
  • Num IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • Num Int16Defined in linear-base-0.8.1 · Data.Num.Linear
  • Num Int32Defined in linear-base-0.8.1 · Data.Num.Linear
  • Num Int64Defined in linear-base-0.8.1 · Data.Num.Linear
  • Num Int8Defined in linear-base-0.8.1 · Data.Num.Linear
  • Num DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • Num FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • Num IntDefined in linear-base-0.8.1 · Data.Num.Linear
  • Num WordDefined in linear-base-0.8.1 · Data.Num.Linear
  • Num Word16Defined in linear-base-0.8.1 · Data.Num.Linear
  • Num Word32Defined in linear-base-0.8.1 · Data.Num.Linear
  • Num Word64Defined in linear-base-0.8.1 · Data.Num.Linear
  • Num 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
classclass (AdditiveGroup a, Semiring a) => Ring a
#
Instances14Ring, …
  • Ring IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • Ring Int16Defined in linear-base-0.8.1 · Data.Num.Linear
  • Ring Int32Defined in linear-base-0.8.1 · Data.Num.Linear
  • Ring Int64Defined in linear-base-0.8.1 · Data.Num.Linear
  • Ring Int8Defined in linear-base-0.8.1 · Data.Num.Linear
  • Ring DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • Ring FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • Ring IntDefined in linear-base-0.8.1 · Data.Num.Linear
  • Ring WordDefined in linear-base-0.8.1 · Data.Num.Linear
  • Ring Word16Defined in linear-base-0.8.1 · Data.Num.Linear
  • Ring Word32Defined in linear-base-0.8.1 · Data.Num.Linear
  • Ring Word64Defined in linear-base-0.8.1 · Data.Num.Linear
  • Ring 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
classclass (AddIdentity a, MultIdentity a) => Semiring a
#
Instances15Semiring, …
classclass Eq a where
#

Methods

  • (==) :: a %1 -> a %1 -> Boolinfix 4
  • (/=) :: a %1 -> a %1 -> Boolinfix 4
Instances24Eq, …
  • Eq Int16Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq Int32Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq Int64Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq Int8Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq BoolDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq CharDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq DoubleDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq IntDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq OrderingDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq Word16Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq Word32Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq Word64Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq Word8Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq ()Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Eq 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
classclass Eq a => Ord a where
#

Methods

Instances23Ord, …
  • Ord Int16Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord Int32Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord Int64Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord Int8Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord BoolDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord CharDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord DoubleDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord IntDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord OrderingDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord Word16Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord Word32Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord Word64Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord Word8Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord ()Defined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Ord 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
classclass Consumable a where
#

Methods

Instances60Consumable, …
classclass Consumable a => Dupable a where
#

Methods

Instances46Dupable, …
  • Dupable ByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable ShortByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable NaturalDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable Int16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable Int32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable Int64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable Int8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable CharDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable IntDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable OrderingDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable WordDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable Word16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable Word32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable Word64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable Word8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable PoolDefined in linear-base-0.8.1 · Foreign.Marshal.Pure.Internal
  • Dupable TextDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable ()Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable (Array a)Defined in linear-base-0.8.1 · Data.Array.Mutable.Linear.Internal
  • Dupable (Replicator a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable (ReplicationStream a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable (Set a)Defined in linear-base-0.8.1 · Data.Set.Mutable.Linear.Internal
  • Dupable (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable (Vector a)Defined in linear-base-0.8.1 · Data.Vector.Mutable.Linear.Internal
  • Dupable a => Dupable (NonEmpty a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable a => Dupable (Product a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable a => Dupable (Sum a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable a => Dupable (Maybe a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable a => Dupable (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
  • Dupable a => Dupable (a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Dupable a => Dupable [a]Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Movable 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.Dupable
  • Dupable (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
classclass Dupable a => Movable a where
#

Methods

Instances38Movable, …
  • Movable ByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable ShortByteStringDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable NaturalDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable AllDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable AnyDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable Int16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable Int32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable Int64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable Int8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable CharDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable IntDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable OrderingDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable WordDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable Word16Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable Word32Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable Word64Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable Word8Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable TextDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Movable ()Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable (Ur a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable a => Movable (NonEmpty a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable a => Movable (Product a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable a => Movable (Sum a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable a => Movable (Maybe a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable a => Movable (MovableNum a)Defined in linear-base-0.8.1 · Data.Num.Linear
  • Movable a => Movable (AsMovable a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances
  • Movable a => Movable (a)Defined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Movable 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
datadata Ur a where
#

Constructors

Instances24Monad, Foldable, Traversable, Functor, Applicative, Generic1, …
typetype String = [Char]
#

String is an alias for a list of characters.

String constants in Haskell are values of type String. That means if you write a string literal like "hello world", it will have the type [Char], which is the same as String.

Note: You can ask the compiler to automatically infer different types with the -XOverloadedStrings language extension, for example "hello world" :: Text. See IsString for more information.

Because String is just a list of characters, you can use normal list functions to do basic string manipulation. See Data.List for operations on lists.

Performance considerations

[Char] is a relatively memory-inefficient type. It is a linked list of boxed word-size characters, internally it looks something like:

╭─────┬───┬──╮  ╭─────┬───┬──╮  ╭─────┬───┬──╮  ╭────╮
│ (:) │   │ ─┼─>│ (:) │   │ ─┼─>│ (:) │   │ ─┼─>│ [] │
╰─────┴─┼─┴──╯  ╰─────┴─┼─┴──╯  ╰─────┴─┼─┴──╯  ╰────╯
        v               v               v
       'a'             'b'             'c'

The String "abc" will use 5*3+1 = 16 (in general 5n+1) words of space in memory.

Furthermore, operations like (++) (string concatenation) are O(n) (in the left argument).

For historical reasons, the base library uses String in a lot of places for the conceptual simplicity, but library code dealing with user-data should use the text package for Unicode text, or the the bytestring package for binary data.

datadata Integer
#

Arbitrary precision integers. In contrast with fixed-size integral types such as Int, the Integer type represents the entire infinite range of integers.

Integers are stored in a kind of sign-magnitude form, hence do not expect two's complement form when using bit operations.

If the value is small (i.e., fits into an Int), the IS constructor is used. Otherwise IP and IN constructors are used to store a BigNat representing the positive or the negative value magnitude, respectively.

Invariant: IP and IN are used iff the value does not fit in IS.

Instances35Enum, Eq, Integral, Data, Ord, Read, …
  • Enum IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Eq IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Bignum.Integer
  • Integral IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Data IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Num IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Num
  • Ord IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Bignum.Integer
  • Read IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Real IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Real
  • Show IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Ix IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Ix
  • Bits IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.Bits
  • PrintfArg IntegerDefined in base-4.22.0.0 · Text.Printf
  • NFData IntegerDefined in deepseq-1.5.1.0 · Control.DeepSeq
  • Pretty IntegerDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Pretty IntegerDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Random IntegerDefined in random-1.3.1 · System.Random

    Note - random generates values in the Int range

  • UniformRange IntegerDefined in random-1.3.1 · System.Random.Internal
  • Arbitrary IntegerDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • CoArbitrary IntegerDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • Function IntegerDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function
  • Binary IntegerDefined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable IntegerDefined in hashable-1.5.1.0 · Data.Hashable.Class
  • Consumable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Dupable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • MultIdentity IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • Movable IntegerDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Instances · orphan
  • Multiplicative IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • AddIdentity IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • Additive IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • AdditiveGroup IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • FromInteger IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • Num IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • Ring IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • Semiring IntegerDefined in linear-base-0.8.1 · Data.Num.Linear
  • Lift IntegerDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Lift
datadata Maybe a
#

The Maybe type encapsulates an optional value. A value of type Maybe a either contains a value of type a (represented as Just a), or it is empty (represented as Nothing). Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error.

The Maybe type is also a monad. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Either type.

Constructors

Instances64Monad, MonadFix, MonadFail, Applicative, Foldable, Alternative, …
datadata Bool
#
Instances47Bounded, Enum, Data, Read, Show, Ix, …
  • Bounded BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Enum BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Enum
  • Eq BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Classes
  • Data BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Ord BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Classes
  • Read BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Show BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Show
  • Ix BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Ix
  • Generic BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Bits BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Bits

    Interpret Bool as 1-bit bit-field

  • FiniteBits BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Bits
  • Storable BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Storable
  • SingKind BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • NFData BoolDefined in deepseq-1.5.1.0 · Control.DeepSeq
  • Pretty BoolDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Pretty BoolDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Random BoolDefined in random-1.3.1 · System.Random
  • Finite BoolDefined in random-1.3.1 · System.Random.GFinite
  • Uniform BoolDefined in random-1.3.1 · System.Random.Internal
  • UniformRange BoolDefined in random-1.3.1 · System.Random.Internal
  • Arbitrary BoolDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • CoArbitrary BoolDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • Function BoolDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function
  • Testable BoolDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Property
  • Binary BoolDefined in binary-0.8.9.3 · Data.Binary.Class
  • Hashable BoolDefined in hashable-1.5.1.0 · Data.Hashable.Class
  • Unbox BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Generic BoolDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Consumable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable
  • Dupable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • Movable BoolDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Eq BoolDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Ord BoolDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Lift BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Lift
  • SingI 'FalseDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • SingI 'TrueDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • IArray UArray BoolDefined in array-0.5.8.0 · Data.Array.Base
  • MVector MVector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Vector Vector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Bool IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • MArray (STUArray s) Bool (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • type Rep Bool = D1 ('MetaData "Bool" "GHC.Internal.Types" "ghc-internal" 'False) (C1 ('MetaCons "False" 'PrefixI 'False) U1 :+: C1 ('MetaCons "True" 'PrefixI 'False) U1)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • type DemoteRep Bool = BoolDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • data Sing
    • STrue :: R:SingBoola 'True
    • SFalse :: R:SingBoola 'False
    Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • data MVector s BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector BoolDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep Bool = D1 ('MetaData "Bool" "GHC.Internal.Types" "ghc-internal" 'False) (C1 ('MetaCons "False" 'PrefixI 'False) U1 :+: C1 ('MetaCons "True" 'PrefixI 'False) U1)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
datadata Char
#

The character type Char represents Unicode codespace and its elements are code points as in definitions D9 and D10 of the Unicode Standard.

Character literals in Haskell are single-quoted: 'Q', 'Я' or 'Ω'. To represent a single quote itself use '\'', and to represent a backslash use '\\'. The full grammar can be found in the section 2.6 of the Haskell 2010 Language Report.

To specify a character by its code point one can use decimal, hexadecimal or octal notation: '\65', '\x41' and '\o101' are all alternative forms of 'A'. The largest code point is '\x10ffff'.

There is a special escape syntax for ASCII control characters:

Escape

Alternatives

Meaning

'\NUL'

'\0'

null character

'\SOH'

'\1'

start of heading

'\STX'

'\2'

start of text

'\ETX'

'\3'

end of text

'\EOT'

'\4'

end of transmission

'\ENQ'

'\5'

enquiry

'\ACK'

'\6'

acknowledge

'\BEL'

'\7'

,

'\a'

bell (alert)

'\BS'

'\8'

,

'\b'

backspace

'\HT'

'\9'

,

'\t'

horizontal tab

'\LF'

'\10'

,

'\n'

line feed (new line)

'\VT'

'\11'

,

'\v'

vertical tab

'\FF'

'\12'

,

'\f'

form feed

'\CR'

'\13'

,

'\r'

carriage return

'\SO'

'\14'

shift out

'\SI'

'\15'

shift in

'\DLE'

'\16'

data link escape

'\DC1'

'\17'

device control 1

'\DC2'

'\18'

device control 2

'\DC3'

'\19'

device control 3

'\DC4'

'\20'

device control 4

'\NAK'

'\21'

negative acknowledge

'\SYN'

'\22'

synchronous idle

'\ETB'

'\23'

end of transmission block

'\CAN'

'\24'

cancel

'\EM'

'\25'

end of medium

'\SUB'

'\26'

substitute

'\ESC'

'\27'

escape

'\FS'

'\28'

file separator

'\GS'

'\29'

group separator

'\RS'

'\30'

record separator

'\US'

'\31'

unit separator

'\SP'

'\32'

,

' '

space

'\DEL'

'\127'

delete

Data.Char provides utilities to work with Char.

Instances58Bounded, Enum, Data, Read, Ix, Storable, …
datadata Double
#

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

Instances65Enum, Floating, Fractional, Data, Read, Real, …
  • Enum DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

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

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

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

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

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

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

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

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

    Example4 expressions
    0 == (-0 :: Double)Truerecip 0 == recip (-0 :: Double)Falsemap (/ 0) [-1, 0, 1][-Infinity,NaN,Infinity]map (* 0) $ map (/ 0) [-1, 0, 1][NaN,NaN,NaN]
  • Data DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Num DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

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

    Example3 expressions
    (0.1 + 0.1) + 0.4 == 0.1 + (0.1 + 0.4)False(0.1 + 0.2) * 0.3 == 0.1 * 0.3 + 0.2 * 0.3False(0.1 * 0.1) * 0.3 == 0.1 * (0.1 * 0.3)False
  • Ord DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Classes

    IEEE 754 Double-precision type includes not only numbers, but also positive and negative infinities and a special element called NaN (which can be quiet or signal).

    IEEE 754-2008, section 5.11 requires that if at least one of arguments of <=, <, >, >= is NaN then the result of the comparison is False, and instance Ord Double complies with this requirement. This violates the reflexivity: both NaN <= NaN and NaN >= NaN are False.

    IEEE 754-2008, section 5.10 defines totalOrder predicate. Unfortunately, compare on Doubles violates the IEEE standard and does not define a total order. More specifically, both compare NaN x and compare x NaN always return GT.

    Thus, users must be extremely cautious when using instance Ord Double. For instance, one should avoid ordered containers with keys represented by Double, because data loss and corruption may happen. An IEEE-compliant compare is available in fp-ieee package as TotallyOrdered newtype.

    Moving further, the behaviour of min and max with regards to NaN is also non-compliant. IEEE 754-2008, section 5.3.1 defines that quiet NaN should be treated as a missing data by minNum and maxNum functions, for example, minNum(NaN, 1) = minNum(1, NaN) = 1. Some languages such as Java deviate from the standard implementing minNum(NaN, 1) = minNum(1, NaN) = NaN. However, min / max in base are even worse: min NaN 1 is 1, but min 1 NaN is NaN.

    IEEE 754-2008 compliant min / max can be found in ieee754 package under minNum / maxNum names. Implementations compliant with minimumNumber / maximumNumber from a newer IEEE 754-2019, section 9.6 are available from fp-ieee package.

  • Read DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Read
  • Real DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

    Beware that toRational generates garbage for non-finite arguments:

    Example2 expressions
    toRational (1/0)179769313 (and 300 more digits...) % 1toRational (0/0)269653970 (and 300 more digits...) % 1
  • RealFloat DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Float
  • RealFrac DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

    Beware that results for non-finite arguments are garbage:

    Example2 expressions
    [ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0] ] :: [Int][0,0,0,0,0,0,0,0,0]map properFraction [-1/0, 0/0, 1/0] :: [(Int, Double)][(0,0.0),(0,0.0),(0,0.0)]

    and get even more non-sensical if you ask for Integer instead of Int.

  • Show DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan
  • Storable DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Storable
  • PrintfArg DoubleDefined in base-4.22.0.0 · Text.Printf
  • NFData DoubleDefined in deepseq-1.5.1.0 · Control.DeepSeq
  • Pretty DoubleDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Pretty DoubleDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Random DoubleDefined in random-1.3.1 · System.Random

    Note - random produces values in the closed range [0,1].

  • UniformRange DoubleDefined in random-1.3.1 · System.Random.Internal
  • Arbitrary DoubleDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • CoArbitrary DoubleDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • Function DoubleDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function
  • Binary DoubleDefined in binary-0.8.9.3 · Data.Binary.Class

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

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

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

    The hash of NaN is not well defined.

  • Prim DoubleDefined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Generic DoubleDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Consumable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable
  • Dupable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • MultIdentity DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • Movable DoubleDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Multiplicative DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • AddIdentity DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • Additive DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • AdditiveGroup DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • FromInteger DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • Num DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • Ring DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • Semiring DoubleDefined in linear-base-0.8.1 · Data.Num.Linear
  • Eq DoubleDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Eq
  • Ord DoubleDefined in linear-base-0.8.1 · Data.Ord.Linear.Internal.Ord
  • Lift DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Lift
  • IArray UArray DoubleDefined in array-0.5.8.0 · Data.Array.Base
  • MVector MVector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Vector Vector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Double IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • Generic1 (URec Double)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Generic1 (URec Double)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Foldable UDoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Foldable
  • Traversable UDoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Traversable
  • MArray (STUArray s) Double (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • Functor (URec Double)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Eq (URec Double p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Ord (URec Double p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (URec Double p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Generic (URec Double p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Generic (URec Double p)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • type Rep (URec Double p) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UDouble" 'PrefixI 'True) (S1 ('MetaSel ('Just "uDouble#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • type Rep1 (URec Double) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UDouble" 'PrefixI 'True) (S1 ('MetaSel ('Just "uDouble#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • data URec DoubleDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics

    Used for marking occurrences of Double#

  • data MVector s DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector DoubleDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep Double = D1 ('MetaData "Double" "GHC.Internal.Types" "ghc-internal" 'False) (C1 ('MetaCons "D#" 'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • type Rep (URec Double p) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UDouble" 'PrefixI 'True) (S1 ('MetaSel ('Just "uDouble#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • type Rep1 (URec Double) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UDouble" 'PrefixI 'True) (S1 ('MetaSel ('Just "uDouble#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UDouble))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
datadata Float
#

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

Instances63Enum, Floating, Fractional, Data, Read, Real, …
  • Enum FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

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

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

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

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

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

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

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

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

    Example4 expressions
    0 == (-0 :: Float)Truerecip 0 == recip (-0 :: Float)Falsemap (/ 0) [-1, 0, 1 :: Float][-Infinity,NaN,Infinity]map (* 0) $ map (/ 0) [-1, 0, 1 :: Float][NaN,NaN,NaN]
  • Data FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Data
  • Num FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan

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

    Example3 expressions
    (0.1 + 0.1 :: Float) + 0.5 == 0.1 + (0.1 + 0.5)False(0.1 + 0.2 :: Float) * 0.9 == 0.1 * 0.9 + 0.2 * 0.9False(0.1 * 0.1 :: Float) * 0.9 == 0.1 * (0.1 * 0.9)False
  • Ord FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Classes

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

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

    Beware that toRational generates garbage for non-finite arguments:

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

    Beware that results for non-finite arguments are garbage:

    Example2 expressions
    [ f x | f <- [round, floor, ceiling], x <- [-1/0, 0/0, 1/0 :: Float] ] :: [Int][0,0,0,0,0,0,0,0,0]map properFraction [-1/0, 0/0, 1/0] :: [(Int, Float)][(0,0.0),(0,0.0),(0,0.0)]

    and get even more non-sensical if you ask for Integer instead of Int.

  • Show FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Float · orphan
  • Storable FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Foreign.Storable
  • PrintfArg FloatDefined in base-4.22.0.0 · Text.Printf
  • NFData FloatDefined in deepseq-1.5.1.0 · Control.DeepSeq
  • Pretty FloatDefined in pretty-1.1.3.6 · Text.PrettyPrint.Annotated.HughesPJClass
  • Pretty FloatDefined in pretty-1.1.3.6 · Text.PrettyPrint.HughesPJClass
  • Random FloatDefined in random-1.3.1 · System.Random

    Note - random produces values in the closed range [0,1].

  • UniformRange FloatDefined in random-1.3.1 · System.Random.Internal
  • Arbitrary FloatDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • CoArbitrary FloatDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Arbitrary
  • Function FloatDefined in QuickCheck-2.19.0.0 · Test.QuickCheck.Function
  • Binary FloatDefined in binary-0.8.9.3 · Data.Binary.Class

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

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

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

    The hash of NaN is not well defined.

  • Prim FloatDefined in primitive-0.9.1.0 · Data.Primitive.Types
  • Unbox FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Generic FloatDefined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Consumable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Consumable
  • Dupable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Dupable
  • MultIdentity FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • Movable FloatDefined in linear-base-0.8.1 · Data.Unrestricted.Linear.Internal.Movable
  • Multiplicative FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • AddIdentity FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • Additive FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • AdditiveGroup FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • FromInteger FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • Num FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • Ring FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • Semiring FloatDefined in linear-base-0.8.1 · Data.Num.Linear
  • Lift FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.TH.Lift
  • IArray UArray FloatDefined in array-0.5.8.0 · Data.Array.Base
  • MVector MVector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • Vector Vector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • MArray IOUArray Float IODefined in array-0.5.8.0 · Data.Array.IO.Internals
  • Generic1 (URec Float)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Generic1 (URec Float)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • Foldable UFloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Foldable
  • Traversable UFloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Data.Traversable
  • MArray (STUArray s) Float (ST s)Defined in array-0.5.8.0 · Data.Array.Base
  • Functor (URec Float)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Eq (URec Float p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Ord (URec Float p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Show (URec Float p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Generic (URec Float p)Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • Generic (URec Float p)Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • type Rep (URec Float p) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UFloat" 'PrefixI 'True) (S1 ('MetaSel ('Just "uFloat#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • type Rep1 (URec Float) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UFloat" 'PrefixI 'True) (S1 ('MetaSel ('Just "uFloat#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))Defined in ghc-internal-9.1401.0 · GHC.Internal.Generics
  • data URec FloatDefined in ghc-internal-9.1401.0 · GHC.Internal.Generics

    Used for marking occurrences of Float#

  • data MVector s FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • data Vector FloatDefined in vector-0.13.2.0 · Data.Vector.Unboxed.Base
  • type Rep Float = D1 ('MetaData "Float" "GHC.Internal.Types" "ghc-internal" 'False) (C1 ('MetaCons "F#" 'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • type Rep (URec Float p) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UFloat" 'PrefixI 'True) (S1 ('MetaSel ('Just "uFloat#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
  • type Rep1 (URec Float) = D1 ('MetaData "URec" "GHC.Internal.Generics" "ghc-internal" 'False) (C1 ('MetaCons "UFloat" 'PrefixI 'True) (S1 ('MetaSel ('Just "uFloat#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) UFloat))Defined in linear-generics-0.2.3 · Generics.Linear.Instances.Base · orphan
datadata Int
#

A fixed-precision integer type with at least the range [-2^29 .. 2^29-1]. The exact range for a given implementation can be determined by using Prelude.minBound and Prelude.maxBound from the Prelude.Bounded class.

Instances71Bounded, Enum, Integral, Data, Read, Real, …
datadata Word
#

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

Instances67Bounded, Enum, Integral, Data, Read, Real, …
classclass a ~ b => (~) (a :: k) (b :: k)
#

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.