mixed-types-num-0.3.1.5: Alternative Prelude with numeric and logic expressions typed bottom-up

Numeric.MixedTypes.PreludeHiding

Description

Prelude without operations that clash with MixedTypes

Synopsis

# Documentation

(++) :: [a] -> [a] -> [a] infixr 5 #

Append two lists, i.e.,

[x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]
[x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]

If the first list is not finite, the result is the first list.

seq :: a -> b -> b #

The value of seq a b is bottom if a is bottom, and otherwise equal to b. In other words, it evaluates the first argument a to weak head normal form (WHNF). seq is usually introduced to improve performance by avoiding unneeded laziness.

A note on evaluation order: the expression seq a b does not guarantee that a will be evaluated before b. The only guarantee given by seq is that the both a and b will be evaluated before seq returns a value. In particular, this means that b may be evaluated before a. If you need to guarantee a specific order of evaluation, you must use the function pseq from the "parallel" package.

filter :: (a -> Bool) -> [a] -> [a] #

filter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,

filter p xs = [ x | x <- xs, p x]

zip :: [a] -> [b] -> [(a, b)] #

zip takes two lists and returns a list of corresponding pairs.

zip [1, 2] ['a', 'b'] = [(1, 'a'), (2, 'b')]

If one input list is short, excess elements of the longer list are discarded:

zip [1] ['a', 'b'] = [(1, 'a')]
zip [1, 2] ['a'] = [(1, 'a')]

zip is right-lazy:

zip [] _|_ = []
zip _|_ [] = _|_

print :: 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.

For example, a program to print the first 20 integers and their powers of 2 could be written as:

main = print ([(n, 2^n) | n <- [0..19]])

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

Extract the first component of a pair.

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

Extract the second component of a pair.

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

 f x | x < 0     = ...
| otherwise = ...

map :: (a -> b) -> [a] -> [b] #

map f xs is the list obtained by applying f to each element of xs, i.e.,

map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]

($) :: (a -> b) -> a -> b infixr 0 # Application operator. This operator is redundant, since ordinary application (f x) means the same as (f$ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example: f$ g $h x = f (g (h x)) It is also useful in higher-order situations, such as map ($ 0) xs, or zipWith ($) fs xs. Note that ($) is levity-polymorphic in its result type, so that foo $True where foo :: Bool -> Int# is well-typed fromIntegral :: (Integral a, Num b) => a -> b # general coercion from integral types realToFrac :: (Real a, Fractional b) => a -> b # general coercion to fractional types class 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 minBound :: a # maxBound :: a # Instances  Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Enum Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-4.10.0.0 Instance detailsDefined in GHC.Enum Methods Since: base-4.10.0.0 Instance detailsDefined in GHC.Enum Methods Bounded () Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: () #maxBound :: () # Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Bounded a => Bounded (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methods Bounded a => Bounded (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Bounded a => Bounded (Sum a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsminBound :: Sum a #maxBound :: Sum a # Bounded a => Bounded (Product a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods (Bounded a, Bounded b) => Bounded (a, b) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b) #maxBound :: (a, b) # Bounded (Proxy t) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methods (Bounded a, Bounded b, Bounded c) => Bounded (a, b, c) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c) #maxBound :: (a, b, c) # (Applicative f, Bounded a) => Bounded (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid MethodsminBound :: Ap f a #maxBound :: Ap f a # a ~ b => Bounded (a :~: b) Since: base-4.7.0.0 Instance detailsDefined in Data.Type.Equality MethodsminBound :: a :~: b #maxBound :: a :~: b # (Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d) #maxBound :: (a, b, c, d) # a ~~ b => Bounded (a :~~: b) Since: base-4.10.0.0 Instance detailsDefined in Data.Type.Equality MethodsminBound :: a :~~: b #maxBound :: a :~~: b # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e) #maxBound :: (a, b, c, d, e) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f) #maxBound :: (a, b, c, d, e, f) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => Bounded (a, b, c, d, e, f, g) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g) #maxBound :: (a, b, c, d, e, f, g) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => Bounded (a, b, c, d, e, f, g, h) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h) #maxBound :: (a, b, c, d, e, f, g, h) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => Bounded (a, b, c, d, e, f, g, h, i) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i) #maxBound :: (a, b, c, d, e, f, g, h, i) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => Bounded (a, b, c, d, e, f, g, h, i, j) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j) #maxBound :: (a, b, c, d, e, f, g, h, i, j) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => Bounded (a, b, c, d, e, f, g, h, i, j, k) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # class 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: • The calls succ maxBound and pred minBound should result in a runtime error. • fromEnum and toEnum should give a runtime error if the result value is not representable in the result type. For example, toEnum 7 :: Bool is an error. • enumFrom and enumFromThen should be defined with an implicit bound, thus:  enumFrom x = enumFromTo x maxBound enumFromThen x y = enumFromThenTo x y bound where bound | fromEnum y >= fromEnum x = maxBound | otherwise = minBound Minimal complete definition Methods succ :: a -> a # the successor of a value. For numeric types, succ adds 1. pred :: a -> a # the 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). For example: • 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 For example: • 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 = []. For example: • 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 = [] For example: • enumFromThenTo 4 2 -6 :: [Integer] = [4,2,0,-2,-4,-6] • enumFromThenTo 6 8 2 :: [Int] = [] Instances  Since: base-2.1 Instance detailsDefined in GHC.Enum Methodssucc :: Bool -> Bool #pred :: Bool -> Bool #toEnum :: Int -> Bool #fromEnum :: Bool -> Int #enumFrom :: Bool -> [Bool] #enumFromThen :: Bool -> Bool -> [Bool] #enumFromTo :: Bool -> Bool -> [Bool] #enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] # Since: base-2.1 Instance detailsDefined in GHC.Enum Methodssucc :: Char -> Char #pred :: Char -> Char #toEnum :: Int -> Char #fromEnum :: Char -> Int #enumFrom :: Char -> [Char] #enumFromThen :: Char -> Char -> [Char] #enumFromTo :: Char -> Char -> [Char] #enumFromThenTo :: Char -> Char -> Char -> [Char] # Since: base-2.1 Instance detailsDefined in GHC.Enum Methodssucc :: Int -> Int #pred :: Int -> Int #toEnum :: Int -> Int #fromEnum :: Int -> Int #enumFrom :: Int -> [Int] #enumFromThen :: Int -> Int -> [Int] #enumFromTo :: Int -> Int -> [Int] #enumFromThenTo :: Int -> Int -> Int -> [Int] # Since: base-2.1 Instance detailsDefined in GHC.Int Methodssucc :: Int8 -> Int8 #pred :: Int8 -> Int8 #toEnum :: Int -> Int8 #fromEnum :: Int8 -> Int #enumFrom :: Int8 -> [Int8] #enumFromThen :: Int8 -> Int8 -> [Int8] #enumFromTo :: Int8 -> Int8 -> [Int8] #enumFromThenTo :: Int8 -> Int8 -> Int8 -> [Int8] # Since: base-2.1 Instance detailsDefined in GHC.Int Methodssucc :: Int16 -> Int16 #pred :: Int16 -> Int16 #toEnum :: Int -> Int16 #enumFrom :: Int16 -> [Int16] #enumFromThen :: Int16 -> Int16 -> [Int16] #enumFromTo :: Int16 -> Int16 -> [Int16] #enumFromThenTo :: Int16 -> Int16 -> Int16 -> [Int16] # Since: base-2.1 Instance detailsDefined in GHC.Int Methodssucc :: Int32 -> Int32 #pred :: Int32 -> Int32 #toEnum :: Int -> Int32 #enumFrom :: Int32 -> [Int32] #enumFromThen :: Int32 -> Int32 -> [Int32] #enumFromTo :: Int32 -> Int32 -> [Int32] #enumFromThenTo :: Int32 -> Int32 -> Int32 -> [Int32] # Since: base-2.1 Instance detailsDefined in GHC.Int Methodssucc :: Int64 -> Int64 #pred :: Int64 -> Int64 #toEnum :: Int -> Int64 #enumFrom :: Int64 -> [Int64] #enumFromThen :: Int64 -> Int64 -> [Int64] #enumFromTo :: Int64 -> Int64 -> [Int64] #enumFromThenTo :: Int64 -> Int64 -> Int64 -> [Int64] # Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsenumFrom :: Integer -> [Integer] #enumFromThen :: Integer -> Integer -> [Integer] #enumFromTo :: Integer -> Integer -> [Integer] #enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] # Since: base-4.8.0.0 Instance detailsDefined in GHC.Enum MethodsenumFrom :: Natural -> [Natural] #enumFromThen :: Natural -> Natural -> [Natural] #enumFromTo :: Natural -> Natural -> [Natural] #enumFromThenTo :: Natural -> Natural -> Natural -> [Natural] # Since: base-2.1 Instance detailsDefined in GHC.Enum MethodsenumFrom :: Ordering -> [Ordering] #enumFromTo :: Ordering -> Ordering -> [Ordering] # Since: base-2.1 Instance detailsDefined in GHC.Enum Methodssucc :: Word -> Word #pred :: Word -> Word #toEnum :: Int -> Word #fromEnum :: Word -> Int #enumFrom :: Word -> [Word] #enumFromThen :: Word -> Word -> [Word] #enumFromTo :: Word -> Word -> [Word] #enumFromThenTo :: Word -> Word -> Word -> [Word] # Since: base-2.1 Instance detailsDefined in GHC.Word Methodssucc :: Word8 -> Word8 #pred :: Word8 -> Word8 #toEnum :: Int -> Word8 #enumFrom :: Word8 -> [Word8] #enumFromThen :: Word8 -> Word8 -> [Word8] #enumFromTo :: Word8 -> Word8 -> [Word8] #enumFromThenTo :: Word8 -> Word8 -> Word8 -> [Word8] # Since: base-2.1 Instance detailsDefined in GHC.Word MethodstoEnum :: Int -> Word16 #enumFrom :: Word16 -> [Word16] #enumFromThen :: Word16 -> Word16 -> [Word16] #enumFromTo :: Word16 -> Word16 -> [Word16] #enumFromThenTo :: Word16 -> Word16 -> Word16 -> [Word16] # Since: base-2.1 Instance detailsDefined in GHC.Word MethodstoEnum :: Int -> Word32 #enumFrom :: Word32 -> [Word32] #enumFromThen :: Word32 -> Word32 -> [Word32] #enumFromTo :: Word32 -> Word32 -> [Word32] #enumFromThenTo :: Word32 -> Word32 -> Word32 -> [Word32] # Since: base-2.1 Instance detailsDefined in GHC.Word MethodstoEnum :: Int -> Word64 #enumFrom :: Word64 -> [Word64] #enumFromThen :: Word64 -> Word64 -> [Word64] #enumFromTo :: Word64 -> Word64 -> [Word64] #enumFromThenTo :: Word64 -> Word64 -> Word64 -> [Word64] # Since: base-4.10.0.0 Instance detailsDefined in GHC.Enum MethodsenumFrom :: VecCount -> [VecCount] #enumFromTo :: VecCount -> VecCount -> [VecCount] # Since: base-4.10.0.0 Instance detailsDefined in GHC.Enum MethodsenumFrom :: VecElem -> [VecElem] #enumFromThen :: VecElem -> VecElem -> [VecElem] #enumFromTo :: VecElem -> VecElem -> [VecElem] #enumFromThenTo :: VecElem -> VecElem -> VecElem -> [VecElem] # Enum () Since: base-2.1 Instance detailsDefined in GHC.Enum Methodssucc :: () -> () #pred :: () -> () #toEnum :: Int -> () #fromEnum :: () -> Int #enumFrom :: () -> [()] #enumFromThen :: () -> () -> [()] #enumFromTo :: () -> () -> [()] #enumFromThenTo :: () -> () -> () -> [()] # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Instance detailsDefined in System.Clock Methodssucc :: Clock -> Clock #pred :: Clock -> Clock #toEnum :: Int -> Clock #enumFrom :: Clock -> [Clock] #enumFromThen :: Clock -> Clock -> [Clock] #enumFromTo :: Clock -> Clock -> [Clock] #enumFromThenTo :: Clock -> Clock -> Clock -> [Clock] # Instance detailsDefined in GHC.LanguageExtensions.Type MethodsenumFrom :: Extension -> [Extension] # Instance detailsDefined in Test.SmallCheck.Property Methods Instance detailsDefined in Data.Time.Calendar.Days Methodssucc :: Day -> Day #pred :: Day -> Day #toEnum :: Int -> Day #fromEnum :: Day -> Int #enumFrom :: Day -> [Day] #enumFromThen :: Day -> Day -> [Day] #enumFromTo :: Day -> Day -> [Day] #enumFromThenTo :: Day -> Day -> Day -> [Day] # Integral a => Enum (Ratio a) Since: base-2.0.1 Instance detailsDefined in GHC.Real Methodssucc :: Ratio a -> Ratio a #pred :: Ratio a -> Ratio a #toEnum :: Int -> Ratio a #fromEnum :: Ratio a -> Int #enumFrom :: Ratio a -> [Ratio a] #enumFromThen :: Ratio a -> Ratio a -> [Ratio a] #enumFromTo :: Ratio a -> Ratio a -> [Ratio a] #enumFromThenTo :: Ratio a -> Ratio a -> Ratio a -> [Ratio a] # Enum a => Enum (Blind a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodssucc :: Blind a -> Blind a #pred :: Blind a -> Blind a #toEnum :: Int -> Blind a #fromEnum :: Blind a -> Int #enumFrom :: Blind a -> [Blind a] #enumFromThen :: Blind a -> Blind a -> [Blind a] #enumFromTo :: Blind a -> Blind a -> [Blind a] #enumFromThenTo :: Blind a -> Blind a -> Blind a -> [Blind a] # Enum a => Enum (Fixed a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodssucc :: Fixed a -> Fixed a #pred :: Fixed a -> Fixed a #toEnum :: Int -> Fixed a #fromEnum :: Fixed a -> Int #enumFrom :: Fixed a -> [Fixed a] #enumFromThen :: Fixed a -> Fixed a -> [Fixed a] #enumFromTo :: Fixed a -> Fixed a -> [Fixed a] #enumFromThenTo :: Fixed a -> Fixed a -> Fixed a -> [Fixed a] # Enum a => Enum (Positive a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodssucc :: Positive a -> Positive a #pred :: Positive a -> Positive a #toEnum :: Int -> Positive a #fromEnum :: Positive a -> Int #enumFrom :: Positive a -> [Positive a] #enumFromThen :: Positive a -> Positive a -> [Positive a] #enumFromTo :: Positive a -> Positive a -> [Positive a] #enumFromThenTo :: Positive a -> Positive a -> Positive a -> [Positive a] # Enum a => Enum (NonZero a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodssucc :: NonZero a -> NonZero a #pred :: NonZero a -> NonZero a #toEnum :: Int -> NonZero a #fromEnum :: NonZero a -> Int #enumFrom :: NonZero a -> [NonZero a] #enumFromThen :: NonZero a -> NonZero a -> [NonZero a] #enumFromTo :: NonZero a -> NonZero a -> [NonZero a] #enumFromThenTo :: NonZero a -> NonZero a -> NonZero a -> [NonZero a] # Enum a => Enum (NonNegative a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodssucc :: NonNegative a -> NonNegative a #pred :: NonNegative a -> NonNegative a #fromEnum :: NonNegative a -> Int #enumFrom :: NonNegative a -> [NonNegative a] #enumFromThen :: NonNegative a -> NonNegative a -> [NonNegative a] #enumFromTo :: NonNegative a -> NonNegative a -> [NonNegative a] #enumFromThenTo :: NonNegative a -> NonNegative a -> NonNegative a -> [NonNegative a] # Enum a => Enum (Large a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodssucc :: Large a -> Large a #pred :: Large a -> Large a #toEnum :: Int -> Large a #fromEnum :: Large a -> Int #enumFrom :: Large a -> [Large a] #enumFromThen :: Large a -> Large a -> [Large a] #enumFromTo :: Large a -> Large a -> [Large a] #enumFromThenTo :: Large a -> Large a -> Large a -> [Large a] # Enum a => Enum (Small a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodssucc :: Small a -> Small a #pred :: Small a -> Small a #toEnum :: Int -> Small a #fromEnum :: Small a -> Int #enumFrom :: Small a -> [Small a] #enumFromThen :: Small a -> Small a -> [Small a] #enumFromTo :: Small a -> Small a -> [Small a] #enumFromThenTo :: Small a -> Small a -> Small a -> [Small a] # Enum a => Enum (Shrink2 a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodssucc :: Shrink2 a -> Shrink2 a #pred :: Shrink2 a -> Shrink2 a #toEnum :: Int -> Shrink2 a #fromEnum :: Shrink2 a -> Int #enumFrom :: Shrink2 a -> [Shrink2 a] #enumFromThen :: Shrink2 a -> Shrink2 a -> [Shrink2 a] #enumFromTo :: Shrink2 a -> Shrink2 a -> [Shrink2 a] #enumFromThenTo :: Shrink2 a -> Shrink2 a -> Shrink2 a -> [Shrink2 a] # Enum a => Enum (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methodssucc :: Identity a -> Identity a #pred :: Identity a -> Identity a #toEnum :: Int -> Identity a #fromEnum :: Identity a -> Int #enumFrom :: Identity a -> [Identity a] #enumFromThen :: Identity a -> Identity a -> [Identity a] #enumFromTo :: Identity a -> Identity a -> [Identity a] #enumFromThenTo :: Identity a -> Identity a -> Identity a -> [Identity a] # Enum a => Enum (N a) Instance detailsDefined in Test.SmallCheck.Series Methodssucc :: N a -> N a #pred :: N a -> N a #toEnum :: Int -> N a #fromEnum :: N a -> Int #enumFrom :: N a -> [N a] #enumFromThen :: N a -> N a -> [N a] #enumFromTo :: N a -> N a -> [N a] #enumFromThenTo :: N a -> N a -> N a -> [N a] # Enum a => Enum (M a) Instance detailsDefined in Test.SmallCheck.Series Methodssucc :: M a -> M a #pred :: M a -> M a #toEnum :: Int -> M a #fromEnum :: M a -> Int #enumFrom :: M a -> [M a] #enumFromThen :: M a -> M a -> [M a] #enumFromTo :: M a -> M a -> [M a] #enumFromThenTo :: M a -> M a -> M a -> [M a] # Enum a => Enum (Positive a) Instance detailsDefined in Test.SmallCheck.Series Methodssucc :: Positive a -> Positive a #pred :: Positive a -> Positive a #toEnum :: Int -> Positive a #fromEnum :: Positive a -> Int #enumFrom :: Positive a -> [Positive a] #enumFromThen :: Positive a -> Positive a -> [Positive a] #enumFromTo :: Positive a -> Positive a -> [Positive a] #enumFromThenTo :: Positive a -> Positive a -> Positive a -> [Positive a] # Enum a => Enum (NonNegative a) Instance detailsDefined in Test.SmallCheck.Series Methodssucc :: NonNegative a -> NonNegative a #pred :: NonNegative a -> NonNegative a #fromEnum :: NonNegative a -> Int #enumFrom :: NonNegative a -> [NonNegative a] #enumFromThen :: NonNegative a -> NonNegative a -> [NonNegative a] #enumFromTo :: NonNegative a -> NonNegative a -> [NonNegative a] #enumFromThenTo :: NonNegative a -> NonNegative a -> NonNegative a -> [NonNegative a] # Enum (Proxy s) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methodssucc :: Proxy s -> Proxy s #pred :: Proxy s -> Proxy s #toEnum :: Int -> Proxy s #fromEnum :: Proxy s -> Int #enumFrom :: Proxy s -> [Proxy s] #enumFromThen :: Proxy s -> Proxy s -> [Proxy s] #enumFromTo :: Proxy s -> Proxy s -> [Proxy s] #enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] # Enum (f a) => Enum (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methodssucc :: Ap f a -> Ap f a #pred :: Ap f a -> Ap f a #toEnum :: Int -> Ap f a #fromEnum :: Ap f a -> Int #enumFrom :: Ap f a -> [Ap f a] #enumFromThen :: Ap f a -> Ap f a -> [Ap f a] #enumFromTo :: Ap f a -> Ap f a -> [Ap f a] #enumFromThenTo :: Ap f a -> Ap f a -> Ap f a -> [Ap f a] # Enum (f a) => Enum (Alt f a) Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodssucc :: Alt f a -> Alt f a #pred :: Alt f a -> Alt f a #toEnum :: Int -> Alt f a #fromEnum :: Alt f a -> Int #enumFrom :: Alt f a -> [Alt f a] #enumFromThen :: Alt f a -> Alt f a -> [Alt f a] #enumFromTo :: Alt f a -> Alt f a -> [Alt f a] #enumFromThenTo :: Alt f a -> Alt f a -> Alt f a -> [Alt f a] # a ~ b => Enum (a :~: b) Since: base-4.7.0.0 Instance detailsDefined in Data.Type.Equality Methodssucc :: (a :~: b) -> a :~: b #pred :: (a :~: b) -> a :~: b #toEnum :: Int -> a :~: b #fromEnum :: (a :~: b) -> Int #enumFrom :: (a :~: b) -> [a :~: b] #enumFromThen :: (a :~: b) -> (a :~: b) -> [a :~: b] #enumFromTo :: (a :~: b) -> (a :~: b) -> [a :~: b] #enumFromThenTo :: (a :~: b) -> (a :~: b) -> (a :~: b) -> [a :~: b] # a ~~ b => Enum (a :~~: b) Since: base-4.10.0.0 Instance detailsDefined in Data.Type.Equality Methodssucc :: (a :~~: b) -> a :~~: b #pred :: (a :~~: b) -> a :~~: b #toEnum :: Int -> a :~~: b #fromEnum :: (a :~~: b) -> Int #enumFrom :: (a :~~: b) -> [a :~~: b] #enumFromThen :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] #enumFromTo :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] #enumFromThenTo :: (a :~~: b) -> (a :~~: b) -> (a :~~: b) -> [a :~~: b] # class (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. Minimal complete definition Methods quot :: a -> a -> a infixl 7 # integer division truncated toward zero rem :: a -> a -> a infixl 7 # integer remainder, satisfying (x quot y)*y + (x rem y) == x div :: a -> a -> a infixl 7 # integer division truncated toward negative infinity mod :: a -> a -> a infixl 7 # integer modulus, satisfying (x div y)*y + (x mod y) == x quotRem :: a -> a -> (a, a) # simultaneous quot and rem divMod :: a -> a -> (a, a) # simultaneous div and mod toInteger :: a -> Integer # conversion to Integer Instances  Since: base-2.0.1 Instance detailsDefined in GHC.Real Methodsquot :: Int -> Int -> Int #rem :: Int -> Int -> Int #div :: Int -> Int -> Int #mod :: Int -> Int -> Int #quotRem :: Int -> Int -> (Int, Int) #divMod :: Int -> Int -> (Int, Int) # Since: base-2.1 Instance detailsDefined in GHC.Int Methodsquot :: Int8 -> Int8 -> Int8 #rem :: Int8 -> Int8 -> Int8 #div :: Int8 -> Int8 -> Int8 #mod :: Int8 -> Int8 -> Int8 #quotRem :: Int8 -> Int8 -> (Int8, Int8) #divMod :: Int8 -> Int8 -> (Int8, Int8) # Since: base-2.1 Instance detailsDefined in GHC.Int Methodsquot :: Int16 -> Int16 -> Int16 #rem :: Int16 -> Int16 -> Int16 #div :: Int16 -> Int16 -> Int16 #mod :: Int16 -> Int16 -> Int16 #quotRem :: Int16 -> Int16 -> (Int16, Int16) #divMod :: Int16 -> Int16 -> (Int16, Int16) # Since: base-2.1 Instance detailsDefined in GHC.Int Methodsquot :: Int32 -> Int32 -> Int32 #rem :: Int32 -> Int32 -> Int32 #div :: Int32 -> Int32 -> Int32 #mod :: Int32 -> Int32 -> Int32 #quotRem :: Int32 -> Int32 -> (Int32, Int32) #divMod :: Int32 -> Int32 -> (Int32, Int32) # Since: base-2.1 Instance detailsDefined in GHC.Int Methodsquot :: Int64 -> Int64 -> Int64 #rem :: Int64 -> Int64 -> Int64 #div :: Int64 -> Int64 -> Int64 #mod :: Int64 -> Int64 -> Int64 #quotRem :: Int64 -> Int64 -> (Int64, Int64) #divMod :: Int64 -> Int64 -> (Int64, Int64) # Since: base-2.0.1 Instance detailsDefined in GHC.Real MethodsquotRem :: Integer -> Integer -> (Integer, Integer) #divMod :: Integer -> Integer -> (Integer, Integer) # Since: base-4.8.0.0 Instance detailsDefined in GHC.Real MethodsquotRem :: Natural -> Natural -> (Natural, Natural) #divMod :: Natural -> Natural -> (Natural, Natural) # Since: base-2.1 Instance detailsDefined in GHC.Real Methodsquot :: Word -> Word -> Word #rem :: Word -> Word -> Word #div :: Word -> Word -> Word #mod :: Word -> Word -> Word #quotRem :: Word -> Word -> (Word, Word) #divMod :: Word -> Word -> (Word, Word) # Since: base-2.1 Instance detailsDefined in GHC.Word Methodsquot :: Word8 -> Word8 -> Word8 #rem :: Word8 -> Word8 -> Word8 #div :: Word8 -> Word8 -> Word8 #mod :: Word8 -> Word8 -> Word8 #quotRem :: Word8 -> Word8 -> (Word8, Word8) #divMod :: Word8 -> Word8 -> (Word8, Word8) # Since: base-2.1 Instance detailsDefined in GHC.Word Methodsquot :: Word16 -> Word16 -> Word16 #rem :: Word16 -> Word16 -> Word16 #div :: Word16 -> Word16 -> Word16 #mod :: Word16 -> Word16 -> Word16 #quotRem :: Word16 -> Word16 -> (Word16, Word16) #divMod :: Word16 -> Word16 -> (Word16, Word16) # Since: base-2.1 Instance detailsDefined in GHC.Word Methodsquot :: Word32 -> Word32 -> Word32 #rem :: Word32 -> Word32 -> Word32 #div :: Word32 -> Word32 -> Word32 #mod :: Word32 -> Word32 -> Word32 #quotRem :: Word32 -> Word32 -> (Word32, Word32) #divMod :: Word32 -> Word32 -> (Word32, Word32) # Since: base-2.1 Instance detailsDefined in GHC.Word Methodsquot :: Word64 -> Word64 -> Word64 #rem :: Word64 -> Word64 -> Word64 #div :: Word64 -> Word64 -> Word64 #mod :: Word64 -> Word64 -> Word64 #quotRem :: Word64 -> Word64 -> (Word64, Word64) #divMod :: Word64 -> Word64 -> (Word64, Word64) # Integral a => Integral (Blind a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodsquot :: Blind a -> Blind a -> Blind a #rem :: Blind a -> Blind a -> Blind a #div :: Blind a -> Blind a -> Blind a #mod :: Blind a -> Blind a -> Blind a #quotRem :: Blind a -> Blind a -> (Blind a, Blind a) #divMod :: Blind a -> Blind a -> (Blind a, Blind a) #toInteger :: Blind a -> Integer # Integral a => Integral (Fixed a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodsquot :: Fixed a -> Fixed a -> Fixed a #rem :: Fixed a -> Fixed a -> Fixed a #div :: Fixed a -> Fixed a -> Fixed a #mod :: Fixed a -> Fixed a -> Fixed a #quotRem :: Fixed a -> Fixed a -> (Fixed a, Fixed a) #divMod :: Fixed a -> Fixed a -> (Fixed a, Fixed a) #toInteger :: Fixed a -> Integer # Integral a => Integral (Large a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodsquot :: Large a -> Large a -> Large a #rem :: Large a -> Large a -> Large a #div :: Large a -> Large a -> Large a #mod :: Large a -> Large a -> Large a #quotRem :: Large a -> Large a -> (Large a, Large a) #divMod :: Large a -> Large a -> (Large a, Large a) #toInteger :: Large a -> Integer # Integral a => Integral (Small a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodsquot :: Small a -> Small a -> Small a #rem :: Small a -> Small a -> Small a #div :: Small a -> Small a -> Small a #mod :: Small a -> Small a -> Small a #quotRem :: Small a -> Small a -> (Small a, Small a) #divMod :: Small a -> Small a -> (Small a, Small a) #toInteger :: Small a -> Integer # Integral a => Integral (Shrink2 a) Instance detailsDefined in Test.QuickCheck.Modifiers Methodsquot :: Shrink2 a -> Shrink2 a -> Shrink2 a #rem :: Shrink2 a -> Shrink2 a -> Shrink2 a #div :: Shrink2 a -> Shrink2 a -> Shrink2 a #mod :: Shrink2 a -> Shrink2 a -> Shrink2 a #quotRem :: Shrink2 a -> Shrink2 a -> (Shrink2 a, Shrink2 a) #divMod :: Shrink2 a -> Shrink2 a -> (Shrink2 a, Shrink2 a) #toInteger :: Shrink2 a -> Integer # Integral a => Integral (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methodsquot :: Identity a -> Identity a -> Identity a #rem :: Identity a -> Identity a -> Identity a #div :: Identity a -> Identity a -> Identity a #mod :: Identity a -> Identity a -> Identity a #quotRem :: Identity a -> Identity a -> (Identity a, Identity a) #divMod :: Identity a -> Identity a -> (Identity a, Identity a) # Integral a => Integral (N a) Instance detailsDefined in Test.SmallCheck.Series Methodsquot :: N a -> N a -> N a #rem :: N a -> N a -> N a #div :: N a -> N a -> N a #mod :: N a -> N a -> N a #quotRem :: N a -> N a -> (N a, N a) #divMod :: N a -> N a -> (N a, N a) #toInteger :: N a -> Integer # Integral a => Integral (M a) Instance detailsDefined in Test.SmallCheck.Series Methodsquot :: M a -> M a -> M a #rem :: M a -> M a -> M a #div :: M a -> M a -> M a #mod :: M a -> M a -> M a #quotRem :: M a -> M a -> (M a, M a) #divMod :: M a -> M a -> (M a, M a) #toInteger :: M a -> Integer # Integral a => Integral (Positive a) Instance detailsDefined in Test.SmallCheck.Series Methodsquot :: Positive a -> Positive a -> Positive a #rem :: Positive a -> Positive a -> Positive a #div :: Positive a -> Positive a -> Positive a #mod :: Positive a -> Positive a -> Positive a #quotRem :: Positive a -> Positive a -> (Positive a, Positive a) #divMod :: Positive a -> Positive a -> (Positive a, Positive a) # Integral a => Integral (NonNegative a) Instance detailsDefined in Test.SmallCheck.Series Methodsquot :: NonNegative a -> NonNegative a -> NonNegative a #rem :: NonNegative a -> NonNegative a -> NonNegative a #div :: NonNegative a -> NonNegative a -> NonNegative a #mod :: NonNegative a -> NonNegative a -> NonNegative a #quotRem :: NonNegative a -> NonNegative a -> (NonNegative a, NonNegative a) #divMod :: NonNegative a -> NonNegative a -> (NonNegative a, NonNegative a) # class Applicative m => Monad (m :: Type -> Type) where # The Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions. Instances of Monad should satisfy the following laws: • return a >>= k = k a • m >>= return = m • m >>= (\x -> k x >>= h) = (m >>= k) >>= h Furthermore, the Monad and Applicative operations should relate as follows: • pure = return • (<*>) = ap The above laws imply: • fmap f xs = xs >>= return . f • (>>) = (*>) and that pure and (<*>) satisfy the applicative functor laws. The instances of Monad for lists, Maybe and IO defined in the Prelude satisfy these laws. Minimal complete definition (>>=) Methods (>>=) :: m a -> (a -> m b) -> m b infixl 1 # Sequentially compose two actions, passing any value produced by the first as an argument to the second. (>>) :: m a -> m b -> m b infixl 1 # Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages. return :: a -> m a # Inject a value into the monadic type. fail :: String -> m a # Fail with a message. This operation is not part of the mathematical definition of a monad, but is invoked on pattern-match failure in a do expression. As part of the MonadFail proposal (MFP), this function is moved to its own class MonadFail (see Control.Monad.Fail for more details). The definition here will be removed in a future release. Instances  Monad [] Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: [a] -> (a -> [b]) -> [b] #(>>) :: [a] -> [b] -> [b] #return :: a -> [a] #fail :: String -> [a] # Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #(>>) :: Maybe a -> Maybe b -> Maybe b #return :: a -> Maybe a #fail :: String -> Maybe a # Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: IO a -> (a -> IO b) -> IO b #(>>) :: IO a -> IO b -> IO b #return :: a -> IO a #fail :: String -> IO a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b #(>>) :: Par1 a -> Par1 b -> Par1 b #return :: a -> Par1 a #fail :: String -> Par1 a # Instance detailsDefined in Language.Haskell.TH.Syntax Methods(>>=) :: Q a -> (a -> Q b) -> Q b #(>>) :: Q a -> Q b -> Q b #return :: a -> Q a #fail :: String -> Q a # Monad Rose Instance detailsDefined in Test.QuickCheck.Property Methods(>>=) :: Rose a -> (a -> Rose b) -> Rose b #(>>) :: Rose a -> Rose b -> Rose b #return :: a -> Rose a #fail :: String -> Rose a # Instance detailsDefined in Test.QuickCheck.Gen Methods(>>=) :: Gen a -> (a -> Gen b) -> Gen b #(>>) :: Gen a -> Gen b -> Gen b #return :: a -> Gen a #fail :: String -> Gen a # Since: base-4.9.0.0 Instance detailsDefined in Data.Complex Methods(>>=) :: Complex a -> (a -> Complex b) -> Complex b #(>>) :: Complex a -> Complex b -> Complex b #return :: a -> Complex a #fail :: String -> Complex a # Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methods(>>=) :: Identity a -> (a -> Identity b) -> Identity b #(>>) :: Identity a -> Identity b -> Identity b #return :: a -> Identity a #fail :: String -> Identity a # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: First a -> (a -> First b) -> First b #(>>) :: First a -> First b -> First b #return :: a -> First a #fail :: String -> First a # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: Last a -> (a -> Last b) -> Last b #(>>) :: Last a -> Last b -> Last b #return :: a -> Last a #fail :: String -> Last a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Dual a -> (a -> Dual b) -> Dual b #(>>) :: Dual a -> Dual b -> Dual b #return :: a -> Dual a #fail :: String -> Dual a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Sum a -> (a -> Sum b) -> Sum b #(>>) :: Sum a -> Sum b -> Sum b #return :: a -> Sum a #fail :: String -> Sum a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Product a -> (a -> Product b) -> Product b #(>>) :: Product a -> Product b -> Product b #return :: a -> Product a #fail :: String -> Product a # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methods(>>=) :: Down a -> (a -> Down b) -> Down b #(>>) :: Down a -> Down b -> Down b #return :: a -> Down a #fail :: String -> Down a # Since: base-2.1 Instance detailsDefined in Text.ParserCombinators.ReadP Methods(>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b #(>>) :: ReadP a -> ReadP b -> ReadP b #return :: a -> ReadP a #fail :: String -> ReadP a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b #(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #return :: a -> NonEmpty a #fail :: String -> NonEmpty a # Instance detailsDefined in Data.Tree Methods(>>=) :: Tree a -> (a -> Tree b) -> Tree b #(>>) :: Tree a -> Tree b -> Tree b #return :: a -> Tree a #fail :: String -> Tree a # Since: base-2.1 Instance detailsDefined in Text.ParserCombinators.ReadP Methods(>>=) :: P a -> (a -> P b) -> P b #(>>) :: P a -> P b -> P b #return :: a -> P a #fail :: String -> P a # Monad (Either e) Since: base-4.4.0.0 Instance detailsDefined in Data.Either Methods(>>=) :: Either e a -> (a -> Either e b) -> Either e b #(>>) :: Either e a -> Either e b -> Either e b #return :: a -> Either e a #fail :: String -> Either e a # Monad (U1 :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: U1 a -> (a -> U1 b) -> U1 b #(>>) :: U1 a -> U1 b -> U1 b #return :: a -> U1 a #fail :: String -> U1 a # Monoid a => Monad ((,) a) Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methods(>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) #(>>) :: (a, a0) -> (a, b) -> (a, b) #return :: a0 -> (a, a0) #fail :: String -> (a, a0) # Monad (Proxy :: Type -> Type) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methods(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #(>>) :: Proxy a -> Proxy b -> Proxy b #return :: a -> Proxy a #fail :: String -> Proxy a # Monad (SpecM a) Instance detailsDefined in Test.Hspec.Core.Spec.Monad Methods(>>=) :: SpecM a a0 -> (a0 -> SpecM a b) -> SpecM a b #(>>) :: SpecM a a0 -> SpecM a b -> SpecM a b #return :: a0 -> SpecM a a0 #fail :: String -> SpecM a a0 # Monoid es => Monad (CollectErrors es) Source # Instance detailsDefined in Control.CollectErrors Methods(>>=) :: CollectErrors es a -> (a -> CollectErrors es b) -> CollectErrors es b #(>>) :: CollectErrors es a -> CollectErrors es b -> CollectErrors es b #return :: a -> CollectErrors es a #fail :: String -> CollectErrors es a # Monad f => Monad (Rec1 f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: Rec1 f a -> (a -> Rec1 f b) -> Rec1 f b #(>>) :: Rec1 f a -> Rec1 f b -> Rec1 f b #return :: a -> Rec1 f a #fail :: String -> Rec1 f a # Monad f => Monad (Ap f) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methods(>>=) :: Ap f a -> (a -> Ap f b) -> Ap f b #(>>) :: Ap f a -> Ap f b -> Ap f b #return :: a -> Ap f a #fail :: String -> Ap f a # Monad f => Monad (Alt f) Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methods(>>=) :: Alt f a -> (a -> Alt f b) -> Alt f b #(>>) :: Alt f a -> Alt f b -> Alt f b #return :: a -> Alt f a #fail :: String -> Alt f a # (Monad m, Error e) => Monad (ErrorT e m) Instance detailsDefined in Control.Monad.Trans.Error Methods(>>=) :: ErrorT e m a -> (a -> ErrorT e m b) -> ErrorT e m b #(>>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b #return :: a -> ErrorT e m a #fail :: String -> ErrorT e m a # (Monoid w, Monad m) => Monad (WriterT w m) Instance detailsDefined in Control.Monad.Trans.Writer.Lazy Methods(>>=) :: WriterT w m a -> (a -> WriterT w m b) -> WriterT w m b #(>>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #return :: a -> WriterT w m a #fail :: String -> WriterT w m a # Monad ((->) r :: Type -> Type) Since: base-2.1 Instance detailsDefined in GHC.Base Methods(>>=) :: (r -> a) -> (a -> r -> b) -> r -> b #(>>) :: (r -> a) -> (r -> b) -> r -> b #return :: a -> r -> a #fail :: String -> r -> a # (Monad f, Monad g) => Monad (f :*: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b #(>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #return :: a -> (f :*: g) a #fail :: String -> (f :*: g) a # Monad m => Monad (ReaderT r m) Instance detailsDefined in Control.Monad.Trans.Reader Methods(>>=) :: ReaderT r m a -> (a -> ReaderT r m b) -> ReaderT r m b #(>>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #return :: a -> ReaderT r m a #fail :: String -> ReaderT r m a # Monad f => Monad (M1 i c f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods(>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b #(>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b #return :: a -> M1 i c f a #fail :: String -> M1 i c f a # class Functor (f :: Type -> Type) where # The Functor class is used for types that can be mapped over. Instances of Functor should satisfy the following laws: fmap id == id fmap (f . g) == fmap f . fmap g The instances of Functor for lists, Maybe and IO satisfy these laws. Minimal complete definition fmap Methods fmap :: (a -> b) -> f a -> f b # (<$) :: a -> f b -> f a infixl 4 #

Replace all locations in the input with the same value. The default definition is fmap . const, but this may be overridden with a more efficient version.

Instances
 Functor [] Since: base-2.1 Instance detailsDefined in GHC.Base Methodsfmap :: (a -> b) -> [a] -> [b] #(<$) :: a -> [b] -> [a] # Since: base-2.1 Instance detailsDefined in GHC.Base Methodsfmap :: (a -> b) -> Maybe a -> Maybe b #(<$) :: a -> Maybe b -> Maybe a # Since: base-2.1 Instance detailsDefined in GHC.Base Methodsfmap :: (a -> b) -> IO a -> IO b #(<$) :: a -> IO b -> IO a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> Par1 a -> Par1 b #(<$) :: a -> Par1 b -> Par1 a # Instance detailsDefined in Language.Haskell.TH.Syntax Methodsfmap :: (a -> b) -> Q a -> Q b #(<$) :: a -> Q b -> Q a # Functor Rose Instance detailsDefined in Test.QuickCheck.Property Methodsfmap :: (a -> b) -> Rose a -> Rose b #(<$) :: a -> Rose b -> Rose a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> Blind a -> Blind b #(<$) :: a -> Blind b -> Blind a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> Fixed a -> Fixed b #(<$) :: a -> Fixed b -> Fixed a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> OrderedList a -> OrderedList b #(<$) :: a -> OrderedList b -> OrderedList a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> NonEmptyList a -> NonEmptyList b #(<$) :: a -> NonEmptyList b -> NonEmptyList a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> SortedList a -> SortedList b #(<$) :: a -> SortedList b -> SortedList a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> Positive a -> Positive b #(<$) :: a -> Positive b -> Positive a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> NonZero a -> NonZero b #(<$) :: a -> NonZero b -> NonZero a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> NonNegative a -> NonNegative b #(<$) :: a -> NonNegative b -> NonNegative a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> Large a -> Large b #(<$) :: a -> Large b -> Large a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> Small a -> Small b #(<$) :: a -> Small b -> Small a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> Shrink2 a -> Shrink2 b #(<$) :: a -> Shrink2 b -> Shrink2 a # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> Smart a -> Smart b #(<$) :: a -> Smart b -> Smart a # Instance detailsDefined in Test.QuickCheck.Gen Methodsfmap :: (a -> b) -> Gen a -> Gen b #(<$) :: a -> Gen b -> Gen a # Since: base-4.9.0.0 Instance detailsDefined in Data.Complex Methodsfmap :: (a -> b) -> Complex a -> Complex b #(<$) :: a -> Complex b -> Complex a # Since: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity Methodsfmap :: (a -> b) -> Identity a -> Identity b #(<$) :: a -> Identity b -> Identity a # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methodsfmap :: (a -> b) -> First a -> First b #(<$) :: a -> First b -> First a # Since: base-4.8.0.0 Instance detailsDefined in Data.Monoid Methodsfmap :: (a -> b) -> Last a -> Last b #(<$) :: a -> Last b -> Last a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodsfmap :: (a -> b) -> Dual a -> Dual b #(<$) :: a -> Dual b -> Dual a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodsfmap :: (a -> b) -> Sum a -> Sum b #(<$) :: a -> Sum b -> Sum a # Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodsfmap :: (a -> b) -> Product a -> Product b #(<$) :: a -> Product b -> Product a # Since: base-4.11.0.0 Instance detailsDefined in Data.Ord Methodsfmap :: (a -> b) -> Down a -> Down b #(<$) :: a -> Down b -> Down a # Since: base-2.1 Instance detailsDefined in Text.ParserCombinators.ReadP Methodsfmap :: (a -> b) -> ReadP a -> ReadP b #(<$) :: a -> ReadP b -> ReadP a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Base Methodsfmap :: (a -> b) -> NonEmpty a -> NonEmpty b #(<$) :: a -> NonEmpty b -> NonEmpty a # Instance detailsDefined in Data.Tree Methodsfmap :: (a -> b) -> Tree a -> Tree b #(<$) :: a -> Tree b -> Tree a # Instance detailsDefined in Text.PrettyPrint.Annotated.HughesPJ Methodsfmap :: (a -> b) -> Doc a -> Doc b #(<$) :: a -> Doc b -> Doc a # Instance detailsDefined in Text.PrettyPrint.Annotated.HughesPJ Methodsfmap :: (a -> b) -> AnnotDetails a -> AnnotDetails b #(<$) :: a -> AnnotDetails b -> AnnotDetails a # Instance detailsDefined in Text.PrettyPrint.Annotated.HughesPJ Methodsfmap :: (a -> b) -> Span a -> Span b #(<$) :: a -> Span b -> Span a # Since: base-4.8.0.0 Instance detailsDefined in Text.ParserCombinators.ReadP Methodsfmap :: (a -> b) -> P a -> P b #(<$) :: a -> P b -> P a # Since: base-3.0 Instance detailsDefined in Data.Either Methodsfmap :: (a0 -> b) -> Either a a0 -> Either a b #(<$) :: a0 -> Either a b -> Either a a0 # Functor (V1 :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> V1 a -> V1 b #(<$) :: a -> V1 b -> V1 a # Functor (U1 :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> U1 a -> U1 b #(<$) :: a -> U1 b -> U1 a # Functor ((,) a) Since: base-2.1 Instance detailsDefined in GHC.Base Methodsfmap :: (a0 -> b) -> (a, a0) -> (a, b) #(<$) :: a0 -> (a, b) -> (a, a0) # Functor ((:->) a) Instance detailsDefined in Test.QuickCheck.Function Methodsfmap :: (a0 -> b) -> (a :-> a0) -> a :-> b #(<$) :: a0 -> (a :-> b) -> a :-> a0 # Functor (Fun a) Instance detailsDefined in Test.QuickCheck.Function Methodsfmap :: (a0 -> b) -> Fun a a0 -> Fun a b #(<$) :: a0 -> Fun a b -> Fun a a0 # Instance detailsDefined in Test.QuickCheck.Modifiers Methodsfmap :: (a -> b) -> Shrinking s a -> Shrinking s b #(<$) :: a -> Shrinking s b -> Shrinking s a # Functor (Array i) Since: base-2.1 Instance detailsDefined in GHC.Arr Methodsfmap :: (a -> b) -> Array i a -> Array i b #(<$) :: a -> Array i b -> Array i a # Functor (Proxy :: Type -> Type) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy Methodsfmap :: (a -> b) -> Proxy a -> Proxy b #(<$) :: a -> Proxy b -> Proxy a # Functor (SpecM a) Instance detailsDefined in Test.Hspec.Core.Spec.Monad Methodsfmap :: (a0 -> b) -> SpecM a a0 -> SpecM a b #(<$) :: a0 -> SpecM a b -> SpecM a a0 # Functor (Tree c) Instance detailsDefined in Test.Hspec.Core.Tree Methodsfmap :: (a -> b) -> Tree c a -> Tree c b #(<$) :: a -> Tree c b -> Tree c a # Source # Instance detailsDefined in Control.CollectErrors Methodsfmap :: (a -> b) -> CollectErrors es a -> CollectErrors es b #(<$) :: a -> CollectErrors es b -> CollectErrors es a # Functor f => Functor (Rec1 f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> Rec1 f a -> Rec1 f b #(<$) :: a -> Rec1 f b -> Rec1 f a # Functor (URec Char :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Char a -> URec Char b #(<$) :: a -> URec Char b -> URec Char a # Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Double a -> URec Double b #(<$) :: a -> URec Double b -> URec Double a # Functor (URec Float :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Float a -> URec Float b #(<$) :: a -> URec Float b -> URec Float a # Functor (URec Int :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Int a -> URec Int b #(<$) :: a -> URec Int b -> URec Int a # Functor (URec Word :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec Word a -> URec Word b #(<$) :: a -> URec Word b -> URec Word a # Functor (URec (Ptr ()) :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b #(<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a # Functor f => Functor (Ap f) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid Methodsfmap :: (a -> b) -> Ap f a -> Ap f b #(<$) :: a -> Ap f b -> Ap f a # Functor f => Functor (Alt f) Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal Methodsfmap :: (a -> b) -> Alt f a -> Alt f b #(<$) :: a -> Alt f b -> Alt f a # Functor m => Functor (ErrorT e m) Instance detailsDefined in Control.Monad.Trans.Error Methodsfmap :: (a -> b) -> ErrorT e m a -> ErrorT e m b #(<$) :: a -> ErrorT e m b -> ErrorT e m a # Functor m => Functor (WriterT w m) Instance detailsDefined in Control.Monad.Trans.Writer.Lazy Methodsfmap :: (a -> b) -> WriterT w m a -> WriterT w m b #(<$) :: a -> WriterT w m b -> WriterT w m a # Functor ((->) r :: Type -> Type) Since: base-2.1 Instance detailsDefined in GHC.Base Methodsfmap :: (a -> b) -> (r -> a) -> r -> b #(<$) :: a -> (r -> b) -> r -> a # Functor (K1 i c :: Type -> Type) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> K1 i c a -> K1 i c b #(<$) :: a -> K1 i c b -> K1 i c a # (Functor f, Functor g) => Functor (f :+: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b #(<$) :: a -> (f :+: g) b -> (f :+: g) a # (Functor f, Functor g) => Functor (f :*: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b #(<$) :: a -> (f :*: g) b -> (f :*: g) a # Functor m => Functor (ReaderT r m) Instance detailsDefined in Control.Monad.Trans.Reader Methodsfmap :: (a -> b) -> ReaderT r m a -> ReaderT r m b #(<$) :: a -> ReaderT r m b -> ReaderT r m a # Functor f => Functor (M1 i c f) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> M1 i c f a -> M1 i c f b #(<$) :: a -> M1 i c f b -> M1 i c f a # (Functor f, Functor g) => Functor (f :.: g) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methodsfmap :: (a -> b) -> (f :.: g) a -> (f :.: g) b #(<$) :: a -> (f :.: g) b -> (f :.: g) a #

Parsing of Strings, producing values.

Derived instances of Read make the following assumptions, which derived instances of 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

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

(\r -> [(u:^:v,w) |
(":^:",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
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  Minimal complete definition Methods Arguments  :: Int the operator precedence of the enclosing context (a number from 0 to 11). Function application has precedence 10. -> 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 Show satisfy the following: • (x,"") is an element of (readsPrec d (showsPrec d x "")). 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 should be are expected to use double quotes, rather than square brackets. Instances  Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-4.8.0.0 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-4.5.0.0 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Read () Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS () #readList :: ReadS [()] #readListPrec :: ReadPrec [()] # Read QCGen Instance detailsDefined in Test.QuickCheck.Random MethodsreadsPrec :: Int -> ReadS QCGen #readList :: ReadS [QCGen] #readPrec :: ReadPrec QCGen #readListPrec :: ReadPrec [QCGen] # Instance detailsDefined in Test.QuickCheck.Test Methods Instance detailsDefined in Test.QuickCheck.Modifiers Methods Instance detailsDefined in Test.QuickCheck.Modifiers Methods Instance detailsDefined in Test.QuickCheck.Modifiers Methods Instance detailsDefined in GHC.IO.Exception Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal Methods Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.6.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Since: base-2.1 Instance detailsDefined in GHC.Read Methods Instance detailsDefined in System.Clock Methods Instance detailsDefined in System.Clock Methods Instance detailsDefined in Data.Convertible.Base Methods Read a => Read [a] Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS [a] #readList :: ReadS [[a]] #readPrec :: ReadPrec [a] #readListPrec :: ReadPrec [[a]] # Read a => Read (Maybe a) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (Maybe a) #readList :: ReadS [Maybe a] # (Integral a, Read a) => Read (Ratio a) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (Ratio a) #readList :: ReadS [Ratio a] # Read p => Read (Par1 p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS (Par1 p) #readList :: ReadS [Par1 p] # Read a => Read (Fixed a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodsreadsPrec :: Int -> ReadS (Fixed a) #readList :: ReadS [Fixed a] # Read a => Read (OrderedList a) Instance detailsDefined in Test.QuickCheck.Modifiers Methods Read a => Read (NonEmptyList a) Instance detailsDefined in Test.QuickCheck.Modifiers Methods Read a => Read (SortedList a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodsreadsPrec :: Int -> ReadS (SortedList a) # Read a => Read (Positive a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodsreadsPrec :: Int -> ReadS (Positive a) # Read a => Read (NonZero a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodsreadsPrec :: Int -> ReadS (NonZero a) # Read a => Read (NonNegative a) Instance detailsDefined in Test.QuickCheck.Modifiers Methods Read a => Read (Large a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodsreadsPrec :: Int -> ReadS (Large a) #readList :: ReadS [Large a] # Read a => Read (Small a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodsreadsPrec :: Int -> ReadS (Small a) #readList :: ReadS [Small a] # Read a => Read (Shrink2 a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodsreadsPrec :: Int -> ReadS (Shrink2 a) # Read a => Read (Complex a) Since: base-2.1 Instance detailsDefined in Data.Complex MethodsreadsPrec :: Int -> ReadS (Complex a) # Read a => Read (Identity a) This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removedSince: base-4.8.0.0 Instance detailsDefined in Data.Functor.Identity MethodsreadsPrec :: Int -> ReadS (Identity a) # Read a => Read (First a) Since: base-2.1 Instance detailsDefined in Data.Monoid MethodsreadsPrec :: Int -> ReadS (First a) #readList :: ReadS [First a] # Read a => Read (Last a) Since: base-2.1 Instance detailsDefined in Data.Monoid MethodsreadsPrec :: Int -> ReadS (Last a) #readList :: ReadS [Last a] # Read a => Read (Dual a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsreadsPrec :: Int -> ReadS (Dual a) #readList :: ReadS [Dual a] # Read a => Read (Sum a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsreadsPrec :: Int -> ReadS (Sum a) #readList :: ReadS [Sum a] #readPrec :: ReadPrec (Sum a) # Read a => Read (Product a) Since: base-2.1 Instance detailsDefined in Data.Semigroup.Internal MethodsreadsPrec :: Int -> ReadS (Product a) # Read a => Read (Down a) Since: base-4.7.0.0 Instance detailsDefined in Data.Ord MethodsreadsPrec :: Int -> ReadS (Down a) #readList :: ReadS [Down a] # Read a => Read (NonEmpty a) Since: base-4.11.0.0 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (NonEmpty a) # Read a => Read (Tree a) Instance detailsDefined in Data.Tree MethodsreadsPrec :: Int -> ReadS (Tree a) #readList :: ReadS [Tree a] # (Read a, Read b) => Read (Either a b) Since: base-3.0 Instance detailsDefined in Data.Either MethodsreadsPrec :: Int -> ReadS (Either a b) #readList :: ReadS [Either a b] #readPrec :: ReadPrec (Either a b) #readListPrec :: ReadPrec [Either a b] # Read (V1 p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS (V1 p) #readList :: ReadS [V1 p] #readPrec :: ReadPrec (V1 p) # Read (U1 p) Since: base-4.9.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS (U1 p) #readList :: ReadS [U1 p] #readPrec :: ReadPrec (U1 p) # (Read a, Read b) => Read (a, b) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b) #readList :: ReadS [(a, b)] #readPrec :: ReadPrec (a, b) #readListPrec :: ReadPrec [(a, b)] # (Ix a, Read a, Read b) => Read (Array a b) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (Array a b) #readList :: ReadS [Array a b] #readPrec :: ReadPrec (Array a b) #readListPrec :: ReadPrec [Array a b] # Read (Proxy t) Since: base-4.7.0.0 Instance detailsDefined in Data.Proxy MethodsreadsPrec :: Int -> ReadS (Proxy t) #readList :: ReadS [Proxy t] # Read (f p) => Read (Rec1 f p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS (Rec1 f p) #readList :: ReadS [Rec1 f p] #readPrec :: ReadPrec (Rec1 f p) #readListPrec :: ReadPrec [Rec1 f p] # (Read a, Read b, Read c) => Read (a, b, c) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c) #readList :: ReadS [(a, b, c)] #readPrec :: ReadPrec (a, b, c) #readListPrec :: ReadPrec [(a, b, c)] # Read (f a) => Read (Ap f a) Since: base-4.12.0.0 Instance detailsDefined in Data.Monoid MethodsreadsPrec :: Int -> ReadS (Ap f a) #readList :: ReadS [Ap f a] #readPrec :: ReadPrec (Ap f a) #readListPrec :: ReadPrec [Ap f a] # Read (f a) => Read (Alt f a) Since: base-4.8.0.0 Instance detailsDefined in Data.Semigroup.Internal MethodsreadsPrec :: Int -> ReadS (Alt f a) #readList :: ReadS [Alt f a] #readPrec :: ReadPrec (Alt f a) #readListPrec :: ReadPrec [Alt f a] # a ~ b => Read (a :~: b) Since: base-4.7.0.0 Instance detailsDefined in Data.Type.Equality MethodsreadsPrec :: Int -> ReadS (a :~: b) #readList :: ReadS [a :~: b] #readPrec :: ReadPrec (a :~: b) #readListPrec :: ReadPrec [a :~: b] # (Read e, Read1 m, Read a) => Read (ErrorT e m a) Instance detailsDefined in Control.Monad.Trans.Error MethodsreadsPrec :: Int -> ReadS (ErrorT e m a) #readList :: ReadS [ErrorT e m a] #readPrec :: ReadPrec (ErrorT e m a) #readListPrec :: ReadPrec [ErrorT e m a] # (Read w, Read1 m, Read a) => Read (WriterT w m a) Instance detailsDefined in Control.Monad.Trans.Writer.Lazy MethodsreadsPrec :: Int -> ReadS (WriterT w m a) #readList :: ReadS [WriterT w m a] #readPrec :: ReadPrec (WriterT w m a) #readListPrec :: ReadPrec [WriterT w m a] # Read c => Read (K1 i c p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS (K1 i c p) #readList :: ReadS [K1 i c p] #readPrec :: ReadPrec (K1 i c p) #readListPrec :: ReadPrec [K1 i c p] # (Read (f p), Read (g p)) => Read ((f :+: g) p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS ((f :+: g) p) #readList :: ReadS [(f :+: g) p] #readPrec :: ReadPrec ((f :+: g) p) #readListPrec :: ReadPrec [(f :+: g) p] # (Read (f p), Read (g p)) => Read ((f :*: g) p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS ((f :*: g) p) #readList :: ReadS [(f :*: g) p] #readPrec :: ReadPrec ((f :*: g) p) #readListPrec :: ReadPrec [(f :*: g) p] # (Read a, Read b, Read c, Read d) => Read (a, b, c, d) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d) #readList :: ReadS [(a, b, c, d)] #readPrec :: ReadPrec (a, b, c, d) #readListPrec :: ReadPrec [(a, b, c, d)] # a ~~ b => Read (a :~~: b) Since: base-4.10.0.0 Instance detailsDefined in Data.Type.Equality MethodsreadsPrec :: Int -> ReadS (a :~~: b) #readList :: ReadS [a :~~: b] #readPrec :: ReadPrec (a :~~: b) # Read (f p) => Read (M1 i c f p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS (M1 i c f p) #readList :: ReadS [M1 i c f p] #readPrec :: ReadPrec (M1 i c f p) #readListPrec :: ReadPrec [M1 i c f p] # Read (f (g p)) => Read ((f :.: g) p) Since: base-4.7.0.0 Instance detailsDefined in GHC.Generics MethodsreadsPrec :: Int -> ReadS ((f :.: g) p) #readList :: ReadS [(f :.: g) p] #readPrec :: ReadPrec ((f :.: g) p) #readListPrec :: ReadPrec [(f :.: g) p] # (Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e) #readList :: ReadS [(a, b, c, d, e)] #readPrec :: ReadPrec (a, b, c, d, e) #readListPrec :: ReadPrec [(a, b, c, d, e)] # (Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f) #readList :: ReadS [(a, b, c, d, e, f)] #readPrec :: ReadPrec (a, b, c, d, e, f) #readListPrec :: ReadPrec [(a, b, c, d, e, f)] # (Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g) #readList :: ReadS [(a, b, c, d, e, f, g)] #readPrec :: ReadPrec (a, b, c, d, e, f, g) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g)] # (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) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h) #readList :: ReadS [(a, b, c, d, e, f, g, h)] #readPrec :: ReadPrec (a, b, c, d, e, f, g, h) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h)] # (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) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i) #readList :: ReadS [(a, b, c, d, e, f, g, h, i)] #readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i)] # (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) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j) #readList :: ReadS [(a, b, c, d, e, f, g, h, i, j)] #readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j)] # (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) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k) #readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k)] #readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k)] # (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) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l) #readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l)] #readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l)] # (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) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m) #readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m)] #readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m)] # (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) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] #readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] # (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) Since: base-2.1 Instance detailsDefined in GHC.Read MethodsreadsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] #readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] # class (Num a, Ord a) => Real a where # Methods toRational :: a -> Rational # the rational equivalent of its real argument with full precision Instances  Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.1 Instance detailsDefined in GHC.Int Methods Since: base-2.0.1 Instance detailsDefined in GHC.Real Methods Since: base-4.8.0.0 Instance detailsDefined in GHC.Real Methods Since: base-2.1 Instance detailsDefined in GHC.Real Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Since: base-2.1 Instance detailsDefined in GHC.Word Methods Integral a => Real (Ratio a) Since: base-2.0.1 Instance detailsDefined in GHC.Real MethodstoRational :: Ratio a -> Rational # Real a => Real (Blind a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodstoRational :: Blind a -> Rational # Real a => Real (Fixed a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodstoRational :: Fixed a -> Rational # Real a => Real (Large a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodstoRational :: Large a -> Rational # Real a => Real (Small a) Instance detailsDefined in Test.QuickCheck.Modifiers MethodstoRational :: Small a -> Rational # Real a => Real (Shrink2 a) Instance detailsDefined in Test.QuickCheck.Modifiers Methods Real a => Real (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity Methods Real a => Real (N a) Instance detailsDefined in Test.SmallCheck.Series MethodstoRational :: N a -> Rational # Real a => Real (M a) Instance detailsDefined in Test.SmallCheck.Series MethodstoRational :: M a -> Rational # Real a => Real (Positive a) Instance detailsDefined in Test.SmallCheck.Series Methods Real a => Real (NonNegative a) Instance detailsDefined in Test.SmallCheck.Series Methods class (RealFrac a, Floating a) => RealFloat a where # Efficient, machine-independent access to the components of a floating-point number. Minimal complete definition 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 the exponent may assume decodeFloat :: a -> (Integer, Int) # The function decodeFloat applied to a real floating-point number returns the significand expressed as an Integer and an appropriately scaled exponent (an Int). If decodeFloat x yields (m,n), then x is equal in value to m*b^^n, where b is the floating-point radix, and furthermore, either m and n are both zero or else b^(d-1) <= abs m < b^d, where d is the value of floatDigits x. In particular, decodeFloat 0 = (0,0). If the type contains a negative zero, also decodeFloat (-0.0) = (0,0). The result of decodeFloat x is unspecified if either of isNaN x or isInfinite x is True. encodeFloat :: Integer -> Int -> a # encodeFloat performs the inverse of decodeFloat in the sense that for finite x with the exception of -0.0, 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 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. Instances  Since: base-2.1 Instance detailsDefined in GHC.Float MethodsfloatRange :: Double -> (Int, Int) #decodeFloat :: Double -> (Integer, Int) #isNaN :: Double -> Bool #atan2 :: Double -> Double -> Double # Since: base-2.1 Instance detailsDefined in GHC.Float MethodsfloatRange :: Float -> (Int, Int) #decodeFloat :: Float -> (Integer, Int) #scaleFloat :: Int -> Float -> Float #isNaN :: Float -> Bool #isIEEE :: Float -> Bool #atan2 :: Float -> Float -> Float # RealFloat a => RealFloat (Identity a) Since: base-4.9.0.0 Instance detailsDefined in Data.Functor.Identity MethodsfloatDigits :: Identity a -> Int #floatRange :: Identity a -> (Int, Int) #decodeFloat :: Identity a -> (Integer, Int) #exponent :: Identity a -> Int #significand :: Identity a -> Identity a #scaleFloat :: Int -> Identity a -> Identity a #isNaN :: Identity a -> Bool #isInfinite :: Identity a -> Bool #isIEEE :: Identity a -> Bool #atan2 :: Identity a -> Identity a -> Identity a # class Show a where # Conversion of values to readable Strings. Derived instances of Show have the following properties, which are compatible with derived instances of 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)".

Minimal complete definition

Methods

Arguments

 :: Int the operator precedence of the enclosing context (a number from 0 to 11). Function application has precedence 10. -> a the value to be converted to a String -> 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 Read and Show satisfy the following:

• (x,"") is an element of (readsPrec d (showsPrec d x "")).

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.

Instances