mixed-types-num-0.5.12: Alternative Prelude with numeric and logic expressions typed bottom-up
Copyright(c) Michal Konecny
LicenseBSD3
Maintainermikkonecny@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

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 :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b infixr 0 #

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] #

\(\mathcal{O}(n)\). filter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,

filter p xs = [ x | x <- xs, p x]
>>> filter odd [1, 2, 3]
[1,3]

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

\(\mathcal{O}(\min(m,n))\). 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 shorter than the other, excess elements of the longer list are discarded, even if one of the lists is infinite:

>>> zip [1] ['a', 'b']
[(1,'a')]
>>> zip [1, 2] ['a']
[(1,'a')]
>>> zip [] [1..]
[]
>>> zip [1..] []
[]

zip is right-lazy:

>>> zip [] undefined
[]
>>> zip undefined []
*** Exception: Prelude.undefined
...

zip is capable of list fusion, but it is restricted to its first list argument and its resulting list.

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 :: Bool #

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] #

\(\mathcal{O}(n)\). map f xs is the list obtained by applying f to each element of xs, i.e.,

map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]
>>> map (+1) [1, 2, 3]
[2,3,4]

($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (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

Instances details
Bounded All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

minBound :: All #

maxBound :: All #

Bounded Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

minBound :: Any #

maxBound :: Any #

Bounded CBool 
Instance details

Defined in Foreign.C.Types

Bounded CChar 
Instance details

Defined in Foreign.C.Types

Bounded CInt 
Instance details

Defined in Foreign.C.Types

Bounded CIntMax 
Instance details

Defined in Foreign.C.Types

Bounded CIntPtr 
Instance details

Defined in Foreign.C.Types

Bounded CLLong 
Instance details

Defined in Foreign.C.Types

Bounded CLong 
Instance details

Defined in Foreign.C.Types

Bounded CPtrdiff 
Instance details

Defined in Foreign.C.Types

Bounded CSChar 
Instance details

Defined in Foreign.C.Types

Bounded CShort 
Instance details

Defined in Foreign.C.Types

Bounded CSigAtomic 
Instance details

Defined in Foreign.C.Types

Bounded CSize 
Instance details

Defined in Foreign.C.Types

Bounded CUChar 
Instance details

Defined in Foreign.C.Types

Bounded CUInt 
Instance details

Defined in Foreign.C.Types

Bounded CUIntMax 
Instance details

Defined in Foreign.C.Types

Bounded CUIntPtr 
Instance details

Defined in Foreign.C.Types

Bounded CULLong 
Instance details

Defined in Foreign.C.Types

Bounded CULong 
Instance details

Defined in Foreign.C.Types

Bounded CUShort 
Instance details

Defined in Foreign.C.Types

Bounded CWchar 
Instance details

Defined in Foreign.C.Types

Bounded Associativity

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Bounded DecidedStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Bounded SourceStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Bounded SourceUnpackedness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Bounded Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Bounded Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Bounded Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Bounded Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Bounded Word16

Since: base-2.1

Instance details

Defined in GHC.Word

Bounded Word32

Since: base-2.1

Instance details

Defined in GHC.Word

Bounded Word64

Since: base-2.1

Instance details

Defined in GHC.Word

Bounded Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Bounded Extension 
Instance details

Defined in GHC.LanguageExtensions.Type

Bounded Ordering

Since: base-2.1

Instance details

Defined in GHC.Enum

Bounded FailOn 
Instance details

Defined in Test.Hspec.Core.Config.Definition

Methods

minBound :: FailOn #

maxBound :: FailOn #

Bounded ()

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

minBound :: () #

maxBound :: () #

Bounded Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Bounded Char

Since: base-2.1

Instance details

Defined in GHC.Enum

Bounded Int

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

minBound :: Int #

maxBound :: Int #

Bounded Levity

Since: base-4.16.0.0

Instance details

Defined in GHC.Enum

Bounded VecCount

Since: base-4.10.0.0

Instance details

Defined in GHC.Enum

Bounded VecElem

Since: base-4.10.0.0

Instance details

Defined in GHC.Enum

Bounded Word

Since: base-2.1

Instance details

Defined in GHC.Enum

Bounded a => Bounded (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Bounded a => Bounded (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

minBound :: Dual a #

maxBound :: Dual a #

Bounded a => Bounded (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Bounded a => Bounded (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

minBound :: Sum a #

maxBound :: Sum a #

(Num a, Bounded a) => Bounded (NonNegative a)

Since: smallcheck-1.2.0

Instance details

Defined in Test.SmallCheck.Series

(Eq a, Num a, Bounded a) => Bounded (NonZero a) 
Instance details

Defined in Test.SmallCheck.Series

(Num a, Bounded a) => Bounded (Positive a)

Since: smallcheck-1.2.0

Instance details

Defined in Test.SmallCheck.Series

Bounded a => Bounded (a) 
Instance details

Defined in GHC.Enum

Methods

minBound :: (a) #

maxBound :: (a) #

Bounded (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

minBound :: Proxy t #

maxBound :: Proxy t #

(Bounded a, Bounded b) => Bounded (a, b)

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

minBound :: (a, b) #

maxBound :: (a, b) #

Bounded a => Bounded (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

minBound :: Const a b #

maxBound :: Const a b #

(Applicative f, Bounded a) => Bounded (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

minBound :: Ap f a #

maxBound :: Ap f a #

a ~ b => Bounded (a :~: b)

Since: base-4.7.0.0

Instance details

Defined in Data.Type.Equality

Methods

minBound :: a :~: b #

maxBound :: a :~: b #

(Bounded a, Bounded b, Bounded c) => Bounded (a, b, c)

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

minBound :: (a, b, c) #

maxBound :: (a, b, c) #

a ~~ b => Bounded (a :~~: b)

Since: base-4.10.0.0

Instance details

Defined in Data.Type.Equality

Methods

minBound :: a :~~: b #

maxBound :: a :~~: b #

(Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d)

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

minBound :: (a, b, c, d) #

maxBound :: (a, b, c, d) #

(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e)

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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 details

Defined in GHC.Enum

Methods

minBound :: (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:

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

Minimal complete definition

toEnum, fromEnum

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

Instances details
Enum CBool 
Instance details

Defined in Foreign.C.Types

Enum CChar 
Instance details

Defined in Foreign.C.Types

Enum CClock 
Instance details

Defined in Foreign.C.Types

Enum CDouble 
Instance details

Defined in Foreign.C.Types

Enum CFloat 
Instance details

Defined in Foreign.C.Types

Enum CInt 
Instance details

Defined in Foreign.C.Types

Methods

succ :: CInt -> CInt #

pred :: CInt -> CInt #

toEnum :: Int -> CInt #

fromEnum :: CInt -> Int #

enumFrom :: CInt -> [CInt] #

enumFromThen :: CInt -> CInt -> [CInt] #

enumFromTo :: CInt -> CInt -> [CInt] #

enumFromThenTo :: CInt -> CInt -> CInt -> [CInt] #

Enum CIntMax 
Instance details

Defined in Foreign.C.Types

Enum CIntPtr 
Instance details

Defined in Foreign.C.Types

Enum CLLong 
Instance details

Defined in Foreign.C.Types

Enum CLong 
Instance details

Defined in Foreign.C.Types

Enum CPtrdiff 
Instance details

Defined in Foreign.C.Types

Enum CSChar 
Instance details

Defined in Foreign.C.Types

Enum CSUSeconds 
Instance details

Defined in Foreign.C.Types

Enum CShort 
Instance details

Defined in Foreign.C.Types

Enum CSigAtomic 
Instance details

Defined in Foreign.C.Types

Enum CSize 
Instance details

Defined in Foreign.C.Types

Enum CTime 
Instance details

Defined in Foreign.C.Types

Enum CUChar 
Instance details

Defined in Foreign.C.Types

Enum CUInt 
Instance details

Defined in Foreign.C.Types

Enum CUIntMax 
Instance details

Defined in Foreign.C.Types

Enum CUIntPtr 
Instance details

Defined in Foreign.C.Types

Enum CULLong 
Instance details

Defined in Foreign.C.Types

Enum CULong 
Instance details

Defined in Foreign.C.Types

Enum CUSeconds 
Instance details

Defined in Foreign.C.Types

Enum CUShort 
Instance details

Defined in Foreign.C.Types

Enum CWchar 
Instance details

Defined in Foreign.C.Types

Enum Associativity

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Enum DecidedStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Enum SourceStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Enum SourceUnpackedness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Enum Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Enum Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Enum Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Enum Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

succ :: 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] #

Enum Word16

Since: base-2.1

Instance details

Defined in GHC.Word

Enum Word32

Since: base-2.1

Instance details

Defined in GHC.Word

Enum Word64

Since: base-2.1

Instance details

Defined in GHC.Word

Enum Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Enum Extension 
Instance details

Defined in GHC.LanguageExtensions.Type

Enum Ordering

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum FailOn 
Instance details

Defined in Test.Hspec.Core.Config.Definition

Methods

succ :: FailOn -> FailOn #

pred :: FailOn -> FailOn #

toEnum :: Int -> FailOn #

fromEnum :: FailOn -> Int #

enumFrom :: FailOn -> [FailOn] #

enumFromThen :: FailOn -> FailOn -> [FailOn] #

enumFromTo :: FailOn -> FailOn -> [FailOn] #

enumFromThenTo :: FailOn -> FailOn -> FailOn -> [FailOn] #

Enum TestQuality 
Instance details

Defined in Test.SmallCheck.Property

Enum Day 
Instance details

Defined in Data.Time.Calendar.Days

Methods

succ :: 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] #

Enum Integer

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Enum

Enum ()

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: () -> () #

pred :: () -> () #

toEnum :: Int -> () #

fromEnum :: () -> Int #

enumFrom :: () -> [()] #

enumFromThen :: () -> () -> [()] #

enumFromTo :: () -> () -> [()] #

enumFromThenTo :: () -> () -> () -> [()] #

Enum Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: 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] #

Enum Char

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: 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] #

Enum Int

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: 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] #

Enum Levity

Since: base-4.16.0.0

Instance details

Defined in GHC.Enum

Enum VecCount

Since: base-4.10.0.0

Instance details

Defined in GHC.Enum

Enum VecElem

Since: base-4.10.0.0

Instance details

Defined in GHC.Enum

Enum Word

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: 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] #

Enum a => Enum (Blind a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

succ :: 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 details

Defined in Test.QuickCheck.Modifiers

Methods

succ :: 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 (Large a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

succ :: 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 (Negative a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Enum a => Enum (NonNegative a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Enum a => Enum (NonPositive a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Enum a => Enum (NonZero a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

succ :: 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 (Positive a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Enum a => Enum (Shrink2 a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

succ :: 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 (Small a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

succ :: 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 (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Integral a => Enum (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

succ :: 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 (M a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

succ :: 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 (N a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

succ :: 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 (NonNegative a) 
Instance details

Defined in Test.SmallCheck.Series

Enum a => Enum (NonZero a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

succ :: 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 (Positive a) 
Instance details

Defined in Test.SmallCheck.Series

Enum a => Enum (a) 
Instance details

Defined in GHC.Enum

Methods

succ :: (a) -> (a) #

pred :: (a) -> (a) #

toEnum :: Int -> (a) #

fromEnum :: (a) -> Int #

enumFrom :: (a) -> [(a)] #

enumFromThen :: (a) -> (a) -> [(a)] #

enumFromTo :: (a) -> (a) -> [(a)] #

enumFromThenTo :: (a) -> (a) -> (a) -> [(a)] #

Enum (Fixed a)

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,

  succ (0.000 :: Milli) == 1.001

and likewise

  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

  succ (0.000000000000 :: Pico) == 0.000000000001

and similarly

  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.

Since: base-2.1

Instance details

Defined in Data.Fixed

Methods

succ :: 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 (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

succ :: 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 a => Enum (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

succ :: Const a b -> Const a b #

pred :: Const a b -> Const a b #

toEnum :: Int -> Const a b #

fromEnum :: Const a b -> Int #

enumFrom :: Const a b -> [Const a b] #

enumFromThen :: Const a b -> Const a b -> [Const a b] #

enumFromTo :: Const a b -> Const a b -> [Const a b] #

enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] #

Enum (f a) => Enum (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

succ :: 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 details

Defined in Data.Semigroup.Internal

Methods

succ :: 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 details

Defined in Data.Type.Equality

Methods

succ :: (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 details

Defined in Data.Type.Equality

Methods

succ :: (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 Applicative m => Monad (m :: Type -> Type) where #

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

Instances of Monad should satisfy the following:

Left identity
return a >>= k = k a
Right identity
m >>= return = m
Associativity
m >>= (\x -> k x >>= h) = (m >>= k) >>= h

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

The above laws imply:

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

The instances of Monad for 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.

'as >>= bs' can be understood as the do expression

do a <- as
   bs a

(>>) :: 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.

'as >> bs' can be understood as the do expression

do as
   bs

return :: a -> m a #

Inject a value into the monadic type.

Instances

Instances details
Monad Gen 
Instance details

Defined in Test.QuickCheck.Gen

Methods

(>>=) :: Gen a -> (a -> Gen b) -> Gen b #

(>>) :: Gen a -> Gen b -> Gen b #

return :: a -> Gen a #

Monad Rose 
Instance details

Defined in Test.QuickCheck.Property

Methods

(>>=) :: Rose a -> (a -> Rose b) -> Rose b #

(>>) :: Rose a -> Rose b -> Rose b #

return :: a -> Rose a #

Monad Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

(>>=) :: Complex a -> (a -> Complex b) -> Complex b #

(>>) :: Complex a -> Complex b -> Complex b #

return :: a -> Complex a #

Monad Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(>>=) :: Identity a -> (a -> Identity b) -> Identity b #

(>>) :: Identity a -> Identity b -> Identity b #

return :: a -> Identity a #

Monad First

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

(>>=) :: First a -> (a -> First b) -> First b #

(>>) :: First a -> First b -> First b #

return :: a -> First a #

Monad Last

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

(>>=) :: Last a -> (a -> Last b) -> Last b #

(>>) :: Last a -> Last b -> Last b #

return :: a -> Last a #

Monad Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(>>=) :: Dual a -> (a -> Dual b) -> Dual b #

(>>) :: Dual a -> Dual b -> Dual b #

return :: a -> Dual a #

Monad Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(>>=) :: Product a -> (a -> Product b) -> Product b #

(>>) :: Product a -> Product b -> Product b #

return :: a -> Product a #

Monad Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(>>=) :: Sum a -> (a -> Sum b) -> Sum b #

(>>) :: Sum a -> Sum b -> Sum b #

return :: a -> Sum a #

Monad Par1

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b #

(>>) :: Par1 a -> Par1 b -> Par1 b #

return :: a -> Par1 a #

Monad P

Since: base-2.1

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

(>>=) :: P a -> (a -> P b) -> P b #

(>>) :: P a -> P b -> P b #

return :: a -> P a #

Monad ReadP

Since: base-2.1

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

(>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b #

(>>) :: ReadP a -> ReadP b -> ReadP b #

return :: a -> ReadP a #

Monad ReadPrec

Since: base-2.1

Instance details

Defined in Text.ParserCombinators.ReadPrec

Methods

(>>=) :: ReadPrec a -> (a -> ReadPrec b) -> ReadPrec b #

(>>) :: ReadPrec a -> ReadPrec b -> ReadPrec b #

return :: a -> ReadPrec a #

Monad Seq 
Instance details

Defined in Data.Sequence.Internal

Methods

(>>=) :: Seq a -> (a -> Seq b) -> Seq b #

(>>) :: Seq a -> Seq b -> Seq b #

return :: a -> Seq a #

Monad Tree 
Instance details

Defined in Data.Tree

Methods

(>>=) :: Tree a -> (a -> Tree b) -> Tree b #

(>>) :: Tree a -> Tree b -> Tree b #

return :: a -> Tree a #

Monad IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

(>>=) :: IO a -> (a -> IO b) -> IO b #

(>>) :: IO a -> IO b -> IO b #

return :: a -> IO a #

Monad Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

(>>=) :: Q a -> (a -> Q b) -> Q b #

(>>) :: Q a -> Q b -> Q b #

return :: a -> Q a #

Monad NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b #

(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

return :: a -> NonEmpty a #

Monad Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #

(>>) :: Maybe a -> Maybe b -> Maybe b #

return :: a -> Maybe a #

Monad Solo

Since: base-4.15

Instance details

Defined in GHC.Base

Methods

(>>=) :: Solo a -> (a -> Solo b) -> Solo b #

(>>) :: Solo a -> Solo b -> Solo b #

return :: a -> Solo a #

Monad []

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

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

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

return :: a -> [a] #

Monad m => Monad (WrappedMonad m)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Methods

(>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b #

(>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b #

return :: a -> WrappedMonad m a #

Monad (Either e)

Since: base-4.4.0.0

Instance details

Defined 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 #

Monad (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b #

(>>) :: Proxy a -> Proxy b -> Proxy b #

return :: a -> Proxy a #

Monad (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(>>=) :: U1 a -> (a -> U1 b) -> U1 b #

(>>) :: U1 a -> U1 b -> U1 b #

return :: a -> U1 a #

Monoid es => Monad (CollectErrors es) 
Instance details

Defined in Control.CollectErrors.Type

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 #

Monad (SpecM a) 
Instance details

Defined 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 #

Monoid a => Monad ((,) a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) #

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

return :: a0 -> (a, a0) #

Monad f => Monad (Ap f)

Since: base-4.12.0.0

Instance details

Defined 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 #

Monad f => Monad (Alt f)

Since: base-4.8.0.0

Instance details

Defined 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 #

Monad f => Monad (Rec1 f)

Since: base-4.9.0.0

Instance details

Defined 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 #

(Applicative f, Monad f) => Monad (WhenMissing f x)

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

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

(>>=) :: WhenMissing f x a -> (a -> WhenMissing f x b) -> WhenMissing f x b #

(>>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b #

return :: a -> WhenMissing f x a #

(Monad m, Error e) => Monad (ErrorT e m) 
Instance details

Defined 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 #

Monad m => Monad (ReaderT r m) 
Instance details

Defined 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 #

(Monoid w, Monad m) => Monad (WriterT w m) 
Instance details

Defined 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 #

(Monoid a, Monoid b) => Monad ((,,) a b)

Since: base-4.14.0.0

Instance details

Defined in GHC.Base

Methods

(>>=) :: (a, b, a0) -> (a0 -> (a, b, b0)) -> (a, b, b0) #

(>>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) #

return :: a0 -> (a, b, a0) #

(Monad f, Monad g) => Monad (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

(>>=) :: Product f g a -> (a -> Product f g b) -> Product f g b #

(>>) :: Product f g a -> Product f g b -> Product f g b #

return :: a -> Product f g a #

(Monad f, Monad g) => Monad (f :*: g)

Since: base-4.9.0.0

Instance details

Defined 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 #

(Monad f, Applicative f) => Monad (WhenMatched f x y)

Equivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

(>>=) :: WhenMatched f x y a -> (a -> WhenMatched f x y b) -> WhenMatched f x y b #

(>>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b #

return :: a -> WhenMatched f x y a #

(Applicative f, Monad f) => Monad (WhenMissing f k x)

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

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

(>>=) :: WhenMissing f k x a -> (a -> WhenMissing f k x b) -> WhenMissing f k x b #

(>>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b #

return :: a -> WhenMissing f k x a #

(Monoid a, Monoid b, Monoid c) => Monad ((,,,) a b c)

Since: base-4.14.0.0

Instance details

Defined in GHC.Base

Methods

(>>=) :: (a, b, c, a0) -> (a0 -> (a, b, c, b0)) -> (a, b, c, b0) #

(>>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) #

return :: a0 -> (a, b, c, a0) #

Monad ((->) r)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

(>>=) :: (r -> a) -> (a -> r -> b) -> r -> b #

(>>) :: (r -> a) -> (r -> b) -> r -> b #

return :: a -> r -> a #

Monad f => Monad (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined 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 #

(Monad f, Applicative f) => Monad (WhenMatched f k x y)

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

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

(>>=) :: WhenMatched f k x y a -> (a -> WhenMatched f k x y b) -> WhenMatched f k x y b #

(>>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b #

return :: a -> WhenMatched f k x y a #

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

A type f is a Functor if it provides a function fmap which, given any types a and b lets you apply any function from (a -> b) to turn an f a into an f b, preserving the structure of f. Furthermore f needs to adhere to the following:

Identity
fmap id == id
Composition
fmap (f . g) == fmap f . fmap g

Note, that the second law follows from the free theorem of the type fmap and the first law, so you need only check that the former condition holds.

Minimal complete definition

fmap

Methods

fmap :: (a -> b) -> f a -> f b #

fmap is used to apply a function of type (a -> b) to a value of type f a, where f is a functor, to produce a value of type f b. Note that for any type constructor with more than one parameter (e.g., Either), only the last type parameter can be modified with fmap (e.g., b in `Either a b`).

Some type constructors with two parameters or more have a Bifunctor instance that allows both the last and the penultimate parameters to be mapped over.

Examples

Expand

Convert from a Maybe Int to a Maybe String using show:

>>> fmap show Nothing
Nothing
>>> fmap show (Just 3)
Just "3"

Convert from an Either Int Int to an Either Int String using show:

>>> fmap show (Left 17)
Left 17
>>> fmap show (Right 17)
Right "17"

Double each element of a list:

>>> fmap (*2) [1,2,3]
[2,4,6]

Apply even to the second element of a pair:

>>> fmap even (2,2)
(2,True)

It may seem surprising that the function is only applied to the last element of the tuple compared to the list example above which applies it to every element in the list. To understand, remember that tuples are type constructors with multiple type parameters: a tuple of 3 elements (a,b,c) can also be written (,,) a b c and its Functor instance is defined for Functor ((,,) a b) (i.e., only the third parameter is free to be mapped over with fmap).

It explains why fmap can be used with tuples containing values of different types as in the following example:

>>> fmap even ("hello", 1.0, 4)
("hello",1.0,True)

(<$) :: 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

Instances details
Functor Gen 
Instance details

Defined in Test.QuickCheck.Gen

Methods

fmap :: (a -> b) -> Gen a -> Gen b #

(<$) :: a -> Gen b -> Gen a #

Functor Blind 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Blind a -> Blind b #

(<$) :: a -> Blind b -> Blind a #

Functor Fixed 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Fixed a -> Fixed b #

(<$) :: a -> Fixed b -> Fixed a #

Functor Large 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Large a -> Large b #

(<$) :: a -> Large b -> Large a #

Functor Negative 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Negative a -> Negative b #

(<$) :: a -> Negative b -> Negative a #

Functor NonEmptyList 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> NonEmptyList a -> NonEmptyList b #

(<$) :: a -> NonEmptyList b -> NonEmptyList a #

Functor NonNegative 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> NonNegative a -> NonNegative b #

(<$) :: a -> NonNegative b -> NonNegative a #

Functor NonPositive 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> NonPositive a -> NonPositive b #

(<$) :: a -> NonPositive b -> NonPositive a #

Functor NonZero 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> NonZero a -> NonZero b #

(<$) :: a -> NonZero b -> NonZero a #

Functor OrderedList 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> OrderedList a -> OrderedList b #

(<$) :: a -> OrderedList b -> OrderedList a #

Functor Positive 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Positive a -> Positive b #

(<$) :: a -> Positive b -> Positive a #

Functor Shrink2 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Shrink2 a -> Shrink2 b #

(<$) :: a -> Shrink2 b -> Shrink2 a #

Functor Small 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Small a -> Small b #

(<$) :: a -> Small b -> Small a #

Functor Smart 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Smart a -> Smart b #

(<$) :: a -> Smart b -> Smart a #

Functor SortedList 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> SortedList a -> SortedList b #

(<$) :: a -> SortedList b -> SortedList a #

Functor Rose 
Instance details

Defined in Test.QuickCheck.Property

Methods

fmap :: (a -> b) -> Rose a -> Rose b #

(<$) :: a -> Rose b -> Rose a #

Functor ZipList

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

fmap :: (a -> b) -> ZipList a -> ZipList b #

(<$) :: a -> ZipList b -> ZipList a #

Functor Handler

Since: base-4.6.0.0

Instance details

Defined in Control.Exception

Methods

fmap :: (a -> b) -> Handler a -> Handler b #

(<$) :: a -> Handler b -> Handler a #

Functor Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

fmap :: (a -> b) -> Complex a -> Complex b #

(<$) :: a -> Complex b -> Complex a #

Functor Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fmap :: (a -> b) -> Identity a -> Identity b #

(<$) :: a -> Identity b -> Identity a #

Functor First

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

fmap :: (a -> b) -> First a -> First b #

(<$) :: a -> First b -> First a #

Functor Last

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

fmap :: (a -> b) -> Last a -> Last b #

(<$) :: a -> Last b -> Last a #

Functor Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Dual a -> Dual b #

(<$) :: a -> Dual b -> Dual a #

Functor Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Product a -> Product b #

(<$) :: a -> Product b -> Product a #

Functor Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Sum a -> Sum b #

(<$) :: a -> Sum b -> Sum a #

Functor Par1

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> Par1 a -> Par1 b #

(<$) :: a -> Par1 b -> Par1 a #

Functor P

Since: base-4.8.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

fmap :: (a -> b) -> P a -> P b #

(<$) :: a -> P b -> P a #

Functor ReadP

Since: base-2.1

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

fmap :: (a -> b) -> ReadP a -> ReadP b #

(<$) :: a -> ReadP b -> ReadP a #

Functor ReadPrec

Since: base-2.1

Instance details

Defined in Text.ParserCombinators.ReadPrec

Methods

fmap :: (a -> b) -> ReadPrec a -> ReadPrec b #

(<$) :: a -> ReadPrec b -> ReadPrec a #

Functor IntMap 
Instance details

Defined in Data.IntMap.Internal

Methods

fmap :: (a -> b) -> IntMap a -> IntMap b #

(<$) :: a -> IntMap b -> IntMap a #

Functor Digit 
Instance details

Defined in Data.Sequence.Internal

Methods

fmap :: (a -> b) -> Digit a -> Digit b #

(<$) :: a -> Digit b -> Digit a #

Functor Elem 
Instance details

Defined in Data.Sequence.Internal

Methods

fmap :: (a -> b) -> Elem a -> Elem b #

(<$) :: a -> Elem b -> Elem a #

Functor FingerTree 
Instance details

Defined in Data.Sequence.Internal

Methods

fmap :: (a -> b) -> FingerTree a -> FingerTree b #

(<$) :: a -> FingerTree b -> FingerTree a #

Functor Node 
Instance details

Defined in Data.Sequence.Internal

Methods

fmap :: (a -> b) -> Node a -> Node b #

(<$) :: a -> Node b -> Node a #

Functor Seq 
Instance details

Defined in Data.Sequence.Internal

Methods

fmap :: (a -> b) -> Seq a -> Seq b #

(<$) :: a -> Seq b -> Seq a #

Functor ViewL 
Instance details

Defined in Data.Sequence.Internal

Methods

fmap :: (a -> b) -> ViewL a -> ViewL b #

(<$) :: a -> ViewL b -> ViewL a #

Functor ViewR 
Instance details

Defined in Data.Sequence.Internal

Methods

fmap :: (a -> b) -> ViewR a -> ViewR b #

(<$) :: a -> ViewR b -> ViewR a #

Functor Tree 
Instance details

Defined in Data.Tree

Methods

fmap :: (a -> b) -> Tree a -> Tree b #

(<$) :: a -> Tree b -> Tree a #

Functor IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> IO a -> IO b #

(<$) :: a -> IO b -> IO a #

Functor NonNegative

Since: smallcheck-1.2.0

Instance details

Defined in Test.SmallCheck.Series

Methods

fmap :: (a -> b) -> NonNegative a -> NonNegative b #

(<$) :: a -> NonNegative b -> NonNegative a #

Functor NonZero 
Instance details

Defined in Test.SmallCheck.Series

Methods

fmap :: (a -> b) -> NonZero a -> NonZero b #

(<$) :: a -> NonZero b -> NonZero a #

Functor Positive

Since: smallcheck-1.2.0

Instance details

Defined in Test.SmallCheck.Series

Methods

fmap :: (a -> b) -> Positive a -> Positive b #

(<$) :: a -> Positive b -> Positive a #

Functor Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

fmap :: (a -> b) -> Q a -> Q b #

(<$) :: a -> Q b -> Q a #

Functor TyVarBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

fmap :: (a -> b) -> TyVarBndr a -> TyVarBndr b #

(<$) :: a -> TyVarBndr b -> TyVarBndr a #

Functor NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> NonEmpty a -> NonEmpty b #

(<$) :: a -> NonEmpty b -> NonEmpty a #

Functor Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> Maybe a -> Maybe b #

(<$) :: a -> Maybe b -> Maybe a #

Functor Solo

Since: base-4.15

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> Solo a -> Solo b #

(<$) :: a -> Solo b -> Solo a #

Functor []

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

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

(<$) :: a -> [b] -> [a] #

Functor ((:->) a) 
Instance details

Defined in Test.QuickCheck.Function

Methods

fmap :: (a0 -> b) -> (a :-> a0) -> a :-> b #

(<$) :: a0 -> (a :-> b) -> a :-> a0 #

Functor (Fun a) 
Instance details

Defined in Test.QuickCheck.Function

Methods

fmap :: (a0 -> b) -> Fun a a0 -> Fun a b #

(<$) :: a0 -> Fun a b -> Fun a a0 #

Functor (Shrinking s) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

fmap :: (a -> b) -> Shrinking s a -> Shrinking s b #

(<$) :: a -> Shrinking s b -> Shrinking s a #

Monad m => Functor (WrappedMonad m)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b #

(<$) :: a -> WrappedMonad m b -> WrappedMonad m a #

Functor (Either a)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

fmap :: (a0 -> b) -> Either a a0 -> Either a b #

(<$) :: a0 -> Either a b -> Either a a0 #

Functor (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b #

(<$) :: a -> Proxy b -> Proxy a #

Functor (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> U1 a -> U1 b #

(<$) :: a -> U1 b -> U1 a #

Functor (V1 :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> V1 a -> V1 b #

(<$) :: a -> V1 b -> V1 a #

Functor (CollectErrors es) 
Instance details

Defined in Control.CollectErrors.Type

Methods

fmap :: (a -> b) -> CollectErrors es a -> CollectErrors es b #

(<$) :: a -> CollectErrors es b -> CollectErrors es a #

Functor (Map k) 
Instance details

Defined in Data.Map.Internal

Methods

fmap :: (a -> b) -> Map k a -> Map k b #

(<$) :: a -> Map k b -> Map k a #

Functor (SpecM a) 
Instance details

Defined in Test.Hspec.Core.Spec.Monad

Methods

fmap :: (a0 -> b) -> SpecM a a0 -> SpecM a b #

(<$) :: a0 -> SpecM a b -> SpecM a a0 #

Functor (Tree c) 
Instance details

Defined in Test.Hspec.Core.Tree

Methods

fmap :: (a -> b) -> Tree c a -> Tree c b #

(<$) :: a -> Tree c b -> Tree c a #

Functor ((,) a)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

fmap :: (a0 -> b) -> (a, a0) -> (a, b) #

(<$) :: a0 -> (a, b) -> (a, a0) #

Arrow a => Functor (WrappedArrow a b)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 #

(<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #

Functor (Const m :: Type -> Type)

Since: base-2.1

Instance details

Defined in Data.Functor.Const

Methods

fmap :: (a -> b) -> Const m a -> Const m b #

(<$) :: a -> Const m b -> Const m a #

Functor f => Functor (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

fmap :: (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 details

Defined in Data.Semigroup.Internal

Methods

fmap :: (a -> b) -> Alt f a -> Alt f b #

(<$) :: a -> Alt f b -> Alt f a #

Functor f => Functor (Rec1 f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> Rec1 f a -> Rec1 f b #

(<$) :: a -> Rec1 f b -> Rec1 f a #

Functor (URec (Ptr ()) :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b #

(<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a #

Functor (URec Char :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Char a -> URec Char b #

(<$) :: a -> URec Char b -> URec Char a #

Functor (URec Double :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Double a -> URec Double b #

(<$) :: a -> URec Double b -> URec Double a #

Functor (URec Float :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Float a -> URec Float b #

(<$) :: a -> URec Float b -> URec Float a #

Functor (URec Int :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Int a -> URec Int b #

(<$) :: a -> URec Int b -> URec Int a #

Functor (URec Word :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Word a -> URec Word b #

(<$) :: a -> URec Word b -> URec Word a #

(Applicative f, Monad f) => Functor (WhenMissing f x)

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

fmap :: (a -> b) -> WhenMissing f x a -> WhenMissing f x b #

(<$) :: a -> WhenMissing f x b -> WhenMissing f x a #

Functor m => Functor (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

fmap :: (a -> b) -> ErrorT e m a -> ErrorT e m b #

(<$) :: a -> ErrorT e m b -> ErrorT e m a #

Functor m => Functor (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

fmap :: (a -> b) -> ReaderT r m a -> ReaderT r m b #

(<$) :: a -> ReaderT r m b -> ReaderT r m a #

Functor m => Functor (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

fmap :: (a -> b) -> WriterT w m a -> WriterT w m b #

(<$) :: a -> WriterT w m b -> WriterT w m a #

Functor (Constant a :: Type -> Type) 
Instance details

Defined in Data.Functor.Constant

Methods

fmap :: (a0 -> b) -> Constant a a0 -> Constant a b #

(<$) :: a0 -> Constant a b -> Constant a a0 #

Functor ((,,) a b)

Since: base-4.14.0.0

Instance details

Defined in GHC.Base

Methods

fmap :: (a0 -> b0) -> (a, b, a0) -> (a, b, b0) #

(<$) :: a0 -> (a, b, b0) -> (a, b, a0) #

(Functor f, Functor g) => Functor (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

fmap :: (a -> b) -> Product f g a -> Product f g b #

(<$) :: a -> Product f g b -> Product f g a #

(Functor f, Functor g) => Functor (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (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 details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b #

(<$) :: a -> (f :+: g) b -> (f :+: g) a #

Functor (K1 i c :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> K1 i c a -> K1 i c b #

(<$) :: a -> K1 i c b -> K1 i c a #

Functor f => Functor (WhenMatched f x y)

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

fmap :: (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b #

(<$) :: a -> WhenMatched f x y b -> WhenMatched f x y a #

(Applicative f, Monad f) => Functor (WhenMissing f k x)

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

fmap :: (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b #

(<$) :: a -> WhenMissing f k x b -> WhenMissing f k x a #

Functor ((,,,) a b c)

Since: base-4.14.0.0

Instance details

Defined in GHC.Base

Methods

fmap :: (a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) #

(<$) :: a0 -> (a, b, c, b0) -> (a, b, c, a0) #

Functor ((->) r)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> (r -> a) -> r -> b #

(<$) :: a -> (r -> b) -> r -> a #

(Functor f, Functor g) => Functor (Compose f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

fmap :: (a -> b) -> Compose f g a -> Compose f g b #

(<$) :: a -> Compose f g b -> Compose f g a #

(Functor f, Functor g) => Functor (f :.: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> (f :.: g) a -> (f :.: g) b #

(<$) :: a -> (f :.: g) b -> (f :.: g) a #

Functor f => Functor (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (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 (WhenMatched f k x y)

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

fmap :: (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b #

(<$) :: a -> WhenMatched f k x y b -> WhenMatched f k x y a #

class Read a where #

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

        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

Minimal complete definition

readsPrec | readPrec

Methods

readsPrec #

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:

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

Instances details
Read ASCIIString 
Instance details

Defined in Test.QuickCheck.Modifiers

Read PrintableString 
Instance details

Defined in Test.QuickCheck.Modifiers

Read UnicodeString 
Instance details

Defined in Test.QuickCheck.Modifiers

Read QCGen 
Instance details

Defined in Test.QuickCheck.Random

Methods

readsPrec :: Int -> ReadS QCGen #

readList :: ReadS [QCGen] #

readPrec :: ReadPrec QCGen #

readListPrec :: ReadPrec [QCGen] #

Read Args 
Instance details

Defined in Test.QuickCheck.Test

Read All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Read Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Read Version

Since: base-2.1

Instance details

Defined in Data.Version

Read Void

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

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Read CBool 
Instance details

Defined in Foreign.C.Types

Read CChar 
Instance details

Defined in Foreign.C.Types

Read CClock 
Instance details

Defined in Foreign.C.Types

Read CDouble 
Instance details

Defined in Foreign.C.Types

Read CFloat 
Instance details

Defined in Foreign.C.Types

Read CInt 
Instance details

Defined in Foreign.C.Types

Read CIntMax 
Instance details

Defined in Foreign.C.Types

Read CIntPtr 
Instance details

Defined in Foreign.C.Types

Read CLLong 
Instance details

Defined in Foreign.C.Types

Read CLong 
Instance details

Defined in Foreign.C.Types

Read CPtrdiff 
Instance details

Defined in Foreign.C.Types

Read CSChar 
Instance details

Defined in Foreign.C.Types

Read CSUSeconds 
Instance details

Defined in Foreign.C.Types

Read CShort 
Instance details

Defined in Foreign.C.Types

Read CSigAtomic 
Instance details

Defined in Foreign.C.Types

Read CSize 
Instance details

Defined in Foreign.C.Types

Read CTime 
Instance details

Defined in Foreign.C.Types

Read CUChar 
Instance details

Defined in Foreign.C.Types

Read CUInt 
Instance details

Defined in Foreign.C.Types

Read CUIntMax 
Instance details

Defined in Foreign.C.Types

Read CUIntPtr 
Instance details

Defined in Foreign.C.Types

Read CULLong 
Instance details

Defined in Foreign.C.Types

Read CULong 
Instance details

Defined in Foreign.C.Types

Read CUSeconds 
Instance details

Defined in Foreign.C.Types

Read CUShort 
Instance details

Defined in Foreign.C.Types

Read CWchar 
Instance details

Defined in Foreign.C.Types

Read Associativity

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Read DecidedStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Read Fixity

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Read SourceStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Read SourceUnpackedness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Read ExitCode 
Instance details

Defined in GHC.IO.Exception

Read BufferMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.Handle.Types

Read Newline

Since: base-4.3.0.0

Instance details

Defined in GHC.IO.Handle.Types

Read NewlineMode

Since: base-4.3.0.0

Instance details

Defined in GHC.IO.Handle.Types

Read Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Read Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Read Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Read Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Read GeneralCategory

Since: base-2.1

Instance details

Defined in GHC.Read

Read Word16

Since: base-2.1

Instance details

Defined in GHC.Read

Read Word32

Since: base-2.1

Instance details

Defined in GHC.Read

Read Word64

Since: base-2.1

Instance details

Defined in GHC.Read

Read Word8

Since: base-2.1

Instance details

Defined in GHC.Read

Read Lexeme

Since: base-2.1

Instance details

Defined in GHC.Read

Read IntSet 
Instance details

Defined in Data.IntSet.Internal

Read Ordering

Since: base-2.1

Instance details

Defined in GHC.Read

Read ConvertError Source # 
Instance details

Defined in Data.Convertible.Base

Read Integer

Since: base-2.1

Instance details

Defined in GHC.Read

Read Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Read

Read ()

Since: base-2.1

Instance details

Defined in GHC.Read

Methods

readsPrec :: Int -> ReadS () #

readList :: ReadS [()] #

readPrec :: ReadPrec () #

readListPrec :: ReadPrec [()] #

Read Bool

Since: base-2.1

Instance details

Defined in GHC.Read

Read Char

Since: base-2.1

Instance details

Defined in GHC.Read

Read Double

Since: base-2.1

Instance details

Defined in GHC.Read

Read Float

Since: base-2.1

Instance details

Defined in GHC.Read

Read Int

Since: base-2.1

Instance details

Defined in GHC.Read

Read Word

Since: base-4.5.0.0

Instance details

Defined in GHC.Read

Read a => Read (Fixed a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (Large a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (Negative a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (NonEmptyList a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (NonNegative a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (NonPositive a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (NonZero a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (OrderedList a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (Positive a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (Shrink2 a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (Small a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (SortedList a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Read a => Read (ZipList a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Read a => Read (Complex a)

Since: base-2.1

Instance details

Defined in Data.Complex

Read a => Read (Identity a)

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

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Read a => Read (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Read a => Read (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Read a => Read (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Read a => Read (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Read a => Read (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Read p => Read (Par1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

(Integral a, Read a) => Read (Ratio a)

Since: base-2.1

Instance details

Defined in GHC.Read

Read e => Read (IntMap e) 
Instance details

Defined in Data.IntMap.Internal

Read a => Read (Seq a) 
Instance details

Defined in Data.Sequence.Internal

Read a => Read (ViewL a) 
Instance details

Defined in Data.Sequence.Internal

Read a => Read (ViewR a) 
Instance details

Defined in Data.Sequence.Internal

(Read a, Ord a) => Read (Set a) 
Instance details

Defined in Data.Set.Internal

Read a => Read (Tree a) 
Instance details

Defined in Data.Tree

Read a => Read (NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Read

Read a => Read (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Read

Read a => Read (a)

Since: base-4.15

Instance details

Defined in GHC.Read

Methods

readsPrec :: Int -> ReadS (a) #

readList :: ReadS [(a)] #

readPrec :: ReadPrec (a) #

readListPrec :: ReadPrec [(a)] #

Read a => Read [a]

Since: base-2.1

Instance details

Defined in GHC.Read

Methods

readsPrec :: Int -> ReadS [a] #

readList :: ReadS [[a]] #

readPrec :: ReadPrec [a] #

readListPrec :: ReadPrec [[a]] #

(Read a, Read b) => Read (Either a b)

Since: base-3.0

Instance details

Defined in Data.Either

HasResolution a => Read (Fixed a)

Since: base-4.3.0.0

Instance details

Defined in Data.Fixed

Read (Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

(Ix a, Read a, Read b) => Read (Array a b)

Since: base-2.1

Instance details

Defined in GHC.Read

Read (U1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Read (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

(Ord k, Read k, Read e) => Read (Map k e) 
Instance details

Defined in Data.Map.Internal

Methods

readsPrec :: Int -> ReadS (Map k e) #

readList :: ReadS [Map k e] #

readPrec :: ReadPrec (Map k e) #

readListPrec :: ReadPrec [Map k e] #

(Read a, Read b) => Read (a, b)

Since: base-2.1

Instance details

Defined in GHC.Read

Methods

readsPrec :: Int -> ReadS (a, b) #

readList :: ReadS [(a, b)] #

readPrec :: ReadPrec (a, b) #

readListPrec :: ReadPrec [(a, b)] #

Read a => Read (Const a b)

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

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Const

Read (f a) => Read (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

readsPrec :: 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 details

Defined in Data.Semigroup.Internal

Methods

readsPrec :: 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 details

Defined in Data.Type.Equality

Methods

readsPrec :: Int -> ReadS (a :~: b) #

readList :: ReadS [a :~: b] #

readPrec :: ReadPrec (a :~: b) #

readListPrec :: ReadPrec [a :~: b] #

Read (f p) => Read (Rec1 f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: Int -> ReadS (Rec1 f p) #

readList :: ReadS [Rec1 f p] #

readPrec :: ReadPrec (Rec1 f p) #

readListPrec :: ReadPrec [Rec1 f p] #

(Read e, Read1 m, Read a) => Read (ErrorT e m a) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

readsPrec :: 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 details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

readsPrec :: 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 a => Read (Constant a b) 
Instance details

Defined in Data.Functor.Constant

(Read a, Read b, Read c) => Read (a, b, c)

Since: base-2.1

Instance details

Defined in GHC.Read

Methods

readsPrec :: Int -> ReadS (a, b, c) #

readList :: ReadS [(a, b, c)] #

readPrec :: ReadPrec (a, b, c) #

readListPrec :: ReadPrec [(a, b, c)] #

(Read1 f, Read1 g, Read a) => Read (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

readsPrec :: Int -> ReadS (Product f g a) #

readList :: ReadS [Product f g a] #

readPrec :: ReadPrec (Product f g a) #

readListPrec :: ReadPrec [Product f g a] #

a ~~ b => Read (a :~~: b)

Since: base-4.10.0.0

Instance details

Defined in Data.Type.Equality

Methods

readsPrec :: Int -> ReadS (a :~~: b) #

readList :: ReadS [a :~~: b] #

readPrec :: ReadPrec (a :~~: b) #

readListPrec :: ReadPrec [a :~~: b] #

(Read (f p), Read (g p)) => Read ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: 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 details

Defined in GHC.Generics

Methods

readsPrec :: Int -> ReadS ((f :+: g) p) #

readList :: ReadS [(f :+: g) p] #

readPrec :: ReadPrec ((f :+: g) p) #

readListPrec :: ReadPrec [(f :+: g) p] #

Read c => Read (K1 i c p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: 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 a, Read b, Read c, Read d) => Read (a, b, c, d)

Since: base-2.1

Instance details

Defined in GHC.Read

Methods

readsPrec :: Int -> ReadS (a, b, c, d) #

readList :: ReadS [(a, b, c, d)] #

readPrec :: ReadPrec (a, b, c, d) #

readListPrec :: ReadPrec [(a, b, c, d)] #

(Read1 f, Read1 g, Read a) => Read (Compose f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

readsPrec :: Int -> ReadS (Compose f g a) #

readList :: ReadS [Compose f g a] #

readPrec :: ReadPrec (Compose f g a) #

readListPrec :: ReadPrec [Compose f g a] #

Read (f (g p)) => Read ((f :.: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: Int -> ReadS ((f :.: g) p) #

readList :: ReadS [(f :.: g) p] #

readPrec :: ReadPrec ((f :.: g) p) #

readListPrec :: ReadPrec [(f :.: g) p] #

Read (f p) => Read (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

readsPrec :: 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 a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e)

Since: base-2.1

Instance details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

readsPrec :: 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 details

Defined in GHC.Read

Methods

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

Instances details
Real CBool 
Instance details

Defined in Foreign.C.Types

Methods

toRational :: CBool -> Rational #

Real CChar 
Instance details

Defined in Foreign.C.Types

Methods

toRational :: CChar -> Rational #

Real CClock 
Instance details

Defined in Foreign.C.Types

Real CDouble 
Instance details

Defined in Foreign.C.Types

Real CFloat 
Instance details

Defined in Foreign.C.Types

Real CInt 
Instance details

Defined in Foreign.C.Types

Methods

toRational :: CInt -> Rational #

Real CIntMax 
Instance details

Defined in Foreign.C.Types

Real CIntPtr 
Instance details

Defined in Foreign.C.Types

Real CLLong 
Instance details

Defined in Foreign.C.Types

Real CLong 
Instance details

Defined in Foreign.C.Types

Methods

toRational :: CLong -> Rational #

Real CPtrdiff 
Instance details

Defined in Foreign.C.Types

Real CSChar 
Instance details

Defined in Foreign.C.Types

Real CSUSeconds 
Instance details

Defined in Foreign.C.Types

Real CShort 
Instance details

Defined in Foreign.C.Types

Real CSigAtomic 
Instance details

Defined in Foreign.C.Types

Real CSize 
Instance details

Defined in Foreign.C.Types

Methods

toRational :: CSize -> Rational #

Real CTime 
Instance details

Defined in Foreign.C.Types

Methods

toRational :: CTime -> Rational #

Real CUChar 
Instance details

Defined in Foreign.C.Types

Real CUInt 
Instance details

Defined in Foreign.C.Types

Methods

toRational :: CUInt -> Rational #

Real CUIntMax 
Instance details

Defined in Foreign.C.Types

Real CUIntPtr 
Instance details

Defined in Foreign.C.Types

Real CULLong 
Instance details

Defined in Foreign.C.Types

Real CULong 
Instance details

Defined in Foreign.C.Types

Real CUSeconds 
Instance details

Defined in Foreign.C.Types

Real CUShort 
Instance details

Defined in Foreign.C.Types

Real CWchar 
Instance details

Defined in Foreign.C.Types

Real Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

toRational :: Int16 -> Rational #

Real Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

toRational :: Int32 -> Rational #

Real Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

toRational :: Int64 -> Rational #

Real Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

toRational :: Int8 -> Rational #

Real Word16

Since: base-2.1

Instance details

Defined in GHC.Word

Real Word32

Since: base-2.1

Instance details

Defined in GHC.Word

Real Word64

Since: base-2.1

Instance details

Defined in GHC.Word

Real Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Methods

toRational :: Word8 -> Rational #

Real Integer

Since: base-2.0.1

Instance details

Defined in GHC.Real

Real Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Real

Real Int

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

toRational :: Int -> Rational #

Real Word

Since: base-2.1

Instance details

Defined in GHC.Real

Methods

toRational :: Word -> Rational #

Real a => Real (Blind a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

toRational :: Blind a -> Rational #

Real a => Real (Fixed a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

toRational :: Fixed a -> Rational #

Real a => Real (Large a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

toRational :: Large a -> Rational #

Real a => Real (Shrink2 a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

toRational :: Shrink2 a -> Rational #

Real a => Real (Small a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

toRational :: Small a -> Rational #

Real a => Real (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

toRational :: Identity a -> Rational #

Integral a => Real (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

toRational :: Ratio a -> Rational #

Real a => Real (M a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

toRational :: M a -> Rational #

Real a => Real (N a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

toRational :: N a -> Rational #

Real a => Real (NonNegative a) 
Instance details

Defined in Test.SmallCheck.Series

Real a => Real (NonZero a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

toRational :: NonZero a -> Rational #

Real a => Real (Positive a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

toRational :: Positive a -> Rational #

HasResolution a => Real (Fixed a)

Since: base-2.1

Instance details

Defined in Data.Fixed

Methods

toRational :: Fixed a -> Rational #

Real a => Real (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

toRational :: Const a b -> Rational #

class (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 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

Instances details
RealFloat CDouble 
Instance details

Defined in Foreign.C.Types

RealFloat CFloat 
Instance details

Defined in Foreign.C.Types

RealFloat Double

Since: base-2.1

Instance details

Defined in GHC.Float

RealFloat Float

Since: base-2.1

Instance details

Defined in GHC.Float

RealFloat a => RealFloat (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

RealFloat a => RealFloat (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

floatRadix :: Const a b -> Integer #

floatDigits :: Const a b -> Int #

floatRange :: Const a b -> (Int, Int) #

decodeFloat :: Const a b -> (Integer, Int) #

encodeFloat :: Integer -> Int -> Const a b #

exponent :: Const a b -> Int #

significand :: Const a b -> Const a b #

scaleFloat :: Int -> Const a b -> Const a b #

isNaN :: Const a b -> Bool #

isInfinite :: Const a b -> Bool #

isDenormalized :: Const a b -> Bool #

isNegativeZero :: Const a b -> Bool #

isIEEE :: Const a b -> Bool #

atan2 :: Const a b -> Const a b -> Const a b #

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

showsPrec | show

Methods

showsPrec #

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:

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

Instances details
Show FailureReason 
Instance details

Defined in Test.HUnit.Lang

Show HUnitFailure 
Instance details

Defined in Test.HUnit.Lang

Show Result 
Instance details

Defined in Test.HUnit.Lang

Show ASCIIString 
Instance details

Defined in Test.QuickCheck.Modifiers

Show PrintableString 
Instance details

Defined in Test.QuickCheck.Modifiers

Show UnicodeString 
Instance details

Defined in Test.QuickCheck.Modifiers

Show QCGen 
Instance details

Defined in Test.QuickCheck.Random

Methods

showsPrec :: Int -> QCGen -> ShowS #

show :: QCGen -> String #

showList :: [QCGen] -> ShowS #

Show Confidence 
Instance details

Defined in Test.QuickCheck.State

Show Args 
Instance details

Defined in Test.QuickCheck.Test

Methods

showsPrec :: Int -> Args -> ShowS #

show :: Args -> String #

showList :: [Args] -> ShowS #

Show Result 
Instance details

Defined in Test.QuickCheck.Test

Show All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> All -> ShowS #

show :: All -> String #

showList :: [All] -> ShowS #

Show Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> Any -> ShowS #

show :: Any -> String #

showList :: [Any] -> ShowS #

Show SomeTypeRep

Since: base-4.10.0.0

Instance details

Defined in Data.Typeable.Internal

Show Version

Since: base-2.1

Instance details

Defined in Data.Version

Show Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Methods

showsPrec :: Int -> Void -> ShowS #

show :: Void -> String #

showList :: [Void] -> ShowS #

Show CBool 
Instance details

Defined in Foreign.C.Types

Methods

showsPrec :: Int -> CBool -> ShowS #

show :: CBool -> String #

showList :: [CBool] -> ShowS #

Show CChar 
Instance details

Defined in Foreign.C.Types

Methods

showsPrec :: Int -> CChar -> ShowS #

show :: CChar -> String #

showList :: [CChar] -> ShowS #

Show CClock 
Instance details

Defined in Foreign.C.Types

Show CDouble 
Instance details

Defined in Foreign.C.Types

Show CFloat 
Instance details

Defined in Foreign.C.Types

Show CInt 
Instance details

Defined in Foreign.C.Types

Methods

showsPrec :: Int -> CInt -> ShowS #

show :: CInt -> String #

showList :: [CInt] -> ShowS #

Show CIntMax 
Instance details

Defined in Foreign.C.Types

Show CIntPtr 
Instance details

Defined in Foreign.C.Types

Show CLLong 
Instance details

Defined in Foreign.C.Types

Show CLong 
Instance details

Defined in Foreign.C.Types

Methods

showsPrec :: Int -> CLong -> ShowS #

show :: CLong -> String #

showList :: [CLong] -> ShowS #

Show CPtrdiff 
Instance details

Defined in Foreign.C.Types

Show CSChar 
Instance details

Defined in Foreign.C.Types

Show CSUSeconds 
Instance details

Defined in Foreign.C.Types

Show CShort 
Instance details

Defined in Foreign.C.Types

Show CSigAtomic 
Instance details

Defined in Foreign.C.Types

Show CSize 
Instance details

Defined in Foreign.C.Types

Methods

showsPrec :: Int -> CSize -> ShowS #

show :: CSize -> String #

showList :: [CSize] -> ShowS #

Show CTime 
Instance details

Defined in Foreign.C.Types

Methods

showsPrec :: Int -> CTime -> ShowS #

show :: CTime -> String #

showList :: [CTime] -> ShowS #

Show CUChar 
Instance details

Defined in Foreign.C.Types

Show CUInt 
Instance details

Defined in Foreign.C.Types

Methods

showsPrec :: Int -> CUInt -> ShowS #

show :: CUInt -> String #

showList :: [CUInt] -> ShowS #

Show CUIntMax 
Instance details

Defined in Foreign.C.Types

Show CUIntPtr 
Instance details

Defined in Foreign.C.Types

Show CULLong 
Instance details

Defined in Foreign.C.Types

Show CULong 
Instance details

Defined in Foreign.C.Types

Show CUSeconds 
Instance details

Defined in Foreign.C.Types

Show CUShort 
Instance details

Defined in Foreign.C.Types

Show CWchar 
Instance details

Defined in Foreign.C.Types

Show ArithException

Since: base-4.0.0.0

Instance details

Defined in GHC.Exception.Type

Show SomeException

Since: base-3.0

Instance details

Defined in GHC.Exception.Type

Show Associativity

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Show DecidedStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show Fixity

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Show SourceStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show SourceUnpackedness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show MaskingState

Since: base-4.3.0.0

Instance details

Defined in GHC.IO

Show AllocationLimitExceeded

Since: base-4.7.1.0

Instance details

Defined in GHC.IO.Exception

Show ArrayException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show AssertionFailed

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show AsyncException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show BlockedIndefinitelyOnMVar

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show BlockedIndefinitelyOnSTM

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show CompactionFailed

Since: base-4.10.0.0

Instance details

Defined in GHC.IO.Exception

Show Deadlock

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show ExitCode 
Instance details

Defined in GHC.IO.Exception

Show FixIOException

Since: base-4.11.0.0

Instance details

Defined in GHC.IO.Exception

Show IOErrorType

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show IOException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show SomeAsyncException

Since: base-4.7.0.0

Instance details

Defined in GHC.IO.Exception

Show BufferMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.Handle.Types

Show Handle

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

Show HandleType

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

Show Newline

Since: base-4.3.0.0

Instance details

Defined in GHC.IO.Handle.Types

Show NewlineMode

Since: base-4.3.0.0

Instance details

Defined in GHC.IO.Handle.Types

Show Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

showsPrec :: Int -> Int16 -> ShowS #

show :: Int16 -> String #

showList :: [Int16] -> ShowS #

Show Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

showsPrec :: Int -> Int32 -> ShowS #

show :: Int32 -> String #

showList :: [Int32] -> ShowS #

Show Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

showsPrec :: Int -> Int64 -> ShowS #

show :: Int64 -> String #

showList :: [Int64] -> ShowS #

Show Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Methods

showsPrec :: Int -> Int8 -> ShowS #

show :: Int8 -> String #

showList :: [Int8] -> ShowS #

Show FractionalExponentBase 
Instance details

Defined in GHC.Real

Show CallStack

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

Show SrcLoc

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

Show Word16

Since: base-2.1

Instance details

Defined in GHC.Word

Show Word32

Since: base-2.1

Instance details

Defined in GHC.Word

Show Word64

Since: base-2.1

Instance details

Defined in GHC.Word

Show Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Methods

showsPrec :: Int -> Word8 -> ShowS #

show :: Word8 -> String #

showList :: [Word8] -> ShowS #

Show Lexeme

Since: base-2.1

Instance details

Defined in Text.Read.Lex

Show Number

Since: base-4.6.0.0

Instance details

Defined in Text.Read.Lex

Show ErrorCertaintyLevel 
Instance details

Defined in Numeric.CollectErrors.Type

Show NumError 
Instance details

Defined in Numeric.CollectErrors.Type

Show NumErrors 
Instance details

Defined in Numeric.CollectErrors.Type

Show IntSet 
Instance details

Defined in Data.IntSet.Internal

Show Extension 
Instance details

Defined in GHC.LanguageExtensions.Type

Show KindRep 
Instance details

Defined in GHC.Show

Show Module

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

Show Ordering

Since: base-2.1

Instance details

Defined in GHC.Show

Show TrName

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

Show TyCon

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> TyCon -> ShowS #

show :: TyCon -> String #

showList :: [TyCon] -> ShowS #

Show TypeLitSort

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Show ColorMode 
Instance details

Defined in Test.Hspec.Core.Config.Definition

Show UnicodeMode 
Instance details

Defined in Test.Hspec.Core.Config.Definition

Show FailureReason 
Instance details

Defined in Test.Hspec.Core.Example

Show Params 
Instance details

Defined in Test.Hspec.Core.Example

Show Result 
Instance details

Defined in Test.Hspec.Core.Example

Show ResultStatus 
Instance details

Defined in Test.Hspec.Core.Example

Show ConvertError Source # 
Instance details

Defined in Data.Convertible.Base

Show TestQuality 
Instance details

Defined in Test.SmallCheck.Property

Show PropertyFailure 
Instance details

Defined in Test.SmallCheck.Property.Result

Show PropertySuccess 
Instance details

Defined in Test.SmallCheck.Property.Result

Show ForallVisFlag 
Instance details

Defined in Language.Haskell.TH.Ppr

Show AnnLookup 
Instance details

Defined in Language.Haskell.TH.Syntax

Show AnnTarget 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Bang 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Bang -> ShowS #

show :: Bang -> String #

showList :: [Bang] -> ShowS #

Show Body 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Body -> ShowS #

show :: Body -> String #

showList :: [Body] -> ShowS #

Show Bytes 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Bytes -> ShowS #

show :: Bytes -> String #

showList :: [Bytes] -> ShowS #

Show Callconv 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Clause 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Con 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Con -> ShowS #

show :: Con -> String #

showList :: [Con] -> ShowS #

Show Dec 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Dec -> ShowS #

show :: Dec -> String #

showList :: [Dec] -> ShowS #

Show DecidedStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Show DerivClause 
Instance details

Defined in Language.Haskell.TH.Syntax

Show DerivStrategy 
Instance details

Defined in Language.Haskell.TH.Syntax

Show DocLoc 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Exp 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Exp -> ShowS #

show :: Exp -> String #

showList :: [Exp] -> ShowS #

Show FamilyResultSig 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Fixity 
Instance details

Defined in Language.Haskell.TH.Syntax

Show FixityDirection 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Foreign 
Instance details

Defined in Language.Haskell.TH.Syntax

Show FunDep 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Guard 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Guard -> ShowS #

show :: Guard -> String #

showList :: [Guard] -> ShowS #

Show Info 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Info -> ShowS #

show :: Info -> String #

showList :: [Info] -> ShowS #

Show InjectivityAnn 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Inline 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Lit 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Lit -> ShowS #

show :: Lit -> String #

showList :: [Lit] -> ShowS #

Show Loc 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Loc -> ShowS #

show :: Loc -> String #

showList :: [Loc] -> ShowS #

Show Match 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Match -> ShowS #

show :: Match -> String #

showList :: [Match] -> ShowS #

Show ModName 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Module 
Instance details

Defined in Language.Haskell.TH.Syntax

Show ModuleInfo 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Name 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Name -> ShowS #

show :: Name -> String #

showList :: [Name] -> ShowS #

Show NameFlavour 
Instance details

Defined in Language.Haskell.TH.Syntax

Show NameSpace 
Instance details

Defined in Language.Haskell.TH.Syntax

Show OccName 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Overlap 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Pat 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Pat -> ShowS #

show :: Pat -> String #

showList :: [Pat] -> ShowS #

Show PatSynArgs 
Instance details

Defined in Language.Haskell.TH.Syntax

Show PatSynDir 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Phases 
Instance details

Defined in Language.Haskell.TH.Syntax

Show PkgName 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Pragma 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Range 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Range -> ShowS #

show :: Range -> String #

showList :: [Range] -> ShowS #

Show Role 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Role -> ShowS #

show :: Role -> String #

showList :: [Role] -> ShowS #

Show RuleBndr 
Instance details

Defined in Language.Haskell.TH.Syntax

Show RuleMatch 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Safety 
Instance details

Defined in Language.Haskell.TH.Syntax

Show SourceStrictness 
Instance details

Defined in Language.Haskell.TH.Syntax

Show SourceUnpackedness 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Specificity 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Stmt 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Stmt -> ShowS #

show :: Stmt -> String #

showList :: [Stmt] -> ShowS #

Show TyLit 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> TyLit -> ShowS #

show :: TyLit -> String #

showList :: [TyLit] -> ShowS #

Show TySynEqn 
Instance details

Defined in Language.Haskell.TH.Syntax

Show Type 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> Type -> ShowS #

show :: Type -> String #

showList :: [Type] -> ShowS #

Show TypeFamilyHead 
Instance details

Defined in Language.Haskell.TH.Syntax

Show LocalTime 
Instance details

Defined in Data.Time.LocalTime.Internal.LocalTime

Show ZonedTime 
Instance details

Defined in Data.Time.LocalTime.Internal.ZonedTime

Show Integer

Since: base-2.1

Instance details

Defined in GHC.Show

Show Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Show

Show ()

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> () -> ShowS #

show :: () -> String #

showList :: [()] -> ShowS #

Show Bool

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Bool -> ShowS #

show :: Bool -> String #

showList :: [Bool] -> ShowS #

Show Char

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Char -> ShowS #

show :: Char -> String #

showList :: [Char] -> ShowS #

Show Int

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Int -> ShowS #

show :: Int -> String #

showList :: [Int] -> ShowS #

Show Levity

Since: base-4.15.0.0

Instance details

Defined in GHC.Show

Show RuntimeRep

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Show VecCount

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Show VecElem

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Show Word

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Word -> ShowS #

show :: Word -> String #

showList :: [Word] -> ShowS #

Show (Blind a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Blind a -> ShowS #

show :: Blind a -> String #

showList :: [Blind a] -> ShowS #

Show a => Show (Fixed a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Fixed a -> ShowS #

show :: Fixed a -> String #

showList :: [Fixed a] -> ShowS #

Show a => Show (InfiniteList a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Show a => Show (Large a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Large a -> ShowS #

show :: Large a -> String #

showList :: [Large a] -> ShowS #

Show a => Show (Negative a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Negative a -> ShowS #

show :: Negative a -> String #

showList :: [Negative a] -> ShowS #

Show a => Show (NonEmptyList a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Show a => Show (NonNegative a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Show a => Show (NonPositive a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Show a => Show (NonZero a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> NonZero a -> ShowS #

show :: NonZero a -> String #

showList :: [NonZero a] -> ShowS #

Show a => Show (OrderedList a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Show a => Show (Positive a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Positive a -> ShowS #

show :: Positive a -> String #

showList :: [Positive a] -> ShowS #

Show a => Show (Shrink2 a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Shrink2 a -> ShowS #

show :: Shrink2 a -> String #

showList :: [Shrink2 a] -> ShowS #

Show a => Show (Small a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Small a -> ShowS #

show :: Small a -> String #

showList :: [Small a] -> ShowS #

Show a => Show (Smart a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Smart a -> ShowS #

show :: Smart a -> String #

showList :: [Smart a] -> ShowS #

Show a => Show (SortedList a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Show a => Show (ZipList a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

Methods

showsPrec :: Int -> ZipList a -> ShowS #

show :: ZipList a -> String #

showList :: [ZipList a] -> ShowS #

Show a => Show (Complex a)

Since: base-2.1

Instance details

Defined in Data.Complex

Methods

showsPrec :: Int -> Complex a -> ShowS #

show :: Complex a -> String #

showList :: [Complex a] -> ShowS #

Show a => Show (Identity a)

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

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

showsPrec :: Int -> Identity a -> ShowS #

show :: Identity a -> String #

showList :: [Identity a] -> ShowS #

Show a => Show (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

showsPrec :: Int -> First a -> ShowS #

show :: First a -> String #

showList :: [First a] -> ShowS #

Show a => Show (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

showsPrec :: Int -> Last a -> ShowS #

show :: Last a -> String #

showList :: [Last a] -> ShowS #

Show a => Show (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> Dual a -> ShowS #

show :: Dual a -> String #

showList :: [Dual a] -> ShowS #

Show a => Show (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> Product a -> ShowS #

show :: Product a -> String #

showList :: [Product a] -> ShowS #

Show a => Show (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> Sum a -> ShowS #

show :: Sum a -> String #

showList :: [Sum a] -> ShowS #

Show p => Show (Par1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> Par1 p -> ShowS #

show :: Par1 p -> String #

showList :: [Par1 p] -> ShowS #

Show (FunPtr a)

Since: base-2.1

Instance details

Defined in GHC.Ptr

Methods

showsPrec :: Int -> FunPtr a -> ShowS #

show :: FunPtr a -> String #

showList :: [FunPtr a] -> ShowS #

Show (Ptr a)

Since: base-2.1

Instance details

Defined in GHC.Ptr

Methods

showsPrec :: Int -> Ptr a -> ShowS #

show :: Ptr a -> String #

showList :: [Ptr a] -> ShowS #

Show a => Show (Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

showsPrec :: Int -> Ratio a -> ShowS #

show :: Ratio a -> String #

showList :: [Ratio a] -> ShowS #

Show a => Show (IntMap a) 
Instance details

Defined in Data.IntMap.Internal

Methods

showsPrec :: Int -> IntMap a -> ShowS #

show :: IntMap a -> String #

showList :: [IntMap a] -> ShowS #

Show a => Show (Seq a) 
Instance details

Defined in Data.Sequence.Internal

Methods

showsPrec :: Int -> Seq a -> ShowS #

show :: Seq a -> String #

showList :: [Seq a] -> ShowS #

Show a => Show (ViewL a) 
Instance details

Defined in Data.Sequence.Internal

Methods

showsPrec :: Int -> ViewL a -> ShowS #

show :: ViewL a -> String #

showList :: [ViewL a] -> ShowS #

Show a => Show (ViewR a) 
Instance details

Defined in Data.Sequence.Internal

Methods

showsPrec :: Int -> ViewR a -> ShowS #

show :: ViewR a -> String #

showList :: [ViewR a] -> ShowS #

Show a => Show (Set a) 
Instance details

Defined in Data.Set.Internal

Methods

showsPrec :: Int -> Set a -> ShowS #

show :: Set a -> String #

showList :: [Set a] -> ShowS #

Show a => Show (Tree a) 
Instance details

Defined in Data.Tree

Methods

showsPrec :: Int -> Tree a -> ShowS #

show :: Tree a -> String #

showList :: [Tree a] -> ShowS #

Show a => Show (M a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

showsPrec :: Int -> M a -> ShowS #

show :: M a -> String #

showList :: [M a] -> ShowS #

Show a => Show (N a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

showsPrec :: Int -> N a -> ShowS #

show :: N a -> String #

showList :: [N a] -> ShowS #

Show a => Show (NonEmpty a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

showsPrec :: Int -> NonEmpty a -> ShowS #

show :: NonEmpty a -> String #

showList :: [NonEmpty a] -> ShowS #

Show a => Show (NonNegative a) 
Instance details

Defined in Test.SmallCheck.Series

Show a => Show (NonZero a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

showsPrec :: Int -> NonZero a -> ShowS #

show :: NonZero a -> String #

showList :: [NonZero a] -> ShowS #

Show a => Show (Positive a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

showsPrec :: Int -> Positive a -> ShowS #

show :: Positive a -> String #

showList :: [Positive a] -> ShowS #

Show flag => Show (TyVarBndr flag) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

showsPrec :: Int -> TyVarBndr flag -> ShowS #

show :: TyVarBndr flag -> String #

showList :: [TyVarBndr flag] -> ShowS #

Show a => Show (NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> NonEmpty a -> ShowS #

show :: NonEmpty a -> String #

showList :: [NonEmpty a] -> ShowS #

Show a => Show (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Maybe a -> ShowS #

show :: Maybe a -> String #

showList :: [Maybe a] -> ShowS #

Show a => Show (a)

Since: base-4.15

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a) -> ShowS #

show :: (a) -> String #

showList :: [(a)] -> ShowS #

Show a => Show [a]

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> [a] -> ShowS #

show :: [a] -> String #

showList :: [[a]] -> ShowS #

(Show a, Show b) => Show (a :-> b) 
Instance details

Defined in Test.QuickCheck.Function

Methods

showsPrec :: Int -> (a :-> b) -> ShowS #

show :: (a :-> b) -> String #

showList :: [a :-> b] -> ShowS #

(Show a, Show b) => Show (Fun a b) 
Instance details

Defined in Test.QuickCheck.Function

Methods

showsPrec :: Int -> Fun a b -> ShowS #

show :: Fun a b -> String #

showList :: [Fun a b] -> ShowS #

Show a => Show (Shrinking s a) 
Instance details

Defined in Test.QuickCheck.Modifiers

Methods

showsPrec :: Int -> Shrinking s a -> ShowS #

show :: Shrinking s a -> String #

showList :: [Shrinking s a] -> ShowS #

(Show a, Show b) => Show (Either a b)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

showsPrec :: Int -> Either a b -> ShowS #

show :: Either a b -> String #

showList :: [Either a b] -> ShowS #

HasResolution a => Show (Fixed a)

Since: base-2.1

Instance details

Defined in Data.Fixed

Methods

showsPrec :: Int -> Fixed a -> ShowS #

show :: Fixed a -> String #

showList :: [Fixed a] -> ShowS #

Show (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

showsPrec :: Int -> Proxy s -> ShowS #

show :: Proxy s -> String #

showList :: [Proxy s] -> ShowS #

Show (TypeRep a) 
Instance details

Defined in Data.Typeable.Internal

Methods

showsPrec :: Int -> TypeRep a -> ShowS #

show :: TypeRep a -> String #

showList :: [TypeRep a] -> ShowS #

Show (U1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> U1 p -> ShowS #

show :: U1 p -> String #

showList :: [U1 p] -> ShowS #

Show (V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> V1 p -> ShowS #

show :: V1 p -> String #

showList :: [V1 p] -> ShowS #

(Show v, CanBeErrors es) => Show (CollectErrors es v) 
Instance details

Defined in Control.CollectErrors.Type

Methods

showsPrec :: Int -> CollectErrors es v -> ShowS #

show :: CollectErrors es v -> String #

showList :: [CollectErrors es v] -> ShowS #

(Show k, Show a) => Show (Map k a) 
Instance details

Defined in Data.Map.Internal

Methods

showsPrec :: Int -> Map k a -> ShowS #

show :: Map k a -> String #

showList :: [Map k a] -> ShowS #

(Show c, Show a) => Show (Tree c a) 
Instance details

Defined in Test.Hspec.Core.Tree

Methods

showsPrec :: Int -> Tree c a -> ShowS #

show :: Tree c a -> String #

showList :: [Tree c a] -> ShowS #

(Show a, Show b) => Show (a, b)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b) -> ShowS #

show :: (a, b) -> String #

showList :: [(a, b)] -> ShowS #

Show a => Show (Const a b)

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

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Const

Methods

showsPrec :: Int -> Const a b -> ShowS #

show :: Const a b -> String #

showList :: [Const a b] -> ShowS #

Show (f a) => Show (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

showsPrec :: Int -> Ap f a -> ShowS #

show :: Ap f a -> String #

showList :: [Ap f a] -> ShowS #

Show (f a) => Show (Alt f a)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

showsPrec :: Int -> Alt f a -> ShowS #

show :: Alt f a -> String #

showList :: [Alt f a] -> ShowS #

Show (a :~: b)

Since: base-4.7.0.0

Instance details

Defined in Data.Type.Equality

Methods

showsPrec :: Int -> (a :~: b) -> ShowS #

show :: (a :~: b) -> String #

showList :: [a :~: b] -> ShowS #

Show (f p) => Show (Rec1 f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> Rec1 f p -> ShowS #

show :: Rec1 f p -> String #

showList :: [Rec1 f p] -> ShowS #

Show (URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Char p -> ShowS #

show :: URec Char p -> String #

showList :: [URec Char p] -> ShowS #

Show (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Double p -> ShowS #

show :: URec Double p -> String #

showList :: [URec Double p] -> ShowS #

Show (URec Float p) 
Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Float p -> ShowS #

show :: URec Float p -> String #

showList :: [URec Float p] -> ShowS #

Show (URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Int p -> ShowS #

show :: URec Int p -> String #

showList :: [URec Int p] -> ShowS #

Show (URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Word p -> ShowS #

show :: URec Word p -> String #

showList :: [URec Word p] -> ShowS #

(Show e, Show1 m, Show a) => Show (ErrorT e m a) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

showsPrec :: Int -> ErrorT e m a -> ShowS #

show :: ErrorT e m a -> String #

showList :: [ErrorT e m a] -> ShowS #

(Show w, Show1 m, Show a) => Show (WriterT w m a) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

showsPrec :: Int -> WriterT w m a -> ShowS #

show :: WriterT w m a -> String #

showList :: [WriterT w m a] -> ShowS #

Show a => Show (Constant a b) 
Instance details

Defined in Data.Functor.Constant

Methods

showsPrec :: Int -> Constant a b -> ShowS #

show :: Constant a b -> String #

showList :: [Constant a b] -> ShowS #

(Show a, Show b, Show c) => Show (a, b, c)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c) -> ShowS #

show :: (a, b, c) -> String #

showList :: [(a, b, c)] -> ShowS #

(Show1 f, Show1 g, Show a) => Show (Product f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

showsPrec :: Int -> Product f g a -> ShowS #

show :: Product f g a -> String #

showList :: [Product f g a] -> ShowS #

Show (a :~~: b)

Since: base-4.10.0.0

Instance details

Defined in Data.Type.Equality

Methods

showsPrec :: Int -> (a :~~: b) -> ShowS #

show :: (a :~~: b) -> String #

showList :: [a :~~: b] -> ShowS #

(Show (f p), Show (g p)) => Show ((f :*: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> (f :*: g) p -> ShowS #

show :: (f :*: g) p -> String #

showList :: [(f :*: g) p] -> ShowS #

(Show (f p), Show (g p)) => Show ((f :+: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> (f :+: g) p -> ShowS #

show :: (f :+: g) p -> String #

showList :: [(f :+: g) p] -> ShowS #

Show c => Show (K1 i c p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> K1 i c p -> ShowS #

show :: K1 i c p -> String #

showList :: [K1 i c p] -> ShowS #

(Show a, Show b, Show c, Show d) => Show (a, b, c, d)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d) -> ShowS #

show :: (a, b, c, d) -> String #

showList :: [(a, b, c, d)] -> ShowS #

(Show1 f, Show1 g, Show a) => Show (Compose f g a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

showsPrec :: Int -> Compose f g a -> ShowS #

show :: Compose f g a -> String #

showList :: [Compose f g a] -> ShowS #

Show (f (g p)) => Show ((f :.: g) p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> (f :.: g) p -> ShowS #

show :: (f :.: g) p -> String #

showList :: [(f :.: g) p] -> ShowS #

Show (f p) => Show (M1 i c f p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> M1 i c f p -> ShowS #

show :: M1 i c f p -> String #

showList :: [M1 i c f p] -> ShowS #

(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e) -> ShowS #

show :: (a, b, c, d, e) -> String #

showList :: [(a, b, c, d, e)] -> ShowS #

(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f) -> ShowS #

show :: (a, b, c, d, e, f) -> String #

showList :: [(a, b, c, d, e, f)] -> ShowS #

(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g) -> ShowS #

show :: (a, b, c, d, e, f, g) -> String #

showList :: [(a, b, c, d, e, f, g)] -> ShowS #

(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)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g, h) -> ShowS #

show :: (a, b, c, d, e, f, g, h) -> String #

showList :: [(a, b, c, d, e, f, g, h)] -> ShowS #

(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)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g, h, i) -> ShowS #

show :: (a, b, c, d, e, f, g, h, i) -> String #

showList :: [(a, b, c, d, e, f, g, h, i)] -> ShowS #

(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)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j) -> ShowS #

show :: (a, b, c, d, e, f, g, h, i, j) -> String #

showList :: [(a, b, c, d, e, f, g, h, i, j)] -> ShowS #

(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)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k) -> ShowS #

show :: (a, b, c, d, e, f, g, h, i, j, k) -> String #

showList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> ShowS #

(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)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l) -> ShowS #

show :: (a, b, c, d, e, f, g, h, i, j, k, l) -> String #

showList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> ShowS #

(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)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> ShowS #

show :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> String #

showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> ShowS #

(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)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> ShowS #

show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> String #

showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> ShowS #

(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)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ShowS #

show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> String #

showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> ShowS #

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

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

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

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

fail s >>= f  =  fail s

If your Monad is also MonadPlus, a popular definition is

fail _ = mzero

Since: base-4.9.0.0

Methods

fail :: String -> m a #

Instances

Instances details
MonadFail P

Since: base-4.9.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

fail :: String -> P a #

MonadFail ReadP

Since: base-4.9.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

fail :: String -> ReadP a #

MonadFail ReadPrec

Since: base-4.9.0.0

Instance details

Defined in Text.ParserCombinators.ReadPrec

Methods

fail :: String -> ReadPrec a #

MonadFail IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Methods

fail :: String -> IO a #

MonadFail Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

fail :: String -> Q a #

MonadFail Maybe

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Methods

fail :: String -> Maybe a #

MonadFail []

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Methods

fail :: String -> [a] #

MonadFail f => MonadFail (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

fail :: String -> Ap f a #

(Monad m, Error e) => MonadFail (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

fail :: String -> ErrorT e m a #

MonadFail m => MonadFail (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

fail :: String -> ReaderT r m a #

(Monoid w, MonadFail m) => MonadFail (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

fail :: String -> WriterT w m a #

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

A functor with application, providing operations to

  • embed pure expressions (pure), and
  • sequence computations and combine their results (<*> and liftA2).

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

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

Further, any definition must satisfy the following:

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

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

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

It may be useful to note that supposing

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

it follows from the above that

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

If f is also a Monad, it should satisfy

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

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a #

Lift a value.

(<*>) :: f (a -> b) -> f a -> f b infixl 4 #

Sequential application.

A few functors support an implementation of <*> that is more efficient than the default one.

Example

Expand

Used in combination with (<$>), (<*>) can be used to build a record.

>>> data MyState = MyState {arg1 :: Foo, arg2 :: Bar, arg3 :: Baz}
>>> produceFoo :: Applicative f => f Foo
>>> produceBar :: Applicative f => f Bar
>>> produceBaz :: Applicative f => f Baz
>>> mkState :: Applicative f => f MyState
>>> mkState = MyState <$> produceFoo <*> produceBar <*> produceBaz

(*>) :: f a -> f b -> f b infixl 4 #

Sequence actions, discarding the value of the first argument.

Examples

Expand

If used in conjunction with the Applicative instance for Maybe, you can chain Maybe computations, with a possible "early return" in case of Nothing.

>>> Just 2 *> Just 3
Just 3
>>> Nothing *> Just 3
Nothing

Of course a more interesting use case would be to have effectful computations instead of just returning pure values.

>>> import Data.Char
>>> import Text.ParserCombinators.ReadP
>>> let p = string "my name is " *> munch1 isAlpha <* eof
>>> readP_to_S p "my name is Simon"
[("Simon","")]

(<*) :: f a -> f b -> f a infixl 4 #

Sequence actions, discarding the value of the second argument.

Instances

Instances details
Applicative Gen 
Instance details

Defined in Test.QuickCheck.Gen

Methods

pure :: a -> Gen a #

(<*>) :: Gen (a -> b) -> Gen a -> Gen b #

liftA2 :: (a -> b -> c) -> Gen a -> Gen b -> Gen c #

(*>) :: Gen a -> Gen b -> Gen b #

(<*) :: Gen a -> Gen b -> Gen a #

Applicative Rose 
Instance details

Defined in Test.QuickCheck.Property

Methods

pure :: a -> Rose a #

(<*>) :: Rose (a -> b) -> Rose a -> Rose b #

liftA2 :: (a -> b -> c) -> Rose a -> Rose b -> Rose c #

(*>) :: Rose a -> Rose b -> Rose b #

(<*) :: Rose a -> Rose b -> Rose a #

Applicative ZipList
f <$> ZipList xs1 <*> ... <*> ZipList xsN
    = ZipList (zipWithN f xs1 ... xsN)

where zipWithN refers to the zipWith function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example:

(\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
    = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
    = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> ZipList a #

(<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b #

liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c #

(*>) :: ZipList a -> ZipList b -> ZipList b #

(<*) :: ZipList a -> ZipList b -> ZipList a #

Applicative Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

pure :: a -> Complex a #

(<*>) :: Complex (a -> b) -> Complex a -> Complex b #

liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c #

(*>) :: Complex a -> Complex b -> Complex b #

(<*) :: Complex a -> Complex b -> Complex a #

Applicative Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

pure :: a -> Identity a #

(<*>) :: Identity (a -> b) -> Identity a -> Identity b #

liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c #

(*>) :: Identity a -> Identity b -> Identity b #

(<*) :: Identity a -> Identity b -> Identity a #

Applicative First

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: a -> First a #

(<*>) :: First (a -> b) -> First a -> First b #

liftA2 :: (a -> b -> c) -> First a -> First b -> First c #

(*>) :: First a -> First b -> First b #

(<*) :: First a -> First b -> First a #

Applicative Last

Since: base-4.8.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: a -> Last a #

(<*>) :: Last (a -> b) -> Last a -> Last b #

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c #

(*>) :: Last a -> Last b -> Last b #

(<*) :: Last a -> Last b -> Last a #

Applicative Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Dual a #

(<*>) :: Dual (a -> b) -> Dual a -> Dual b #

liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c #

(*>) :: Dual a -> Dual b -> Dual b #

(<*) :: Dual a -> Dual b -> Dual a #

Applicative Product

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Product a #

(<*>) :: Product (a -> b) -> Product a -> Product b #

liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c #

(*>) :: Product a -> Product b -> Product b #

(<*) :: Product a -> Product b -> Product a #

Applicative Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Sum a #

(<*>) :: Sum (a -> b) -> Sum a -> Sum b #

liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c #

(*>) :: Sum a -> Sum b -> Sum b #

(<*) :: Sum a -> Sum b -> Sum a #

Applicative Par1

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> Par1 a #

(<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b #

liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c #

(*>) :: Par1 a -> Par1 b -> Par1 b #

(<*) :: Par1 a -> Par1 b -> Par1 a #

Applicative P

Since: base-4.5.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

pure :: a -> P a #

(<*>) :: P (a -> b) -> P a -> P b #

liftA2 :: (a -> b -> c) -> P a -> P b -> P c #

(*>) :: P a -> P b -> P b #

(<*) :: P a -> P b -> P a #

Applicative ReadP

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadP

Methods

pure :: a -> ReadP a #

(<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b #

liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c #

(*>) :: ReadP a -> ReadP b -> ReadP b #

(<*) :: ReadP a -> ReadP b -> ReadP a #

Applicative ReadPrec

Since: base-4.6.0.0

Instance details

Defined in Text.ParserCombinators.ReadPrec

Methods

pure :: a -> ReadPrec a #

(<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b #

liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c #

(*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b #

(<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a #

Applicative Seq

Since: containers-0.5.4

Instance details

Defined in Data.Sequence.Internal

Methods

pure :: a -> Seq a #

(<*>) :: Seq (a -> b) -> Seq a -> Seq b #

liftA2 :: (a -> b -> c) -> Seq a -> Seq b -> Seq c #

(*>) :: Seq a -> Seq b -> Seq b #

(<*) :: Seq a -> Seq b -> Seq a #

Applicative Tree 
Instance details

Defined in Data.Tree

Methods

pure :: a -> Tree a #

(<*>) :: Tree (a -> b) -> Tree a -> Tree b #

liftA2 :: (a -> b -> c) -> Tree a -> Tree b -> Tree c #

(*>) :: Tree a -> Tree b -> Tree b #

(<*) :: Tree a -> Tree b -> Tree a #

Applicative IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> IO a #

(<*>) :: IO (a -> b) -> IO a -> IO b #

liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c #

(*>) :: IO a -> IO b -> IO b #

(<*) :: IO a -> IO b -> IO a #

Applicative Q 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

pure :: a -> Q a #

(<*>) :: Q (a -> b) -> Q a -> Q b #

liftA2 :: (a -> b -> c) -> Q a -> Q b -> Q c #

(*>) :: Q a -> Q b -> Q b #

(<*) :: Q a -> Q b -> Q a #

Applicative NonEmpty

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

pure :: a -> NonEmpty a #

(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b #

liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c #

(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b #

(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a #

Applicative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> Maybe a #

(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b #

liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #

(*>) :: Maybe a -> Maybe b -> Maybe b #

(<*) :: Maybe a -> Maybe b -> Maybe a #

Applicative Solo

Since: base-4.15

Instance details

Defined in GHC.Base

Methods

pure :: a -> Solo a #

(<*>) :: Solo (a -> b) -> Solo a -> Solo b #

liftA2 :: (a -> b -> c) -> Solo a -> Solo b -> Solo c #

(*>) :: Solo a -> Solo b -> Solo b #

(<*) :: Solo a -> Solo b -> Solo a #

Applicative []

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> [a] #

(<*>) :: [a -> b] -> [a] -> [b] #

liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] #

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

(<*) :: [a] -> [b] -> [a] #

Monad m => Applicative (WrappedMonad m)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a -> WrappedMonad m a #

(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b #

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c #

(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b #

(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a #

Applicative (Either e)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

pure :: a -> Either e a #

(<*>) :: Either e (a -> b) -> Either e a -> Either e b #

liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c #

(*>) :: Either e a -> Either e b -> Either e b #

(<*) :: Either e a -> Either e b -> Either e a #

Applicative (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

pure :: a -> Proxy a #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c #

(*>) :: Proxy a -> Proxy b -> Proxy b #

(<*) :: Proxy a -> Proxy b -> Proxy a #

Applicative (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> U1 a #

(<*>) :: U1 (a -> b) -> U1 a -> U1 b #

liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c #

(*>) :: U1 a -> U1 b -> U1 b #

(<*) :: U1 a -> U1 b -> U1 a #

Monoid es => Applicative (CollectErrors es) 
Instance details

Defined in Control.CollectErrors.Type

Methods

pure :: a -> CollectErrors es a #

(<*>) :: CollectErrors es (a -> b) -> CollectErrors es a -> CollectErrors es b #

liftA2 :: (a -> b -> c) -> CollectErrors es a -> CollectErrors es b -> CollectErrors es c #

(*>) :: CollectErrors es a -> CollectErrors es b -> CollectErrors es b #

(<*) :: CollectErrors es a -> CollectErrors es b -> CollectErrors es a #

Applicative (SpecM a) 
Instance details

Defined in Test.Hspec.Core.Spec.Monad

Methods

pure :: a0 -> SpecM a a0 #

(<*>) :: SpecM a (a0 -> b) -> SpecM a a0 -> SpecM a b #

liftA2 :: (a0 -> b -> c) -> SpecM a a0 -> SpecM a b -> SpecM a c #

(*>) :: SpecM a a0 -> SpecM a b -> SpecM a b #

(<*) :: SpecM a a0 -> SpecM a b -> SpecM a a0 #

Monoid a => Applicative ((,) a)

For tuples, the Monoid constraint on a determines how the first values merge. For example, Strings concatenate:

("hello ", (+15)) <*> ("world!", 2002)
("hello world!",2017)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a0 -> (a, a0) #

(<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) #

liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) #

(*>) :: (a, a0) -> (a, b) -> (a, b) #

(<*) :: (a, a0) -> (a, b) -> (a, a0) #

Arrow a => Applicative (WrappedArrow a b)

Since: base-2.1

Instance details

Defined in Control.Applicative

Methods

pure :: a0 -> WrappedArrow a b a0 #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #

Monoid m => Applicative (Const m :: Type -> Type)

Since: base-2.0.1

Instance details

Defined in Data.Functor.Const

Methods

pure :: a -> Const m a #

(<*>) :: Const m (a -> b) -> Const m a -> Const m b #

liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c #

(*>) :: Const m a -> Const m b -> Const m b #

(<*) :: Const m a -> Const m b -> Const m a #

Applicative f => Applicative (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

pure :: a -> Ap f a #

(<*>) :: Ap f (a -> b) -> Ap f a -> Ap f b #

liftA2 :: (a -> b -> c) -> Ap f a -> Ap f b -> Ap f c #

(*>) :: Ap f a -> Ap f b -> Ap f b #

(<*) :: Ap f a -> Ap f b -> Ap f a #

Applicative f => Applicative (Alt f)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

pure :: a -> Alt f a #

(<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b #

liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c #

(*>) :: Alt f a -> Alt f b -> Alt f b #

(<*) :: Alt f a -> Alt f b -> Alt f a #

Applicative f => Applicative (Rec1 f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> Rec1 f a #

(<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b #

liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c #

(*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b #

(<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a #

(Applicative f, Monad f) => Applicative (WhenMissing f x)

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

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMissing f x a #

(<*>) :: WhenMissing f x (a -> b) -> WhenMissing f x a -> WhenMissing f x b #

liftA2 :: (a -> b -> c) -> WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x c #

(*>) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x b #

(<*) :: WhenMissing f x a -> WhenMissing f x b -> WhenMissing f x a #

(Functor m, Monad m) => Applicative (ErrorT e m) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

pure :: a -> ErrorT e m a #

(<*>) :: ErrorT e m (a -> b) -> ErrorT e m a -> ErrorT e m b #

liftA2 :: (a -> b -> c) -> ErrorT e m a -> ErrorT e m b -> ErrorT e m c #

(*>) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m b #

(<*) :: ErrorT e m a -> ErrorT e m b -> ErrorT e m a #

Applicative m => Applicative (ReaderT r m) 
Instance details

Defined in Control.Monad.Trans.Reader

Methods

pure :: a -> ReaderT r m a #

(<*>) :: ReaderT r m (a -> b) -> ReaderT r m a -> ReaderT r m b #

liftA2 :: (a -> b -> c) -> ReaderT r m a -> ReaderT r m b -> ReaderT r m c #

(*>) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m b #

(<*) :: ReaderT r m a -> ReaderT r m b -> ReaderT r m a #

(Monoid w, Applicative m) => Applicative (WriterT w m) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

pure :: a -> WriterT w m a #

(<*>) :: WriterT w m (a -> b) -> WriterT w m a -> WriterT w m b #

liftA2 :: (a -> b -> c) -> WriterT w m a -> WriterT w m b -> WriterT w m c #

(*>) :: WriterT w m a -> WriterT w m b -> WriterT w m b #

(<*) :: WriterT w m a -> WriterT w m b -> WriterT w m a #

Monoid a => Applicative (Constant a :: Type -> Type) 
Instance details

Defined in Data.Functor.Constant

Methods

pure :: a0 -> Constant a a0 #

(<*>) :: Constant a (a0 -> b) -> Constant a a0 -> Constant a b #

liftA2 :: (a0 -> b -> c) -> Constant a a0 -> Constant a b -> Constant a c #

(*>) :: Constant a a0 -> Constant a b -> Constant a b #

(<*) :: Constant a a0 -> Constant a b -> Constant a a0 #

(Monoid a, Monoid b) => Applicative ((,,) a b)

Since: base-4.14.0.0

Instance details

Defined in GHC.Base

Methods

pure :: a0 -> (a, b, a0) #

(<*>) :: (a, b, a0 -> b0) -> (a, b, a0) -> (a, b, b0) #

liftA2 :: (a0 -> b0 -> c) -> (a, b, a0) -> (a, b, b0) -> (a, b, c) #

(*>) :: (a, b, a0) -> (a, b, b0) -> (a, b, b0) #

(<*) :: (a, b, a0) -> (a, b, b0) -> (a, b, a0) #

(Applicative f, Applicative g) => Applicative (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

pure :: a -> Product f g a #

(<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b #

liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c #

(*>) :: Product f g a -> Product f g b -> Product f g b #

(<*) :: Product f g a -> Product f g b -> Product f g a #

(Applicative f, Applicative g) => Applicative (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> (f :*: g) a #

(<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b #

liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c #

(*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b #

(<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a #

Monoid c => Applicative (K1 i c :: Type -> Type)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> K1 i c a #

(<*>) :: K1 i c (a -> b) -> K1 i c a -> K1 i c b #

liftA2 :: (a -> b -> c0) -> K1 i c a -> K1 i c b -> K1 i c c0 #

(*>) :: K1 i c a -> K1 i c b -> K1 i c b #

(<*) :: K1 i c a -> K1 i c b -> K1 i c a #

(Monad f, Applicative f) => Applicative (WhenMatched f x y)

Equivalent to ReaderT Key (ReaderT x (ReaderT y (MaybeT f)))

Since: containers-0.5.9

Instance details

Defined in Data.IntMap.Internal

Methods

pure :: a -> WhenMatched f x y a #

(<*>) :: WhenMatched f x y (a -> b) -> WhenMatched f x y a -> WhenMatched f x y b #

liftA2 :: (a -> b -> c) -> WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y c #

(*>) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y b #

(<*) :: WhenMatched f x y a -> WhenMatched f x y b -> WhenMatched f x y a #

(Applicative f, Monad f) => Applicative (WhenMissing f k x)

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

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMissing f k x a #

(<*>) :: WhenMissing f k x (a -> b) -> WhenMissing f k x a -> WhenMissing f k x b #

liftA2 :: (a -> b -> c) -> WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x c #

(*>) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x b #

(<*) :: WhenMissing f k x a -> WhenMissing f k x b -> WhenMissing f k x a #

(Monoid a, Monoid b, Monoid c) => Applicative ((,,,) a b c)

Since: base-4.14.0.0

Instance details

Defined in GHC.Base

Methods

pure :: a0 -> (a, b, c, a0) #

(<*>) :: (a, b, c, a0 -> b0) -> (a, b, c, a0) -> (a, b, c, b0) #

liftA2 :: (a0 -> b0 -> c0) -> (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, c0) #

(*>) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, b0) #

(<*) :: (a, b, c, a0) -> (a, b, c, b0) -> (a, b, c, a0) #

Applicative ((->) r)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> r -> a #

(<*>) :: (r -> (a -> b)) -> (r -> a) -> r -> b #

liftA2 :: (a -> b -> c) -> (r -> a) -> (r -> b) -> r -> c #

(*>) :: (r -> a) -> (r -> b) -> r -> b #

(<*) :: (r -> a) -> (r -> b) -> r -> a #

(Applicative f, Applicative g) => Applicative (Compose f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

pure :: a -> Compose f g a #

(<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b #

liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c #

(*>) :: Compose f g a -> Compose f g b -> Compose f g b #

(<*) :: Compose f g a -> Compose f g b -> Compose f g a #

(Applicative f, Applicative g) => Applicative (f :.: g)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> (f :.: g) a #

(<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b #

liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c #

(*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b #

(<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a #

Applicative f => Applicative (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

pure :: a -> M1 i c f a #

(<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b #

liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 #

(*>) :: M1 i c f 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 a #

(Monad f, Applicative f) => Applicative (WhenMatched f k x y)

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

Since: containers-0.5.9

Instance details

Defined in Data.Map.Internal

Methods

pure :: a -> WhenMatched f k x y a #

(<*>) :: WhenMatched f k x y (a -> b) -> WhenMatched f k x y a -> WhenMatched f k x y b #

liftA2 :: (a -> b -> c) -> WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y c #

(*>) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y b #

(<*) :: WhenMatched f k x y a -> WhenMatched f k x y b -> WhenMatched f k x y a #

class Foldable (t :: TYPE LiftedRep -> Type) where #

The Foldable class represents data structures that can be reduced to a summary value one element at a time. Strict left-associative folds are a good fit for space-efficient reduction, while lazy right-associative folds are a good fit for corecursive iteration, or for folds that short-circuit after processing an initial subsequence of the structure's elements.

Instances can be derived automatically by enabling the DeriveFoldable extension. For example, a derived instance for a binary tree might be:

{-# LANGUAGE DeriveFoldable #-}
data Tree a = Empty
            | Leaf a
            | Node (Tree a) a (Tree a)
    deriving Foldable

A more detailed description can be found in the Overview section of Data.Foldable.

For the class laws see the Laws section of Data.Foldable.

Minimal complete definition

foldMap | foldr

Methods

foldMap :: Monoid m => (a -> m) -> t a -> m #

Map each element of the structure into a monoid, and combine the results with (<>). This fold is right-associative and lazy in the accumulator. For strict left-associative folds consider foldMap' instead.

Examples

Expand

Basic usage:

>>> foldMap Sum [1, 3, 5]
Sum {getSum = 9}
>>> foldMap Product [1, 3, 5]
Product {getProduct = 15}
>>> foldMap (replicate 3) [1, 2, 3]
[1,1,1,2,2,2,3,3,3]

When a Monoid's (<>) is lazy in its second argument, foldMap can return a result even from an unbounded structure. For example, lazy accumulation enables Data.ByteString.Builder to efficiently serialise large data structures and produce the output incrementally:

>>> import qualified Data.ByteString.Lazy as L
>>> import qualified Data.ByteString.Builder as B
>>> let bld :: Int -> B.Builder; bld i = B.intDec i <> B.word8 0x20
>>> let lbs = B.toLazyByteString $ foldMap bld [0..]
>>> L.take 64 lbs
"0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"

foldr :: (a -> b -> b) -> b -> t a -> b #

Right-associative fold of a structure, lazy in the accumulator.

In the case of lists, foldr, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:

foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)

Note that since the head of the resulting expression is produced by an application of the operator to the first element of the list, given an operator lazy in its right argument, foldr can produce a terminating expression from an unbounded list.

For a general Foldable structure this should be semantically identical to,

foldr f z = foldr f z . toList

Examples

Expand

Basic usage:

>>> foldr (||) False [False, True, False]
True
>>> foldr (||) False []
False
>>> foldr (\c acc -> acc ++ [c]) "foo" ['a', 'b', 'c', 'd']
"foodcba"
Infinite structures

⚠️ Applying foldr to infinite structures usually doesn't terminate.

It may still terminate under one of the following conditions:

  • the folding function is short-circuiting
  • the folding function is lazy on its second argument
Short-circuiting

(||) short-circuits on True values, so the following terminates because there is a True value finitely far from the left side:

>>> foldr (||) False (True : repeat False)
True

But the following doesn't terminate:

>>> foldr (||) False (repeat False ++ [True])
* Hangs forever *
Laziness in the second argument

Applying foldr to infinite structures terminates when the operator is lazy in its second argument (the initial accumulator is never used in this case, and so could be left undefined, but [] is more clear):

>>> take 5 $ foldr (\i acc -> i : fmap (+3) acc) [] (repeat 1)
[1,4,7,10,13]

foldl :: (b -> a -> b) -> b -> t a -> b #

Left-associative fold of a structure, lazy in the accumulator. This is rarely what you want, but can work well for structures with efficient right-to-left sequencing and an operator that is lazy in its left argument.

In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn

Note that to produce the outermost application of the operator the entire input list must be traversed. Like all left-associative folds, foldl will diverge if given an infinite list.

If you want an efficient strict left-fold, you probably want to use foldl' instead of foldl. The reason for this is that the latter does not force the inner results (e.g. z `f` x1 in the above example) before applying them to the operator (e.g. to (`f` x2)). This results in a thunk chain \(\mathcal{O}(n)\) elements long, which then must be evaluated from the outside-in.

For a general Foldable structure this should be semantically identical to:

foldl f z = foldl f z . toList

Examples

Expand

The first example is a strict fold, which in practice is best performed with foldl'.

>>> foldl (+) 42 [1,2,3,4]
52

Though the result below is lazy, the input is reversed before prepending it to the initial accumulator, so corecursion begins only after traversing the entire input string.

>>> foldl (\acc c -> c : acc) "abcd" "efgh"
"hgfeabcd"

A left fold of a structure that is infinite on the right cannot terminate, even when for any finite input the fold just returns the initial accumulator:

>>> foldl (\a _ -> a) 0 $ repeat 1
* Hangs forever *

WARNING: When it comes to lists, you always want to use either foldl' or foldr instead.

foldr1 :: (a -> a -> a) -> t a -> a #

A variant of foldr that has no base case, and thus may only be applied to non-empty structures.

This function is non-total and will raise a runtime exception if the structure happens to be empty.

Examples

Expand

Basic usage:

>>> foldr1 (+) [1..4]
10
>>> foldr1 (+) []
Exception: Prelude.foldr1: empty list
>>> foldr1 (+) Nothing
*** Exception: foldr1: empty structure
>>> foldr1 (-) [1..4]
-2
>>> foldr1 (&&) [True, False, True, True]
False
>>> foldr1 (||) [False, False, True, True]
True
>>> foldr1 (+) [1..]
* Hangs forever *

foldl1 :: (a -> a -> a) -> t a -> a #

A variant of foldl that has no base case, and thus may only be applied to non-empty structures.

This function is non-total and will raise a runtime exception if the structure happens to be empty.

foldl1 f = foldl1 f . toList

Examples

Expand

Basic usage:

>>> foldl1 (+) [1..4]
10
>>> foldl1 (+) []
*** Exception: Prelude.foldl1: empty list
>>> foldl1 (+) Nothing
*** Exception: foldl1: empty structure
>>> foldl1 (-) [1..4]
-8
>>> foldl1 (&&) [True, False, True, True]
False
>>> foldl1 (||) [False, False, True, True]
True
>>> foldl1 (+) [1..]
* Hangs forever *

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

Expand

Basic usage:

>>> null []
True
>>> null [1]
False

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

>>> null [1..]
False

Since: base-4.8.0.0

elem :: Eq a => a -> t a -> Bool infix 4 #

Does the element occur in the structure?

Note: elem is often used in infix form.

Examples

Expand

Basic usage:

>>> 3 `elem` []
False
>>> 3 `elem` [1,2]
False
>>> 3 `elem` [1,2,3,4,5]
True

For infinite structures, the default implementation of elem terminates if the sought-after value exists at a finite distance from the left side of the structure:

>>> 3 `elem` [1..]
True
>>> 3 `elem` ([4..] ++ [3])
* Hangs forever *

Since: base-4.8.0.0

Instances

Instances details
Foldable ZipList

Since: base-4.9.0.0

Instance details

Defined in Control.Applicative

Methods

fold :: Monoid m => ZipList m -> m #

foldMap :: Monoid m => (a -> m) -> ZipList a -> m #

foldMap' :: Monoid m => (a -> m) -> ZipList a -> m #

foldr :: (a -> b -> b) -> b -> ZipList a -> b #

foldr' :: (a -> b -> b) -> b -> ZipList a -> b #

foldl :: (b -> a -> b) -> b -> ZipList a -> b #

foldl' :: (b -> a -> b) -> b -> ZipList a -> b #

foldr1 :: (a -> a -> a) -> ZipList a -> a #

foldl1 :: (a -> a -> a) -> ZipList a -> a #

toList :: ZipList a -> [a] #

null :: ZipList a -> Bool #

length :: ZipList a -> Int #

elem :: Eq a => a -> ZipList a -> Bool #

maximum :: Ord a => ZipList a -> a #

minimum :: Ord a => ZipList a -> a #

sum :: Num a => ZipList a -> a #

product :: Num a => ZipList a -> a #

Foldable Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

fold :: Monoid m => Complex m -> m #

foldMap :: Monoid m => (a -> m) -> Complex a -> m #

foldMap' :: Monoid m => (a -> m) -> Complex a -> m #

foldr :: (a -> b -> b) -> b -> Complex a -> b #

foldr' :: (a -> b -> b) -> b -> Complex a -> b #

foldl :: (b -> a -> b) -> b -> Complex a -> b #

foldl' :: (b -> a -> b) -> b -> Complex a -> b #

foldr1 :: (a -> a -> a) -> Complex a -> a #

foldl1 :: (a -> a -> a) -> Complex a -> a #

toList :: Complex a -> [a] #

null :: Complex a -> Bool #

length :: Complex a -> Int #

elem :: Eq a => a -> Complex a -> Bool #

maximum :: Ord a => Complex a -> a #

minimum :: Ord a => Complex a -> a #

sum :: Num a => Complex a -> a #

product :: Num a => Complex a -> a #

Foldable Identity

Since: base-4.8.0.0

Instance details

Defined in Data.Functor.Identity

Methods

fold :: Monoid m => Identity m -> m #

foldMap :: Monoid m => (a -> m) -> Identity a -> m #

foldMap' :: Monoid m => (a -> m) -> Identity a -> m #

foldr :: (a -> b -> b) -> b -> Identity a -> b #

foldr' :: (a -> b -> b) -> b -> Identity a -> b #

foldl :: (b -> a -> b) -> b -> Identity a -> b #

foldl' :: (b -> a -> b) -> b -> Identity a -> b #

foldr1 :: (a -> a -> a) -> Identity a -> a #

foldl1 :: (a -> a -> a) -> Identity a -> a #

toList :: Identity a -> [a] #

null :: Identity a -> Bool #

length :: Identity a -> Int #

elem :: Eq a => a -> Identity a -> Bool #

maximum :: Ord a => Identity a -> a #

minimum :: Ord a => Identity a -> a #

sum :: Num a => Identity a -> a #

product :: Num a => Identity a -> a #

Foldable First

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => First m -> m #

foldMap :: Monoid m => (a -> m) -> First a -> m #

foldMap' :: Monoid m => (a -> m) -> First a -> m #

foldr :: (a -> b -> b) -> b -> First a -> b #

foldr' :: (a -> b -> b) -> b -> First a -> b #

foldl :: (b -> a -> b) -> b -> First a -> b #

foldl' :: (b -> a -> b) -> b -> First a -> b #

foldr1 :: (a -> a -> a) -> First a -> a #

foldl1 :: (a -> a -> a) -> First a -> a #

toList :: First a -> [a] #

null :: First a -> Bool #

length :: First a -> Int #

elem :: Eq a => a -> First a -> Bool #

maximum :: Ord a => First a -> a #

minimum :: Ord a => First a -> a #

sum :: Num a => First a -> a #

product :: Num a => First a -> a #

Foldable Last

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Last m -> m #

foldMap :: Monoid m => (a -> m) -> Last a -> m #

foldMap' :: Monoid m => (a -> m) -> Last a -> m #

foldr :: (a -> b -> b) -> b -> Last a -> b #

foldr' :: (a -> b -> b) -> b -> Last a -> b #

foldl :: (b -> a -> b) -> b -> Last a -> b #

foldl' :: (b -> a -> b) -> b -> Last a -> b #

foldr1 :: (a -> a -> a) -> Last a -> a #

foldl1 :: (a -> a -> a) -> Last a -> a #

toList :: Last a -> [a] #

null :: Last a -> Bool #

length :: Last a -> Int #

elem :: Eq a => a -> Last a -> Bool #

maximum :: Ord a => Last a -> a #

minimum :: Ord a => Last a -> a #

sum :: Num a => Last a -> a #

product :: Num a => Last a -> a #

Foldable Down

Since: base-4.12.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Down m -> m #

foldMap :: Monoid m => (a -> m) -> Down a -> m #

foldMap' :: Monoid m => (a -> m) -> Down a -> m #

foldr :: (a -> b -> b) -> b -> Down a -> b #

foldr' :: (a -> b -> b) -> b -> Down a -> b #

foldl :: (b -> a -> b) -> b -> Down a -> b #

foldl' :: (b -> a -> b) -> b -> Down a -> b #

foldr1 :: (a -> a -> a) -> Down a -> a #

foldl1 :: (a -> a -> a) -> Down a -> a #

toList :: Down a -> [a] #

null :: Down a -> Bool #

length :: Down a -> Int #

elem :: Eq a => a -> Down a -> Bool #

maximum :: Ord a => Down a -> a #

minimum :: Ord a => Down a -> a #

sum :: Num a => Down a -> a #

product :: Num a => Down a -> a #

Foldable Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Dual m -> m #

foldMap :: Monoid m => (a -> m) -> Dual a -> m #

foldMap' :: Monoid m => (a -> m) -> Dual a -> m #

foldr :: (a -> b -> b) -> b -> Dual a -> b #

foldr' :: (a -> b -> b) -> b -> Dual a -> b #

foldl :: (b -> a -> b) -> b -> Dual a -> b #

foldl' :: (b -> a -> b) -> b -> Dual a -> b #

foldr1 :: (a -> a -> a) -> Dual a -> a #

foldl1 :: (a -> a -> a) -> Dual a -> a #

toList :: Dual a -> [a] #

null :: Dual a -> Bool #

length :: Dual a -> Int #

elem :: Eq a => a -> Dual a -> Bool #

maximum :: Ord a => Dual a -> a #

minimum :: Ord a => Dual a -> a #

sum :: Num a => Dual a -> a #

product :: Num a => Dual a -> a #

Foldable Product

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Product m -> m #

foldMap :: Monoid m => (a -> m) -> Product a -> m #

foldMap' :: Monoid m => (a -> m) -> Product a -> m #

foldr :: (a -> b -> b) -> b -> Product a -> b #

foldr' :: (a -> b -> b) -> b -> Product a -> b #

foldl :: (b -> a -> b) -> b -> Product a -> b #

foldl' :: (b -> a -> b) -> b -> Product a -> b #

foldr1 :: (a -> a -> a) -> Product a -> a #

foldl1 :: (a -> a -> a) -> Product a -> a #

toList :: Product a -> [a] #

null :: Product a -> Bool #

length :: Product a -> Int #

elem :: Eq a => a -> Product a -> Bool #

maximum :: Ord a => Product a -> a #

minimum :: Ord a => Product a -> a #

sum :: Num a => Product a -> a #

product :: Num a => Product a -> a #

Foldable Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Sum m -> m #

foldMap :: Monoid m => (a -> m) -> Sum a -> m #

foldMap' :: Monoid m => (a -> m) -> Sum a -> m #

foldr :: (a -> b -> b) -> b -> Sum a -> b #

foldr' :: (a -> b -> b) -> b -> Sum a -> b #

foldl :: (b -> a -> b) -> b -> Sum a -> b #

foldl' :: (b -> a -> b) -> b -> Sum a -> b #

foldr1 :: (a -> a -> a) -> Sum a -> a #

foldl1 :: (a -> a -> a) -> Sum a -> a #

toList :: Sum a -> [a] #

null :: Sum a -> Bool #

length :: Sum a -> Int #

elem :: Eq a => a -> Sum a -> Bool #

maximum :: Ord a => Sum a -> a #

minimum :: Ord a => Sum a -> a #

sum :: Num a => Sum a -> a #

product :: Num a => Sum a -> a #

Foldable Par1

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Par1 m -> m #

foldMap :: Monoid m => (a -> m) -> Par1 a -> m #

foldMap' :: Monoid m => (a -> m) -> Par1 a -> m #

foldr :: (a -> b -> b) -> b -> Par1 a -> b #

foldr' :: (a -> b -> b) -> b -> Par1 a -> b #

foldl :: (b -> a -> b) -> b -> Par1 a -> b #

foldl' :: (b -> a -> b) -> b -> Par1 a -> b #

foldr1 :: (a -> a -> a) -> Par1 a -> a #

foldl1 :: (a -> a -> a) -> Par1 a -> a #

toList :: Par1 a -> [a] #

null :: Par1 a -> Bool #

length :: Par1 a -> Int #

elem :: Eq a => a -> Par1 a -> Bool #

maximum :: Ord a => Par1 a -> a #

minimum :: Ord a => Par1 a -> a #

sum :: Num a => Par1 a -> a #

product :: Num a => Par1 a -> a #

Foldable IntMap

Folds in order of increasing key.

Instance details

Defined in Data.IntMap.Internal

Methods

fold :: Monoid m => IntMap m -> m #

foldMap :: Monoid m => (a -> m) -> IntMap a -> m #

foldMap' :: Monoid m => (a -> m) -> IntMap a -> m #

foldr :: (a -> b -> b) -> b -> IntMap a -> b #

foldr' :: (a -> b -> b) -> b -> IntMap a -> b #

foldl :: (b -> a -> b) -> b -> IntMap a -> b #

foldl' :: (b -> a -> b) -> b -> IntMap a -> b #

foldr1 :: (a -> a -> a) -> IntMap a -> a #

foldl1 :: (a -> a -> a) -> IntMap a -> a #

toList :: IntMap a -> [a] #

null :: IntMap a -> Bool #

length :: IntMap a -> Int #

elem :: Eq a => a -> IntMap a -> Bool #

maximum :: Ord a => IntMap a -> a #

minimum :: Ord a => IntMap a -> a #

sum :: Num a => IntMap a -> a #

product :: Num a => IntMap a -> a #

Foldable Digit 
Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => Digit m -> m #

foldMap :: Monoid m => (a -> m) -> Digit a -> m #

foldMap' :: Monoid m => (a -> m) -> Digit a -> m #

foldr :: (a -> b -> b) -> b -> Digit a -> b #

foldr' :: (a -> b -> b) -> b -> Digit a -> b #

foldl :: (b -> a -> b) -> b -> Digit a -> b #

foldl' :: (b -> a -> b) -> b -> Digit a -> b #

foldr1 :: (a -> a -> a) -> Digit a -> a #

foldl1 :: (a -> a -> a) -> Digit a -> a #

toList :: Digit a -> [a] #

null :: Digit a -> Bool #

length :: Digit a -> Int #

elem :: Eq a => a -> Digit a -> Bool #

maximum :: Ord a => Digit a -> a #

minimum :: Ord a => Digit a -> a #

sum :: Num a => Digit a -> a #

product :: Num a => Digit a -> a #

Foldable Elem 
Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => Elem m -> m #

foldMap :: Monoid m => (a -> m) -> Elem a -> m #

foldMap' :: Monoid m => (a -> m) -> Elem a -> m #

foldr :: (a -> b -> b) -> b -> Elem a -> b #

foldr' :: (a -> b -> b) -> b -> Elem a -> b #

foldl :: (b -> a -> b) -> b -> Elem a -> b #

foldl' :: (b -> a -> b) -> b -> Elem a -> b #

foldr1 :: (a -> a -> a) -> Elem a -> a #

foldl1 :: (a -> a -> a) -> Elem a -> a #

toList :: Elem a -> [a] #

null :: Elem a -> Bool #

length :: Elem a -> Int #

elem :: Eq a => a -> Elem a -> Bool #

maximum :: Ord a => Elem a -> a #

minimum :: Ord a => Elem a -> a #

sum :: Num a => Elem a -> a #

product :: Num a => Elem a -> a #

Foldable FingerTree 
Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => FingerTree m -> m #

foldMap :: Monoid m => (a -> m) -> FingerTree a -> m #

foldMap' :: Monoid m => (a -> m) -> FingerTree a -> m #

foldr :: (a -> b -> b) -> b -> FingerTree a -> b #

foldr' :: (a -> b -> b) -> b -> FingerTree a -> b #

foldl :: (b -> a -> b) -> b -> FingerTree a -> b #

foldl' :: (b -> a -> b) -> b -> FingerTree a -> b #

foldr1 :: (a -> a -> a) -> FingerTree a -> a #

foldl1 :: (a -> a -> a) -> FingerTree a -> a #

toList :: FingerTree a -> [a] #

null :: FingerTree a -> Bool #

length :: FingerTree a -> Int #

elem :: Eq a => a -> FingerTree a -> Bool #

maximum :: Ord a => FingerTree a -> a #

minimum :: Ord a => FingerTree a -> a #

sum :: Num a => FingerTree a -> a #

product :: Num a => FingerTree a -> a #

Foldable Node 
Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => Node m -> m #

foldMap :: Monoid m => (a -> m) -> Node a -> m #

foldMap' :: Monoid m => (a -> m) -> Node a -> m #

foldr :: (a -> b -> b) -> b -> Node a -> b #

foldr' :: (a -> b -> b) -> b -> Node a -> b #

foldl :: (b -> a -> b) -> b -> Node a -> b #

foldl' :: (b -> a -> b) -> b -> Node a -> b #

foldr1 :: (a -> a -> a) -> Node a -> a #

foldl1 :: (a -> a -> a) -> Node a -> a #

toList :: Node a -> [a] #

null :: Node a -> Bool #

length :: Node a -> Int #

elem :: Eq a => a -> Node a -> Bool #

maximum :: Ord a => Node a -> a #

minimum :: Ord a => Node a -> a #

sum :: Num a => Node a -> a #

product :: Num a => Node a -> a #

Foldable Seq 
Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => Seq m -> m #

foldMap :: Monoid m => (a -> m) -> Seq a -> m #

foldMap' :: Monoid m => (a -> m) -> Seq a -> m #

foldr :: (a -> b -> b) -> b -> Seq a -> b #

foldr' :: (a -> b -> b) -> b -> Seq a -> b #

foldl :: (b -> a -> b) -> b -> Seq a -> b #

foldl' :: (b -> a -> b) -> b -> Seq a -> b #

foldr1 :: (a -> a -> a) -> Seq a -> a #

foldl1 :: (a -> a -> a) -> Seq a -> a #

toList :: Seq a -> [a] #

null :: Seq a -> Bool #

length :: Seq a -> Int #

elem :: Eq a => a -> Seq a -> Bool #

maximum :: Ord a => Seq a -> a #

minimum :: Ord a => Seq a -> a #

sum :: Num a => Seq a -> a #

product :: Num a => Seq a -> a #

Foldable ViewL 
Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => ViewL m -> m #

foldMap :: Monoid m => (a -> m) -> ViewL a -> m #

foldMap' :: Monoid m => (a -> m) -> ViewL a -> m #

foldr :: (a -> b -> b) -> b -> ViewL a -> b #

foldr' :: (a -> b -> b) -> b -> ViewL a -> b #

foldl :: (b -> a -> b) -> b -> ViewL a -> b #

foldl' :: (b -> a -> b) -> b -> ViewL a -> b #

foldr1 :: (a -> a -> a) -> ViewL a -> a #

foldl1 :: (a -> a -> a) -> ViewL a -> a #

toList :: ViewL a -> [a] #

null :: ViewL a -> Bool #

length :: ViewL a -> Int #

elem :: Eq a => a -> ViewL a -> Bool #

maximum :: Ord a => ViewL a -> a #

minimum :: Ord a => ViewL a -> a #

sum :: Num a => ViewL a -> a #

product :: Num a => ViewL a -> a #

Foldable ViewR 
Instance details

Defined in Data.Sequence.Internal

Methods

fold :: Monoid m => ViewR m -> m #

foldMap :: Monoid m => (a -> m) -> ViewR a -> m #

foldMap' :: Monoid m => (a -> m) -> ViewR a -> m #

foldr :: (a -> b -> b) -> b -> ViewR a -> b #

foldr' :: (a -> b -> b) -> b -> ViewR a -> b #

foldl :: (b -> a -> b) -> b -> ViewR a -> b #

foldl' :: (b -> a -> b) -> b -> ViewR a -> b #

foldr1 :: (a -> a -> a) -> ViewR a -> a #

foldl1 :: (a -> a -> a) -> ViewR a -> a #

toList :: ViewR a -> [a] #

null :: ViewR a -> Bool #

length :: ViewR a -> Int #

elem :: Eq a => a -> ViewR a -> Bool #

maximum :: Ord a => ViewR a -> a #

minimum :: Ord a => ViewR a -> a #

sum :: Num a => ViewR a -> a #

product :: Num a => ViewR a -> a #

Foldable Set

Folds in order of increasing key.

Instance details

Defined in Data.Set.Internal

Methods

fold :: Monoid m => Set m -> m #

foldMap :: Monoid m => (a -> m) -> Set a -> m #

foldMap' :: Monoid m => (a -> m) -> Set a -> m #

foldr :: (a -> b -> b) -> b -> Set a -> b #

foldr' :: (a -> b -> b) -> b -> Set a -> b #

foldl :: (b -> a -> b) -> b -> Set a -> b #

foldl' :: (b -> a -> b) -> b -> Set a -> b #

foldr1 :: (a -> a -> a) -> Set a -> a #

foldl1 :: (a -> a -> a) -> Set a -> a #

toList :: Set a -> [a] #

null :: Set a -> Bool #

length :: Set a -> Int #

elem :: Eq a => a -> Set a -> Bool #

maximum :: Ord a => Set a -> a #

minimum :: Ord a => Set a -> a #

sum :: Num a => Set a -> a #

product :: Num a => Set a -> a #

Foldable Tree 
Instance details

Defined in Data.Tree

Methods

fold :: Monoid m => Tree m -> m #

foldMap :: Monoid m => (a -> m) -> Tree a -> m #

foldMap' :: Monoid m => (a -> m) -> Tree a -> m #

foldr :: (a -> b -> b) -> b -> Tree a -> b #

foldr' :: (a -> b -> b) -> b -> Tree a -> b #

foldl :: (b -> a -> b) -> b -> Tree a -> b #

foldl' :: (b -> a -> b) -> b -> Tree a -> b #

foldr1 :: (a -> a -> a) -> Tree a -> a #

foldl1 :: (a -> a -> a) -> Tree a -> a #

toList :: Tree a -> [a] #

null :: Tree a -> Bool #

length :: Tree a -> Int #

elem :: Eq a => a -> Tree a -> Bool #

maximum :: Ord a => Tree a -> a #

minimum :: Ord a => Tree a -> a #

sum :: Num a => Tree a -> a #

product :: Num a => Tree a -> a #

Foldable NonNegative

Since: smallcheck-1.2.0

Instance details

Defined in Test.SmallCheck.Series

Methods

fold :: Monoid m => NonNegative m -> m #

foldMap :: Monoid m => (a -> m) -> NonNegative a -> m #

foldMap' :: Monoid m => (a -> m) -> NonNegative a -> m #

foldr :: (a -> b -> b) -> b -> NonNegative a -> b #

foldr' :: (a -> b -> b) -> b -> NonNegative a -> b #

foldl :: (b -> a -> b) -> b -> NonNegative a -> b #

foldl' :: (b -> a -> b) -> b -> NonNegative a -> b #

foldr1 :: (a -> a -> a) -> NonNegative a -> a #

foldl1 :: (a -> a -> a) -> NonNegative a -> a #

toList :: NonNegative a -> [a] #

null :: NonNegative a -> Bool #

length :: NonNegative a -> Int #

elem :: Eq a => a -> NonNegative a -> Bool #

maximum :: Ord a => NonNegative a -> a #

minimum :: Ord a => NonNegative a -> a #

sum :: Num a => NonNegative a -> a #

product :: Num a => NonNegative a -> a #

Foldable NonZero 
Instance details

Defined in Test.SmallCheck.Series

Methods

fold :: Monoid m => NonZero m -> m #

foldMap :: Monoid m => (a -> m) -> NonZero a -> m #

foldMap' :: Monoid m => (a -> m) -> NonZero a -> m #

foldr :: (a -> b -> b) -> b -> NonZero a -> b #

foldr' :: (a -> b -> b) -> b -> NonZero a -> b #

foldl :: (b -> a -> b) -> b -> NonZero a -> b #

foldl' :: (b -> a -> b) -> b -> NonZero a -> b #

foldr1 :: (a -> a -> a) -> NonZero a -> a #

foldl1 :: (a -> a -> a) -> NonZero a -> a #

toList :: NonZero a -> [a] #

null :: NonZero a -> Bool #

length :: NonZero a -> Int #

elem :: Eq a => a -> NonZero a -> Bool #

maximum :: Ord a => NonZero a -> a #

minimum :: Ord a => NonZero a -> a #

sum :: Num a => NonZero a -> a #

product :: Num a => NonZero a -> a #

Foldable Positive

Since: smallcheck-1.2.0

Instance details

Defined in Test.SmallCheck.Series

Methods

fold :: Monoid m => Positive m -> m #

foldMap :: Monoid m => (a -> m) -> Positive a -> m #

foldMap' :: Monoid m => (a -> m) -> Positive a -> m #

foldr :: (a -> b -> b) -> b -> Positive a -> b #

foldr' :: (a -> b -> b) -> b -> Positive a -> b #

foldl :: (b -> a -> b) -> b -> Positive a -> b #

foldl' :: (b -> a -> b) -> b -> Positive a -> b #

foldr1 :: (a -> a -> a) -> Positive a -> a #

foldl1 :: (a -> a -> a) -> Positive a -> a #

toList :: Positive a -> [a] #

null :: Positive a -> Bool #

length :: Positive a -> Int #

elem :: Eq a => a -> Positive a -> Bool #

maximum :: Ord a => Positive a -> a #

minimum :: Ord a => Positive a -> a #

sum :: Num a => Positive a -> a #

product :: Num a => Positive a -> a #

Foldable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => NonEmpty m -> m #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldMap' :: Monoid m => (a -> m) -> NonEmpty a -> m #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a #

toList :: NonEmpty a -> [a] #

null :: NonEmpty a -> Bool #

length :: NonEmpty a -> Int #

elem :: Eq a => a -> NonEmpty a -> Bool #

maximum :: Ord a => NonEmpty a -> a #

minimum :: Ord a => NonEmpty a -> a #

sum :: Num a => NonEmpty a -> a #

product :: Num a => NonEmpty a -> a #

Foldable Maybe

Since: base-2.1

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Maybe m -> m #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m #

foldMap' :: Monoid m => (a -> m) -> Maybe a -> m #

foldr :: (a -> b -> b) -> b -> Maybe a -> b #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b #

foldl :: (b -> a -> b) -> b -> Maybe a -> b #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b #

foldr1 :: (a -> a -> a) -> Maybe a -> a #

foldl1 :: (a -> a -> a) -> Maybe a -> a #

toList :: Maybe a -> [a] #

null :: Maybe a -> Bool #

length :: Maybe a -> Int #

elem :: Eq a => a -> Maybe a -> Bool #

maximum :: Ord a => Maybe a -> a #

minimum :: Ord a => Maybe a -> a #

sum :: Num a => Maybe a -> a #

product :: Num a => Maybe a -> a #

Foldable Solo

Since: base-4.15

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Solo m -> m #

foldMap :: Monoid m => (a -> m) -> Solo a -> m #

foldMap' :: Monoid m => (a -> m) -> Solo a -> m #

foldr :: (a -> b -> b) -> b -> Solo a -> b #

foldr' :: (a -> b -> b) -> b -> Solo a -> b #

foldl :: (b -> a -> b) -> b -> Solo a -> b #

foldl' :: (b -> a -> b) -> b -> Solo a -> b #

foldr1 :: (a -> a -> a) -> Solo a -> a #

foldl1 :: (a -> a -> a) -> Solo a -> a #

toList :: Solo a -> [a] #

null :: Solo a -> Bool #

length :: Solo a -> Int #

elem :: Eq a => a -> Solo a -> Bool #

maximum :: Ord a => Solo a -> a #

minimum :: Ord a => Solo a -> a #

sum :: Num a => Solo a -> a #

product :: Num a => Solo a -> a #

Foldable []

Since: base-2.1

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => [m] -> m #

foldMap :: Monoid m => (a -> m) -> [a] -> m #

foldMap' :: Monoid m => (a -> m) -> [a] -> m #

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

foldr' :: (a -> b -> b) -> b -> [a] -> b #

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

foldl' :: (b -> a -> b) -> b -> [a] -> b #

foldr1 :: (a -> a -> a) -> [a] -> a #

foldl1 :: (a -> a -> a) -> [a] -> a #

toList :: [a] -> [a] #

null :: [a] -> Bool #

length :: [a] -> Int #

elem :: Eq a => a -> [a] -> Bool #

maximum :: Ord a => [a] -> a #

minimum :: Ord a => [a] -> a #

sum :: Num a => [a] -> a #

product :: Num a => [a] -> a #

Foldable (Either a)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Either a m -> m #

foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m #

foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 #

toList :: Either a a0 -> [a0] #

null :: Either a a0 -> Bool #

length :: Either a a0 -> Int #

elem :: Eq a0 => a0 -> Either a a0 -> Bool #

maximum :: Ord a0 => Either a a0 -> a0 #

minimum :: Ord a0 => Either a a0 -> a0 #

sum :: Num a0 => Either a a0 -> a0 #

product :: Num a0 => Either a a0 -> a0 #

Foldable (Proxy :: TYPE LiftedRep -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Proxy m -> m #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m #

foldMap' :: Monoid m => (a -> m) -> Proxy a -> m #

foldr :: (a -> b -> b) -> b -> Proxy a -> b #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b #

foldl :: (b -> a -> b) -> b -> Proxy a -> b #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b #

foldr1 :: (a -> a -> a) -> Proxy a -> a #

foldl1 :: (a -> a -> a) -> Proxy a -> a #

toList :: Proxy a -> [a] #

null :: Proxy a -> Bool #

length :: Proxy a -> Int #

elem :: Eq a => a -> Proxy a -> Bool #

maximum :: Ord a => Proxy a -> a #

minimum :: Ord a => Proxy a -> a #

sum :: Num a => Proxy a -> a #

product :: Num a => Proxy a -> a #

Foldable (Array i)

Since: base-4.8.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Array i m -> m #

foldMap :: Monoid m => (a -> m) -> Array i a -> m #

foldMap' :: Monoid m => (a -> m) -> Array i a -> m #

foldr :: (a -> b -> b) -> b -> Array i a -> b #

foldr' :: (a -> b -> b) -> b -> Array i a -> b #

foldl :: (b -> a -> b) -> b -> Array i a -> b #

foldl' :: (b -> a -> b) -> b -> Array i a -> b #

foldr1 :: (a -> a -> a) -> Array i a -> a #

foldl1 :: (a -> a -> a) -> Array i a -> a #

toList :: Array i a -> [a] #

null :: Array i a -> Bool #

length :: Array i a -> Int #

elem :: Eq a => a -> Array i a -> Bool #

maximum :: Ord a => Array i a -> a #

minimum :: Ord a => Array i a -> a #

sum :: Num a => Array i a -> a #

product :: Num a => Array i a -> a #

Foldable (U1 :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => U1 m -> m #

foldMap :: Monoid m => (a -> m) -> U1 a -> m #

foldMap' :: Monoid m => (a -> m) -> U1 a -> m #

foldr :: (a -> b -> b) -> b -> U1 a -> b #

foldr' :: (a -> b -> b) -> b -> U1 a -> b #

foldl :: (b -> a -> b) -> b -> U1 a -> b #

foldl' :: (b -> a -> b) -> b -> U1 a -> b #

foldr1 :: (a -> a -> a) -> U1 a -> a #

foldl1 :: (a -> a -> a) -> U1 a -> a #

toList :: U1 a -> [a] #

null :: U1 a -> Bool #

length :: U1 a -> Int #

elem :: Eq a => a -> U1 a -> Bool #

maximum :: Ord a => U1 a -> a #

minimum :: Ord a => U1 a -> a #

sum :: Num a => U1 a -> a #

product :: Num a => U1 a -> a #

Foldable (UAddr :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UAddr m -> m #

foldMap :: Monoid m => (a -> m) -> UAddr a -> m #

foldMap' :: Monoid m => (a -> m) -> UAddr a -> m #

foldr :: (a -> b -> b) -> b -> UAddr a -> b #

foldr' :: (a -> b -> b) -> b -> UAddr a -> b #

foldl :: (b -> a -> b) -> b -> UAddr a -> b #

foldl' :: (b -> a -> b) -> b -> UAddr a -> b #

foldr1 :: (a -> a -> a) -> UAddr a -> a #

foldl1 :: (a -> a -> a) -> UAddr a -> a #

toList :: UAddr a -> [a] #

null :: UAddr a -> Bool #

length :: UAddr a -> Int #

elem :: Eq a => a -> UAddr a -> Bool #

maximum :: Ord a => UAddr a -> a #

minimum :: Ord a => UAddr a -> a #

sum :: Num a => UAddr a -> a #

product :: Num a => UAddr a -> a #

Foldable (UChar :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UChar m -> m #

foldMap :: Monoid m => (a -> m) -> UChar a -> m #

foldMap' :: Monoid m => (a -> m) -> UChar a -> m #

foldr :: (a -> b -> b) -> b -> UChar a -> b #

foldr' :: (a -> b -> b) -> b -> UChar a -> b #

foldl :: (b -> a -> b) -> b -> UChar a -> b #

foldl' :: (b -> a -> b) -> b -> UChar a -> b #

foldr1 :: (a -> a -> a) -> UChar a -> a #

foldl1 :: (a -> a -> a) -> UChar a -> a #

toList :: UChar a -> [a] #

null :: UChar a -> Bool #

length :: UChar a -> Int #

elem :: Eq a => a -> UChar a -> Bool #

maximum :: Ord a => UChar a -> a #

minimum :: Ord a => UChar a -> a #

sum :: Num a => UChar a -> a #

product :: Num a => UChar a -> a #

Foldable (UDouble :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UDouble m -> m #

foldMap :: Monoid m => (a -> m) -> UDouble a -> m #

foldMap' :: Monoid m => (a -> m) -> UDouble a -> m #

foldr :: (a -> b -> b) -> b -> UDouble a -> b #

foldr' :: (a -> b -> b) -> b -> UDouble a -> b #

foldl :: (b -> a -> b) -> b -> UDouble a -> b #

foldl' :: (b -> a -> b) -> b -> UDouble a -> b #

foldr1 :: (a -> a -> a) -> UDouble a -> a #

foldl1 :: (a -> a -> a) -> UDouble a -> a #

toList :: UDouble a -> [a] #

null :: UDouble a -> Bool #

length :: UDouble a -> Int #

elem :: Eq a => a -> UDouble a -> Bool #

maximum :: Ord a => UDouble a -> a #

minimum :: Ord a => UDouble a -> a #

sum :: Num a => UDouble a -> a #

product :: Num a => UDouble a -> a #

Foldable (UFloat :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UFloat m -> m #

foldMap :: Monoid m => (a -> m) -> UFloat a -> m #

foldMap' :: Monoid m => (a -> m) -> UFloat a -> m #

foldr :: (a -> b -> b) -> b -> UFloat a -> b #

foldr' :: (a -> b -> b) -> b -> UFloat a -> b #

foldl :: (b -> a -> b) -> b -> UFloat a -> b #

foldl' :: (b -> a -> b) -> b -> UFloat a -> b #

foldr1 :: (a -> a -> a) -> UFloat a -> a #

foldl1 :: (a -> a -> a) -> UFloat a -> a #

toList :: UFloat a -> [a] #

null :: UFloat a -> Bool #

length :: UFloat a -> Int #

elem :: Eq a => a -> UFloat a -> Bool #

maximum :: Ord a => UFloat a -> a #

minimum :: Ord a => UFloat a -> a #

sum :: Num a => UFloat a -> a #

product :: Num a => UFloat a -> a #

Foldable (UInt :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UInt m -> m #

foldMap :: Monoid m => (a -> m) -> UInt a -> m #

foldMap' :: Monoid m => (a -> m) -> UInt a -> m #

foldr :: (a -> b -> b) -> b -> UInt a -> b #

foldr' :: (a -> b -> b) -> b -> UInt a -> b #

foldl :: (b -> a -> b) -> b -> UInt a -> b #

foldl' :: (b -> a -> b) -> b -> UInt a -> b #

foldr1 :: (a -> a -> a) -> UInt a -> a #

foldl1 :: (a -> a -> a) -> UInt a -> a #

toList :: UInt a -> [a] #

null :: UInt a -> Bool #

length :: UInt a -> Int #

elem :: Eq a => a -> UInt a -> Bool #

maximum :: Ord a => UInt a -> a #

minimum :: Ord a => UInt a -> a #

sum :: Num a => UInt a -> a #

product :: Num a => UInt a -> a #

Foldable (UWord :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UWord m -> m #

foldMap :: Monoid m => (a -> m) -> UWord a -> m #

foldMap' :: Monoid m => (a -> m) -> UWord a -> m #

foldr :: (a -> b -> b) -> b -> UWord a -> b #

foldr' :: (a -> b -> b) -> b -> UWord a -> b #

foldl :: (b -> a -> b) -> b -> UWord a -> b #

foldl' :: (b -> a -> b) -> b -> UWord a -> b #

foldr1 :: (a -> a -> a) -> UWord a -> a #

foldl1 :: (a -> a -> a) -> UWord a -> a #

toList :: UWord a -> [a] #

null :: UWord a -> Bool #

length :: UWord a -> Int #

elem :: Eq a => a -> UWord a -> Bool #

maximum :: Ord a => UWord a -> a #

minimum :: Ord a => UWord a -> a #

sum :: Num a => UWord a -> a #

product :: Num a => UWord a -> a #

Foldable (V1 :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => V1 m -> m #

foldMap :: Monoid m => (a -> m) -> V1 a -> m #

foldMap' :: Monoid m => (a -> m) -> V1 a -> m #

foldr :: (a -> b -> b) -> b -> V1 a -> b #

foldr' :: (a -> b -> b) -> b -> V1 a -> b #

foldl :: (b -> a -> b) -> b -> V1 a -> b #

foldl' :: (b -> a -> b) -> b -> V1 a -> b #

foldr1 :: (a -> a -> a) -> V1 a -> a #

foldl1 :: (a -> a -> a) -> V1 a -> a #

toList :: V1 a -> [a] #

null :: V1 a -> Bool #

length :: V1 a -> Int #

elem :: Eq a => a -> V1 a -> Bool #

maximum :: Ord a => V1 a -> a #

minimum :: Ord a => V1 a -> a #

sum :: Num a => V1 a -> a #

product :: Num a => V1 a -> a #

Foldable (Map k)

Folds in order of increasing key.

Instance details

Defined in Data.Map.Internal

Methods

fold :: Monoid m => Map k m -> m #

foldMap :: Monoid m => (a -> m) -> Map k a -> m #

foldMap' :: Monoid m => (a -> m) -> Map k a -> m #

foldr :: (a -> b -> b) -> b -> Map k a -> b #

foldr' :: (a -> b -> b) -> b -> Map k a -> b #

foldl :: (b -> a -> b) -> b -> Map k a -> b #

foldl' :: (b -> a -> b) -> b -> Map k a -> b #

foldr1 :: (a -> a -> a) -> Map k a -> a #

foldl1 :: (a -> a -> a) -> Map k a -> a #

toList :: Map k a -> [a] #

null :: Map k a -> Bool #

length :: Map k a -> Int #

elem :: Eq a => a -> Map k a -> Bool #

maximum :: Ord a => Map k a -> a #

minimum :: Ord a => Map k a -> a #

sum :: Num a => Map k a -> a #

product :: Num a => Map k a -> a #

Foldable (Tree c) 
Instance details

Defined in Test.Hspec.Core.Tree

Methods

fold :: Monoid m => Tree c m -> m #

foldMap :: Monoid m => (a -> m) -> Tree c a -> m #

foldMap' :: Monoid m => (a -> m) -> Tree c a -> m #

foldr :: (a -> b -> b) -> b -> Tree c a -> b #

foldr' :: (a -> b -> b) -> b -> Tree c a -> b #

foldl :: (b -> a -> b) -> b -> Tree c a -> b #

foldl' :: (b -> a -> b) -> b -> Tree c a -> b #

foldr1 :: (a -> a -> a) -> Tree c a -> a #

foldl1 :: (a -> a -> a) -> Tree c a -> a #

toList :: Tree c a -> [a] #

null :: Tree c a -> Bool #

length :: Tree c a -> Int #

elem :: Eq a => a -> Tree c a -> Bool #

maximum :: Ord a => Tree c a -> a #

minimum :: Ord a => Tree c a -> a #

sum :: Num a => Tree c a -> a #

product :: Num a => Tree c a -> a #

Foldable ((,) a)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (a, m) -> m #

foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m #

foldMap' :: Monoid m => (a0 -> m) -> (a, a0) -> m #

foldr :: (a0 -> b -> b) -> b -> (a, a0) -> b #

foldr' :: (a0 -> b -> b) -> b -> (a, a0) -> b #

foldl :: (b -> a0 -> b) -> b -> (a, a0) -> b #

foldl' :: (b -> a0 -> b) -> b -> (a, a0) -> b #

foldr1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 #

toList :: (a, a0) -> [a0] #

null :: (a, a0) -> Bool #

length :: (a, a0) -> Int #

elem :: Eq a0 => a0 -> (a, a0) -> Bool #

maximum :: Ord a0 => (a, a0) -> a0 #

minimum :: Ord a0 => (a, a0) -> a0 #

sum :: Num a0 => (a, a0) -> a0 #

product :: Num a0 => (a, a0) -> a0 #

Foldable (Const m :: TYPE LiftedRep -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Functor.Const

Methods

fold :: Monoid m0 => Const m m0 -> m0 #

foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 #

foldMap' :: Monoid m0 => (a -> m0) -> Const m a -> m0 #

foldr :: (a -> b -> b) -> b -> Const m a -> b #

foldr' :: (a -> b -> b) -> b -> Const m a -> b #

foldl :: (b -> a -> b) -> b -> Const m a -> b #

foldl' :: (b -> a -> b) -> b -> Const m a -> b #

foldr1 :: (a -> a -> a) -> Const m a -> a #

foldl1 :: (a -> a -> a) -> Const m a -> a #

toList :: Const m a -> [a] #

null :: Const m a -> Bool #

length :: Const m a -> Int #

elem :: Eq a => a -> Const m a -> Bool #

maximum :: Ord a => Const m a -> a #

minimum :: Ord a => Const m a -> a #

sum :: Num a => Const m a -> a #

product :: Num a => Const m a -> a #

Foldable f => Foldable (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Ap f m -> m #

foldMap :: Monoid m => (a -> m) -> Ap f a -> m #

foldMap' :: Monoid m => (a -> m) -> Ap f a -> m #

foldr :: (a -> b -> b) -> b -> Ap f a -> b #

foldr' :: (a -> b -> b) -> b -> Ap f a -> b #

foldl :: (b -> a -> b) -> b -> Ap f a -> b #

foldl' :: (b -> a -> b) -> b -> Ap f a -> b #

foldr1 :: (a -> a -> a) -> Ap f a -> a #

foldl1 :: (a -> a -> a) -> Ap f a -> a #

toList :: Ap f a -> [a] #

null :: Ap f a -> Bool #

length :: Ap f a -> Int #

elem :: Eq a => a -> Ap f a -> Bool #

maximum :: Ord a => Ap f a -> a #

minimum :: Ord a => Ap f a -> a #

sum :: Num a => Ap f a -> a #

product :: Num a => Ap f a -> a #

Foldable f => Foldable (Alt f)

Since: base-4.12.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Alt f m -> m #

foldMap :: Monoid m => (a -> m) -> Alt f a -> m #

foldMap' :: Monoid m => (a -> m) -> Alt f a -> m #

foldr :: (a -> b -> b) -> b -> Alt f a -> b #

foldr' :: (a -> b -> b) -> b -> Alt f a -> b #

foldl :: (b -> a -> b) -> b -> Alt f a -> b #

foldl' :: (b -> a -> b) -> b -> Alt f a -> b #

foldr1 :: (a -> a -> a) -> Alt f a -> a #

foldl1 :: (a -> a -> a) -> Alt f a -> a #

toList :: Alt f a -> [a] #

null :: Alt f a -> Bool #

length :: Alt f a -> Int #

elem :: Eq a => a -> Alt f a -> Bool #

maximum :: Ord a => Alt f a -> a #

minimum :: Ord a => Alt f a -> a #

sum :: Num a => Alt f a -> a #

product :: Num a => Alt f a -> a #

Foldable f => Foldable (Rec1 f)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Rec1 f m -> m #

foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m #

foldMap' :: Monoid m => (a -> m) -> Rec1 f a -> m #

foldr :: (a -> b -> b) -> b -> Rec1 f a -> b #

foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b #

foldl :: (b -> a -> b) -> b -> Rec1 f a -> b #

foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b #

foldr1 :: (a -> a -> a) -> Rec1 f a -> a #

foldl1 :: (a -> a -> a) -> Rec1 f a -> a #

toList :: Rec1 f a -> [a] #

null :: Rec1 f a -> Bool #

length :: Rec1 f a -> Int #

elem :: Eq a => a -> Rec1 f a -> Bool #

maximum :: Ord a => Rec1 f a -> a #

minimum :: Ord a => Rec1 f a -> a #

sum :: Num a => Rec1 f a -> a #

product :: Num a => Rec1 f a -> a #

Foldable f => Foldable (ErrorT e f) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

fold :: Monoid m => ErrorT e f m -> m #

foldMap :: Monoid m => (a -> m) -> ErrorT e f a -> m #

foldMap' :: Monoid m => (a -> m) -> ErrorT e f a -> m #

foldr :: (a -> b -> b) -> b -> ErrorT e f a -> b #

foldr' :: (a -> b -> b) -> b -> ErrorT e f a -> b #

foldl :: (b -> a -> b) -> b -> ErrorT e f a -> b #

foldl' :: (b -> a -> b) -> b -> ErrorT e f a -> b #

foldr1 :: (a -> a -> a) -> ErrorT e f a -> a #

foldl1 :: (a -> a -> a) -> ErrorT e f a -> a #

toList :: ErrorT e f a -> [a] #

null :: ErrorT e f a -> Bool #

length :: ErrorT e f a -> Int #

elem :: Eq a => a -> ErrorT e f a -> Bool #

maximum :: Ord a => ErrorT e f a -> a #

minimum :: Ord a => ErrorT e f a -> a #

sum :: Num a => ErrorT e f a -> a #

product :: Num a => ErrorT e f a -> a #

Foldable f => Foldable (WriterT w f) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

fold :: Monoid m => WriterT w f m -> m #

foldMap :: Monoid m => (a -> m) -> WriterT w f a -> m #

foldMap' :: Monoid m => (a -> m) -> WriterT w f a -> m #

foldr :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldr' :: (a -> b -> b) -> b -> WriterT w f a -> b #

foldl :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldl' :: (b -> a -> b) -> b -> WriterT w f a -> b #

foldr1 :: (a -> a -> a) -> WriterT w f a -> a #

foldl1 :: (a -> a -> a) -> WriterT w f a -> a #

toList :: WriterT w f a -> [a] #

null :: WriterT w f a -> Bool #

length :: WriterT w f a -> Int #

elem :: Eq a => a -> WriterT w f a -> Bool #

maximum :: Ord a => WriterT w f a -> a #

minimum :: Ord a => WriterT w f a -> a #

sum :: Num a => WriterT w f a -> a #

product :: Num a => WriterT w f a -> a #

Foldable (Constant a :: TYPE LiftedRep -> Type) 
Instance details

Defined in Data.Functor.Constant

Methods

fold :: Monoid m => Constant a m -> m #

foldMap :: Monoid m => (a0 -> m) -> Constant a a0 -> m #

foldMap' :: Monoid m => (a0 -> m) -> Constant a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> Constant a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> Constant a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> Constant a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> Constant a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> Constant a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> Constant a a0 -> a0 #

toList :: Constant a a0 -> [a0] #

null :: Constant a a0 -> Bool #

length :: Constant a a0 -> Int #

elem :: Eq a0 => a0 -> Constant a a0 -> Bool #

maximum :: Ord a0 => Constant a a0 -> a0 #

minimum :: Ord a0 => Constant a a0 -> a0 #

sum :: Num a0 => Constant a a0 -> a0 #

product :: Num a0 => Constant a a0 -> a0 #

(Foldable f, Foldable g) => Foldable (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

fold :: Monoid m => Product f g m -> m #

foldMap :: Monoid m => (a -> m) -> Product f g a -> m #

foldMap' :: Monoid m => (a -> m) -> Product f g a -> m #

foldr :: (a -> b -> b) -> b -> Product f g a -> b #

foldr' :: (a -> b -> b) -> b -> Product f g a -> b #

foldl :: (b -> a -> b) -> b -> Product f g a -> b #

foldl' :: (b -> a -> b) -> b -> Product f g a -> b #

foldr1 :: (a -> a -> a) -> Product f g a -> a #

foldl1 :: (a -> a -> a) -> Product f g a -> a #

toList :: Product f g a -> [a] #

null :: Product f g a -> Bool #

length :: Product f g a -> Int #

elem :: Eq a => a -> Product f g a -> Bool #

maximum :: Ord a => Product f g a -> a #

minimum :: Ord a => Product f g a -> a #

sum :: Num a => Product f g a -> a #

product :: Num a => Product f g a -> a #

(Foldable f, Foldable g) => Foldable (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (f :*: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m #

foldMap' :: Monoid m => (a -> m) -> (f :*: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :*: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :*: g) a -> a #

toList :: (f :*: g) a -> [a] #

null :: (f :*: g) a -> Bool #

length :: (f :*: g) a -> Int #

elem :: Eq a => a -> (f :*: g) a -> Bool #

maximum :: Ord a => (f :*: g) a -> a #

minimum :: Ord a => (f :*: g) a -> a #

sum :: Num a => (f :*: g) a -> a #

product :: Num a => (f :*: g) a -> a #

(Foldable f, Foldable g) => Foldable (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (f :+: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m #

foldMap' :: Monoid m => (a -> m) -> (f :+: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :+: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :+: g) a -> a #

toList :: (f :+: g) a -> [a] #

null :: (f :+: g) a -> Bool #

length :: (f :+: g) a -> Int #

elem :: Eq a => a -> (f :+: g) a -> Bool #

maximum :: Ord a => (f :+: g) a -> a #

minimum :: Ord a => (f :+: g) a -> a #

sum :: Num a => (f :+: g) a -> a #

product :: Num a => (f :+: g) a -> a #

Foldable (K1 i c :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => K1 i c m -> m #

foldMap :: Monoid m => (a -> m) -> K1 i c a -> m #

foldMap' :: Monoid m => (a -> m) -> K1 i c a -> m #

foldr :: (a -> b -> b) -> b -> K1 i c a -> b #

foldr' :: (a -> b -> b) -> b -> K1 i c a -> b #

foldl :: (b -> a -> b) -> b -> K1 i c a -> b #

foldl' :: (b -> a -> b) -> b -> K1 i c a -> b #

foldr1 :: (a -> a -> a) -> K1 i c a -> a #

foldl1 :: (a -> a -> a) -> K1 i c a -> a #

toList :: K1 i c a -> [a] #

null :: K1 i c a -> Bool #

length :: K1 i c a -> Int #

elem :: Eq a => a -> K1 i c a -> Bool #

maximum :: Ord a => K1 i c a -> a #

minimum :: Ord a => K1 i c a -> a #

sum :: Num a => K1 i c a -> a #

product :: Num a => K1 i c a -> a #

(Foldable f, Foldable g) => Foldable (Compose f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

fold :: Monoid m => Compose f g m -> m #

foldMap :: Monoid m => (a -> m) -> Compose f g a -> m #

foldMap' :: Monoid m => (a -> m) -> Compose f g a -> m #

foldr :: (a -> b -> b) -> b -> Compose f g a -> b #

foldr' :: (a -> b -> b) -> b -> Compose f g a -> b #

foldl :: (b -> a -> b) -> b -> Compose f g a -> b #

foldl' :: (b -> a -> b) -> b -> Compose f g a -> b #

foldr1 :: (a -> a -> a) -> Compose f g a -> a #

foldl1 :: (a -> a -> a) -> Compose f g a -> a #

toList :: Compose f g a -> [a] #

null :: Compose f g a -> Bool #

length :: Compose f g a -> Int #

elem :: Eq a => a -> Compose f g a -> Bool #

maximum :: Ord a => Compose f g a -> a #

minimum :: Ord a => Compose f g a -> a #

sum :: Num a => Compose f g a -> a #

product :: Num a => Compose f g a -> a #

(Foldable f, Foldable g) => Foldable (f :.: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => (f :.: g) m -> m #

foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m #

foldMap' :: Monoid m => (a -> m) -> (f :.: g) a -> m #

foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b #

foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b #

foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b #

foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b #

foldr1 :: (a -> a -> a) -> (f :.: g) a -> a #

foldl1 :: (a -> a -> a) -> (f :.: g) a -> a #

toList :: (f :.: g) a -> [a] #

null :: (f :.: g) a -> Bool #

length :: (f :.: g) a -> Int #

elem :: Eq a => a -> (f :.: g) a -> Bool #

maximum :: Ord a => (f :.: g) a -> a #

minimum :: Ord a => (f :.: g) a -> a #

sum :: Num a => (f :.: g) a -> a #

product :: Num a => (f :.: g) a -> a #

Foldable f => Foldable (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => M1 i c f m -> m #

foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m #

foldMap' :: Monoid m => (a -> m) -> M1 i c f a -> m #

foldr :: (a -> b -> b) -> b -> M1 i c f a -> b #

foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b #

foldl :: (b -> a -> b) -> b -> M1 i c f a -> b #

foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b #

foldr1 :: (a -> a -> a) -> M1 i c f a -> a #

foldl1 :: (a -> a -> a) -> M1 i c f a -> a #

toList :: M1 i c f a -> [a] #

null :: M1 i c f a -> Bool #

length :: M1 i c f a -> Int #

elem :: Eq a => a -> M1 i c f a -> Bool #

maximum :: Ord a => M1 i c f a -> a #

minimum :: Ord a => M1 i c f a -> a #

sum :: Num a => M1 i c f a -> a #

product :: Num a => M1 i c f a -> a #

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

Functors representing data structures that can be transformed to structures of the same shape by performing an Applicative (or, therefore, Monad) action on each element from left to right.

A more detailed description of what same shape means, the various methods, how traversals are constructed, and example advanced use-cases can be found in the Overview section of Data.Traversable.

For the class laws see the Laws section of Data.Traversable.

Minimal complete definition

traverse | sequenceA

Methods

traverse :: Applicative f => (a -> f b) -> t a -> f (t b) #

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see traverse_.

Examples

Expand

Basic usage:

In the first two examples we show each evaluated action mapping to the output structure.

>>> traverse Just [1,2,3,4]
Just [1,2,3,4]
>>> traverse id [Right 1, Right 2, Right 3, Right 4]
Right [1,2,3,4]

In the next examples, we show that Nothing and Left values short circuit the created structure.

>>> traverse (const Nothing) [1,2,3,4]
Nothing
>>> traverse (\x -> if odd x then Just x else Nothing)  [1,2,3,4]
Nothing
>>> traverse id [Right 1, Right 2, Right 3, Right 4, Left 0]
Left 0

sequenceA :: Applicative f => t (f a) -> f (t a) #

Evaluate each action in the structure from left to right, and collect the results. For a version that ignores the results see sequenceA_.

Examples

Expand

Basic usage:

For the first two examples we show sequenceA fully evaluating a a structure and collecting the results.

>>> sequenceA [Just 1, Just 2, Just 3]
Just [1,2,3]
>>> sequenceA [Right 1, Right 2, Right 3]
Right [1,2,3]

The next two example show Nothing and Just will short circuit the resulting structure if present in the input. For more context, check the Traversable instances for Either and Maybe.

>>> sequenceA [Just 1, Just 2, Just 3, Nothing]
Nothing
>>> sequenceA [Right 1, Right 2, Right 3, Left 4]
Left 4

mapM :: Monad m => (a -> m b) -> t a -> m (t b) #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.

Examples

Expand

mapM is literally a traverse with a type signature restricted to Monad. Its implementation may be more efficient due to additional power of Monad.

sequence :: Monad m => t (m a) -> m (t a) #

Evaluate each monadic action in the structure from left to right, and collect the results. For a version that ignores the results see sequence_.

Examples

Expand

Basic usage:

The first two examples are instances where the input and and output of sequence are isomorphic.

>>> sequence $ Right [1,2,3,4]
[Right 1,Right 2,Right 3,Right 4]
>>> sequence $ [Right 1,Right 2,Right 3,Right 4]
Right [1,2,3,4]

The following examples demonstrate short circuit behavior for sequence.

>>> sequence $ Left [1,2,3,4]
Left [1,2,3,4]
>>> sequence $ [Left 0, Right 1,Right 2,Right 3,Right 4]
Left 0

Instances

Instances details
Traversable ZipList

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) #

sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) #

mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) #

sequence :: Monad m => ZipList (m a) -> m (ZipList a) #

Traversable Complex

Since: base-4.9.0.0

Instance details

Defined in Data.Complex

Methods

traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) #

sequenceA :: Applicative f => Complex (f a) -> f (Complex a) #

mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) #

sequence :: Monad m => Complex (m a) -> m (Complex a) #

Traversable Identity

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) #

sequenceA :: Applicative f => Identity (f a) -> f (Identity a) #

mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) #

sequence :: Monad m => Identity (m a) -> m (Identity a) #

Traversable First

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> First a -> f (First b) #

sequenceA :: Applicative f => First (f a) -> f (First a) #

mapM :: Monad m => (a -> m b) -> First a -> m (First b) #

sequence :: Monad m => First (m a) -> m (First a) #

Traversable Last

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) #

sequenceA :: Applicative f => Last (f a) -> f (Last a) #

mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) #

sequence :: Monad m => Last (m a) -> m (Last a) #

Traversable Down

Since: base-4.12.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Down a -> f (Down b) #

sequenceA :: Applicative f => Down (f a) -> f (Down a) #

mapM :: Monad m => (a -> m b) -> Down a -> m (Down b) #

sequence :: Monad m => Down (m a) -> m (Down a) #

Traversable Dual

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) #

sequenceA :: Applicative f => Dual (f a) -> f (Dual a) #

mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) #

sequence :: Monad m => Dual (m a) -> m (Dual a) #

Traversable Product

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) #

sequenceA :: Applicative f => Product (f a) -> f (Product a) #

mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) #

sequence :: Monad m => Product (m a) -> m (Product a) #

Traversable Sum

Since: base-4.8.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) #

sequenceA :: Applicative f => Sum (f a) -> f (Sum a) #

mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) #

sequence :: Monad m => Sum (m a) -> m (Sum a) #

Traversable Par1

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Par1 a -> f (Par1 b) #

sequenceA :: Applicative f => Par1 (f a) -> f (Par1 a) #

mapM :: Monad m => (a -> m b) -> Par1 a -> m (Par1 b) #

sequence :: Monad m => Par1 (m a) -> m (Par1 a) #

Traversable IntMap

Traverses in order of increasing key.

Instance details

Defined in Data.IntMap.Internal

Methods

traverse :: Applicative f => (a -> f b) -> IntMap a -> f (IntMap b) #

sequenceA :: Applicative f => IntMap (f a) -> f (IntMap a) #

mapM :: Monad m => (a -> m b) -> IntMap a -> m (IntMap b) #

sequence :: Monad m => IntMap (m a) -> m (IntMap a) #

Traversable Digit 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Digit a -> f (Digit b) #

sequenceA :: Applicative f => Digit (f a) -> f (Digit a) #

mapM :: Monad m => (a -> m b) -> Digit a -> m (Digit b) #

sequence :: Monad m => Digit (m a) -> m (Digit a) #

Traversable Elem 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Elem a -> f (Elem b) #

sequenceA :: Applicative f => Elem (f a) -> f (Elem a) #

mapM :: Monad m => (a -> m b) -> Elem a -> m (Elem b) #

sequence :: Monad m => Elem (m a) -> m (Elem a) #

Traversable FingerTree 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> FingerTree a -> f (FingerTree b) #

sequenceA :: Applicative f => FingerTree (f a) -> f (FingerTree a) #

mapM :: Monad m => (a -> m b) -> FingerTree a -> m (FingerTree b) #

sequence :: Monad m => FingerTree (m a) -> m (FingerTree a) #

Traversable Node 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Node a -> f (Node b) #

sequenceA :: Applicative f => Node (f a) -> f (Node a) #

mapM :: Monad m => (a -> m b) -> Node a -> m (Node b) #

sequence :: Monad m => Node (m a) -> m (Node a) #

Traversable Seq 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Seq a -> f (Seq b) #

sequenceA :: Applicative f => Seq (f a) -> f (Seq a) #

mapM :: Monad m => (a -> m b) -> Seq a -> m (Seq b) #

sequence :: Monad m => Seq (m a) -> m (Seq a) #

Traversable ViewL 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> ViewL a -> f (ViewL b) #

sequenceA :: Applicative f => ViewL (f a) -> f (ViewL a) #

mapM :: Monad m => (a -> m b) -> ViewL a -> m (ViewL b) #

sequence :: Monad m => ViewL (m a) -> m (ViewL a) #

Traversable ViewR 
Instance details

Defined in Data.Sequence.Internal

Methods

traverse :: Applicative f => (a -> f b) -> ViewR a -> f (ViewR b) #

sequenceA :: Applicative f => ViewR (f a) -> f (ViewR a) #

mapM :: Monad m => (a -> m b) -> ViewR a -> m (ViewR b) #

sequence :: Monad m => ViewR (m a) -> m (ViewR a) #

Traversable Tree 
Instance details

Defined in Data.Tree

Methods

traverse :: Applicative f => (a -> f b) -> Tree a -> f (Tree b) #

sequenceA :: Applicative f => Tree (f a) -> f (Tree a) #

mapM :: Monad m => (a -> m b) -> Tree a -> m (Tree b) #

sequence :: Monad m => Tree (m a) -> m (Tree a) #

Traversable NonNegative

Since: smallcheck-1.2.0

Instance details

Defined in Test.SmallCheck.Series

Methods

traverse :: Applicative f => (a -> f b) -> NonNegative a -> f (NonNegative b) #

sequenceA :: Applicative f => NonNegative (f a) -> f (NonNegative a) #

mapM :: Monad m => (a -> m b) -> NonNegative a -> m (NonNegative b) #

sequence :: Monad m => NonNegative (m a) -> m (NonNegative a) #

Traversable NonZero 
Instance details

Defined in Test.SmallCheck.Series

Methods

traverse :: Applicative f => (a -> f b) -> NonZero a -> f (NonZero b) #

sequenceA :: Applicative f => NonZero (f a) -> f (NonZero a) #

mapM :: Monad m => (a -> m b) -> NonZero a -> m (NonZero b) #

sequence :: Monad m => NonZero (m a) -> m (NonZero a) #

Traversable Positive

Since: smallcheck-1.2.0

Instance details

Defined in Test.SmallCheck.Series

Methods

traverse :: Applicative f => (a -> f b) -> Positive a -> f (Positive b) #

sequenceA :: Applicative f => Positive (f a) -> f (Positive a) #

mapM :: Monad m => (a -> m b) -> Positive a -> m (Positive b) #

sequence :: Monad m => Positive (m a) -> m (Positive a) #

Traversable NonEmpty

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) #

sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) #

mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) #

sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #

Traversable Maybe

Since: base-2.1

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) #

sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) #

mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) #

sequence :: Monad m => Maybe (m a) -> m (Maybe a) #

Traversable Solo

Since: base-4.15

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Solo a -> f (Solo b) #

sequenceA :: Applicative f => Solo (f a) -> f (Solo a) #

mapM :: Monad m => (a -> m b) -> Solo a -> m (Solo b) #

sequence :: Monad m => Solo (m a) -> m (Solo a) #

Traversable []

Since: base-2.1

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> [a] -> f [b] #

sequenceA :: Applicative f => [f a] -> f [a] #

mapM :: Monad m => (a -> m b) -> [a] -> m [b] #

sequence :: Monad m => [m a] -> m [a] #

Traversable (Either a)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) #

sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) #

mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) #

sequence :: Monad m => Either a (m a0) -> m (Either a a0) #

Traversable (Proxy :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) #

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) #

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) #

Ix i => Traversable (Array i)

Since: base-2.1

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Array i a -> f (Array i b) #

sequenceA :: Applicative f => Array i (f a) -> f (Array i a) #

mapM :: Monad m => (a -> m b) -> Array i a -> m (Array i b) #

sequence :: Monad m => Array i (m a) -> m (Array i a) #

Traversable (U1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> U1 a -> f (U1 b) #

sequenceA :: Applicative f => U1 (f a) -> f (U1 a) #

mapM :: Monad m => (a -> m b) -> U1 a -> m (U1 b) #

sequence :: Monad m => U1 (m a) -> m (U1 a) #

Traversable (UAddr :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UAddr a -> f (UAddr b) #

sequenceA :: Applicative f => UAddr (f a) -> f (UAddr a) #

mapM :: Monad m => (a -> m b) -> UAddr a -> m (UAddr b) #

sequence :: Monad m => UAddr (m a) -> m (UAddr a) #

Traversable (UChar :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UChar a -> f (UChar b) #

sequenceA :: Applicative f => UChar (f a) -> f (UChar a) #

mapM :: Monad m => (a -> m b) -> UChar a -> m (UChar b) #

sequence :: Monad m => UChar (m a) -> m (UChar a) #

Traversable (UDouble :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UDouble a -> f (UDouble b) #

sequenceA :: Applicative f => UDouble (f a) -> f (UDouble a) #

mapM :: Monad m => (a -> m b) -> UDouble a -> m (UDouble b) #

sequence :: Monad m => UDouble (m a) -> m (UDouble a) #

Traversable (UFloat :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UFloat a -> f (UFloat b) #

sequenceA :: Applicative f => UFloat (f a) -> f (UFloat a) #

mapM :: Monad m => (a -> m b) -> UFloat a -> m (UFloat b) #

sequence :: Monad m => UFloat (m a) -> m (UFloat a) #

Traversable (UInt :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UInt a -> f (UInt b) #

sequenceA :: Applicative f => UInt (f a) -> f (UInt a) #

mapM :: Monad m => (a -> m b) -> UInt a -> m (UInt b) #

sequence :: Monad m => UInt (m a) -> m (UInt a) #

Traversable (UWord :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UWord a -> f (UWord b) #

sequenceA :: Applicative f => UWord (f a) -> f (UWord a) #

mapM :: Monad m => (a -> m b) -> UWord a -> m (UWord b) #

sequence :: Monad m => UWord (m a) -> m (UWord a) #

Traversable (V1 :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) #

sequenceA :: Applicative f => V1 (f a) -> f (V1 a) #

mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) #

sequence :: Monad m => V1 (m a) -> m (V1 a) #

Traversable (Map k)

Traverses in order of increasing key.

Instance details

Defined in Data.Map.Internal

Methods

traverse :: Applicative f => (a -> f b) -> Map k a -> f (Map k b) #

sequenceA :: Applicative f => Map k (f a) -> f (Map k a) #

mapM :: Monad m => (a -> m b) -> Map k a -> m (Map k b) #

sequence :: Monad m => Map k (m a) -> m (Map k a) #

Traversable (Tree c) 
Instance details

Defined in Test.Hspec.Core.Tree

Methods

traverse :: Applicative f => (a -> f b) -> Tree c a -> f (Tree c b) #

sequenceA :: Applicative f => Tree c (f a) -> f (Tree c a) #

mapM :: Monad m => (a -> m b) -> Tree c a -> m (Tree c b) #

sequence :: Monad m => Tree c (m a) -> m (Tree c a) #

Traversable ((,) a)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a0 -> f b) -> (a, a0) -> f (a, b) #

sequenceA :: Applicative f => (a, f a0) -> f (a, a0) #

mapM :: Monad m => (a0 -> m b) -> (a, a0) -> m (a, b) #

sequence :: Monad m => (a, m a0) -> m (a, a0) #

Traversable (Const m :: Type -> Type)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) #

sequenceA :: Applicative f => Const m (f a) -> f (Const m a) #

mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) #

sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) #

Traversable f => Traversable (Ap f)

Since: base-4.12.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Ap f a -> f0 (Ap f b) #

sequenceA :: Applicative f0 => Ap f (f0 a) -> f0 (Ap f a) #

mapM :: Monad m => (a -> m b) -> Ap f a -> m (Ap f b) #

sequence :: Monad m => Ap f (m a) -> m (Ap f a) #

Traversable f => Traversable (Alt f)

Since: base-4.12.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Alt f a -> f0 (Alt f b) #

sequenceA :: Applicative f0 => Alt f (f0 a) -> f0 (Alt f a) #

mapM :: Monad m => (a -> m b) -> Alt f a -> m (Alt f b) #

sequence :: Monad m => Alt f (m a) -> m (Alt f a) #

Traversable f => Traversable (Rec1 f)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) #

sequenceA :: Applicative f0 => Rec1 f (f0 a) -> f0 (Rec1 f a) #

mapM :: Monad m => (a -> m b) -> Rec1 f a -> m (Rec1 f b) #

sequence :: Monad m => Rec1 f (m a) -> m (Rec1 f a) #

Traversable f => Traversable (ErrorT e f) 
Instance details

Defined in Control.Monad.Trans.Error

Methods

traverse :: Applicative f0 => (a -> f0 b) -> ErrorT e f a -> f0 (ErrorT e f b) #

sequenceA :: Applicative f0 => ErrorT e f (f0 a) -> f0 (ErrorT e f a) #

mapM :: Monad m => (a -> m b) -> ErrorT e f a -> m (ErrorT e f b) #

sequence :: Monad m => ErrorT e f (m a) -> m (ErrorT e f a) #

Traversable f => Traversable (WriterT w f) 
Instance details

Defined in Control.Monad.Trans.Writer.Lazy

Methods

traverse :: Applicative f0 => (a -> f0 b) -> WriterT w f a -> f0 (WriterT w f b) #

sequenceA :: Applicative f0 => WriterT w f (f0 a) -> f0 (WriterT w f a) #

mapM :: Monad m => (a -> m b) -> WriterT w f a -> m (WriterT w f b) #

sequence :: Monad m => WriterT w f (m a) -> m (WriterT w f a) #

Traversable (Constant a :: Type -> Type) 
Instance details

Defined in Data.Functor.Constant

Methods

traverse :: Applicative f => (a0 -> f b) -> Constant a a0 -> f (Constant a b) #

sequenceA :: Applicative f => Constant a (f a0) -> f (Constant a a0) #

mapM :: Monad m => (a0 -> m b) -> Constant a a0 -> m (Constant a b) #

sequence :: Monad m => Constant a (m a0) -> m (Constant a a0) #

(Traversable f, Traversable g) => Traversable (Product f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) #

sequenceA :: Applicative f0 => Product f g (f0 a) -> f0 (Product f g a) #

mapM :: Monad m => (a -> m b) -> Product f g a -> m (Product f g b) #

sequence :: Monad m => Product f g (m a) -> m (Product f g a) #

(Traversable f, Traversable g) => Traversable (f :*: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #

sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((f :*: g) a) #

mapM :: Monad m => (a -> m b) -> (f :*: g) a -> m ((f :*: g) b) #

sequence :: Monad m => (f :*: g) (m a) -> m ((f :*: g) a) #

(Traversable f, Traversable g) => Traversable (f :+: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #

sequenceA :: Applicative f0 => (f :+: g) (f0 a) -> f0 ((f :+: g) a) #

mapM :: Monad m => (a -> m b) -> (f :+: g) a -> m ((f :+: g) b) #

sequence :: Monad m => (f :+: g) (m a) -> m ((f :+: g) a) #

Traversable (K1 i c :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> K1 i c a -> f (K1 i c b) #

sequenceA :: Applicative f => K1 i c (f a) -> f (K1 i c a) #

mapM :: Monad m => (a -> m b) -> K1 i c a -> m (K1 i c b) #

sequence :: Monad m => K1 i c (m a) -> m (K1 i c a) #

(Traversable f, Traversable g) => Traversable (Compose f g)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) #

sequenceA :: Applicative f0 => Compose f g (f0 a) -> f0 (Compose f g a) #

mapM :: Monad m => (a -> m b) -> Compose f g a -> m (Compose f g b) #

sequence :: Monad m => Compose f g (m a) -> m (Compose f g a) #

(Traversable f, Traversable g) => Traversable (f :.: g)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) #

sequenceA :: Applicative f0 => (f :.: g) (f0 a) -> f0 ((f :.: g) a) #

mapM :: Monad m => (a -> m b) -> (f :.: g) a -> m ((f :.: g) b) #

sequence :: Monad m => (f :.: g) (m a) -> m ((f :.: g) a) #

Traversable f => Traversable (M1 i c f)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) #

sequenceA :: Applicative f0 => M1 i c f (f0 a) -> f0 (M1 i c f a) #

mapM :: Monad m => (a -> m b) -> M1 i c f a -> m (M1 i c f b) #

sequence :: Monad m => M1 i c f (m a) -> m (M1 i c f a) #

class Semigroup a where #

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

Instances should satisfy the following:

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

Since: base-4.9.0.0

Methods

(<>) :: a -> a -> a infixr 6 #

An associative operation.

>>> [1,2,3] <> [4,5,6]
[1,2,3,4,5,6]

Instances

Instances details
Semigroup All

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: All -> All -> All #

sconcat :: NonEmpty All -> All #

stimes :: Integral b => b -> All -> All #

Semigroup Any

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Any -> Any -> Any #

sconcat :: NonEmpty Any -> Any #

stimes :: Integral b => b -> Any -> Any #

Semigroup Void

Since: base-4.9.0.0

Instance details

Defined in Data.Void

Methods

(<>) :: Void -> Void -> Void #

sconcat :: NonEmpty Void -> Void #

stimes :: Integral b => b -> Void -> Void #

Semigroup NumErrors 
Instance details

Defined in Numeric.CollectErrors.Type

Semigroup IntSet

Since: containers-0.5.7

Instance details

Defined in Data.IntSet.Internal

Semigroup Ordering

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Semigroup ()

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: () -> () -> () #

sconcat :: NonEmpty () -> () #

stimes :: Integral b => b -> () -> () #

Semigroup a => Semigroup (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

(<>) :: Identity a -> Identity a -> Identity a #

sconcat :: NonEmpty (Identity a) -> Identity a #

stimes :: Integral b => b -> Identity a -> Identity a #

Semigroup (First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Monoid

Methods

(<>) :: First a -> First a -> First a #

sconcat :: NonEmpty (First a) -> First a #

stimes :: Integral b => b -> First a -> First a #

Semigroup (Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Monoid

Methods

(<>) :: Last a -> Last a -> Last a #

sconcat :: NonEmpty (Last a) -> Last a #

stimes :: Integral b => b -> Last a -> Last a #

Semigroup a => Semigroup (Dual a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Dual a -> Dual a -> Dual a #

sconcat :: NonEmpty (Dual a) -> Dual a #

stimes :: Integral b => b -> Dual a -> Dual a #

Semigroup (Endo a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Endo a -> Endo a -> Endo a #

sconcat :: NonEmpty (Endo a) -> Endo a #

stimes :: Integral b => b -> Endo a -> Endo a #

Num a => Semigroup (Product a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Product a -> Product a -> Product a #

sconcat :: NonEmpty (Product a) -> Product a #

stimes :: Integral b => b -> Product a -> Product a #

Num a => Semigroup (Sum a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Sum a -> Sum a -> Sum a #

sconcat :: NonEmpty (Sum a) -> Sum a #

stimes :: Integral b => b -> Sum a -> Sum a #

Semigroup p => Semigroup (Par1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: Par1 p -> Par1 p -> Par1 p #

sconcat :: NonEmpty (Par1 p) -> Par1 p #

stimes :: Integral b => b -> Par1 p -> Par1 p #

Num a => Semigroup (AlphaColour a)

AlphaColour forms a monoid with over and transparent.

Instance details

Defined in Data.Colour.Internal

Num a => Semigroup (Colour a) 
Instance details

Defined in Data.Colour.Internal

Methods

(<>) :: Colour a -> Colour a -> Colour a #

sconcat :: NonEmpty (Colour a) -> Colour a #

stimes :: Integral b => b -> Colour a -> Colour a #

Semigroup (IntMap a)

Since: containers-0.5.7

Instance details

Defined in Data.IntMap.Internal

Methods

(<>) :: IntMap a -> IntMap a -> IntMap a #

sconcat :: NonEmpty (IntMap a) -> IntMap a #

stimes :: Integral b => b -> IntMap a -> IntMap a #

Semigroup (Seq a)

Since: containers-0.5.7

Instance details

Defined in Data.Sequence.Internal

Methods

(<>) :: Seq a -> Seq a -> Seq a #

sconcat :: NonEmpty (Seq a) -> Seq a #

stimes :: Integral b => b -> Seq a -> Seq a #

Semigroup (MergeSet a) 
Instance details

Defined in Data.Set.Internal

Methods

(<>) :: MergeSet a -> MergeSet a -> MergeSet a #

sconcat :: NonEmpty (MergeSet a) -> MergeSet a #

stimes :: Integral b => b -> MergeSet a -> MergeSet a #

Ord a => Semigroup (Set a)

Since: containers-0.5.7

Instance details

Defined in Data.Set.Internal

Methods

(<>) :: Set a -> Set a -> Set a #

sconcat :: NonEmpty (Set a) -> Set a #

stimes :: Integral b => b -> Set a -> Set a #

Semigroup a => Semigroup (IO a)

Since: base-4.10.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: IO a -> IO a -> IO a #

sconcat :: NonEmpty (IO a) -> IO a #

stimes :: Integral b => b -> IO a -> IO a #

Semigroup a => Semigroup (Q a)

Since: template-haskell-2.17.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

(<>) :: Q a -> Q a -> Q a #

sconcat :: NonEmpty (Q a) -> Q a #

stimes :: Integral b => b -> Q a -> Q a #

Semigroup (NonEmpty a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a #

sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a #

stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #

Semigroup a => Semigroup (Maybe a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: Maybe a -> Maybe a -> Maybe a #

sconcat :: NonEmpty (Maybe a) -> Maybe a #

stimes :: Integral b => b -> Maybe a -> Maybe a #

Semigroup a => Semigroup (a)

Since: base-4.15

Instance details

Defined in GHC.Base

Methods

(<>) :: (a) -> (a) -> (a) #

sconcat :: NonEmpty (a) -> (a) #

stimes :: Integral b => b -> (a) -> (a) #

Semigroup [a]

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: [a] -> [a] -> [a] #

sconcat :: NonEmpty [a] -> [a] #

stimes :: Integral b => b -> [a] -> [a] #

Semigroup (Either a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Either

Methods

(<>) :: Either a b -> Either a b -> Either a b #

sconcat :: NonEmpty (Either a b) -> Either a b #

stimes :: Integral b0 => b0 -> Either a b -> Either a b #

Semigroup (Proxy s)

Since: base-4.9.0.0

Instance details

Defined in Data.Proxy

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s #

sconcat :: NonEmpty (Proxy s) -> Proxy s #

stimes :: Integral b => b -> Proxy s -> Proxy s #

Semigroup (U1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: U1 p -> U1 p -> U1 p #

sconcat :: NonEmpty (U1 p) -> U1 p #

stimes :: Integral b => b -> U1 p -> U1 p #

Semigroup (V1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: V1 p -> V1 p -> V1 p #

sconcat :: NonEmpty (V1 p) -> V1 p #

stimes :: Integral b => b -> V1 p -> V1 p #

Ord k => Semigroup (Map k v) 
Instance details

Defined in Data.Map.Internal

Methods

(<>) :: Map k v -> Map k v -> Map k v #

sconcat :: NonEmpty (Map k v) -> Map k v #

stimes :: Integral b => b -> Map k v -> Map k v #

Semigroup b => Semigroup (a -> b)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a -> b) -> (a -> b) -> a -> b #

sconcat :: NonEmpty (a -> b) -> a -> b #

stimes :: Integral b0 => b0 -> (a -> b) -> a -> b #

(Semigroup a, Semigroup b) => Semigroup (a, b)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

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

sconcat :: NonEmpty (a, b) -> (a, b) #

stimes :: Integral b0 => b0 -> (a, b) -> (a, b) #

Semigroup a => Semigroup (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

(<>) :: Const a b -> Const a b -> Const a b #

sconcat :: NonEmpty (Const a b) -> Const a b #

stimes :: Integral b0 => b0 -> Const a b -> Const a b #

(Applicative f, Semigroup a) => Semigroup (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

(<>) :: Ap f a -> Ap f a -> Ap f a #

sconcat :: NonEmpty (Ap f a) -> Ap f a #

stimes :: Integral b => b -> Ap f a -> Ap f a #

Alternative f => Semigroup (Alt f a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

(<>) :: Alt f a -> Alt f a -> Alt f a #

sconcat :: NonEmpty (Alt f a) -> Alt f a #

stimes :: Integral b => b -> Alt f a -> Alt f a #

Semigroup (f p) => Semigroup (Rec1 f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: Rec1 f p -> Rec1 f p -> Rec1 f p #

sconcat :: NonEmpty (Rec1 f p) -> Rec1 f p #

stimes :: Integral b => b -> Rec1 f p -> Rec1 f p #

Semigroup a => Semigroup (Constant a b) 
Instance details

Defined in Data.Functor.Constant

Methods

(<>) :: Constant a b -> Constant a b -> Constant a b #

sconcat :: NonEmpty (Constant a b) -> Constant a b #

stimes :: Integral b0 => b0 -> Constant a b -> Constant a b #

(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a, b, c) -> (a, b, c) -> (a, b, c) #

sconcat :: NonEmpty (a, b, c) -> (a, b, c) #

stimes :: Integral b0 => b0 -> (a, b, c) -> (a, b, c) #

(Semigroup (f a), Semigroup (g a)) => Semigroup (Product f g a)

Since: base-4.16.0.0

Instance details

Defined in Data.Functor.Product

Methods

(<>) :: Product f g a -> Product f g a -> Product f g a #

sconcat :: NonEmpty (Product f g a) -> Product f g a #

stimes :: Integral b => b -> Product f g a -> Product f g a #

(Semigroup (f p), Semigroup (g p)) => Semigroup ((f :*: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

sconcat :: NonEmpty ((f :*: g) p) -> (f :*: g) p #

stimes :: Integral b => b -> (f :*: g) p -> (f :*: g) p #

Semigroup c => Semigroup (K1 i c p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: K1 i c p -> K1 i c p -> K1 i c p #

sconcat :: NonEmpty (K1 i c p) -> K1 i c p #

stimes :: Integral b => b -> K1 i c p -> K1 i c p #

(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

sconcat :: NonEmpty (a, b, c, d) -> (a, b, c, d) #

stimes :: Integral b0 => b0 -> (a, b, c, d) -> (a, b, c, d) #

Semigroup (f (g a)) => Semigroup (Compose f g a)

Since: base-4.16.0.0

Instance details

Defined in Data.Functor.Compose

Methods

(<>) :: Compose f g a -> Compose f g a -> Compose f g a #

sconcat :: NonEmpty (Compose f g a) -> Compose f g a #

stimes :: Integral b => b -> Compose f g a -> Compose f g a #

Semigroup (f (g p)) => Semigroup ((f :.: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

sconcat :: NonEmpty ((f :.: g) p) -> (f :.: g) p #

stimes :: Integral b => b -> (f :.: g) p -> (f :.: g) p #

Semigroup (f p) => Semigroup (M1 i c f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

(<>) :: M1 i c f p -> M1 i c f p -> M1 i c f p #

sconcat :: NonEmpty (M1 i c f p) -> M1 i c f p #

stimes :: Integral b => b -> M1 i c f p -> M1 i c f p #

(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

sconcat :: NonEmpty (a, b, c, d, e) -> (a, b, c, d, e) #

stimes :: Integral b0 => b0 -> (a, b, c, d, e) -> (a, b, c, d, e) #

class Semigroup a => Monoid a where #

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

Right identity
x <> mempty = x
Left identity
mempty <> x = x
Associativity
x <> (y <> z) = (x <> y) <> z (Semigroup law)
Concatenation
mconcat = foldr (<>) mempty

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product.

NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.

Minimal complete definition

mempty

Methods

mempty :: a #

Identity of mappend

>>> "Hello world" <> mempty
"Hello world"

mappend :: a -> a -> a #

An associative operation

NOTE: This method is redundant and has the default implementation mappend = (<>) since base-4.11.0.0. Should it be implemented manually, since mappend is a synonym for (<>), it is expected that the two functions are defined the same way. In a future GHC release mappend will be removed from Monoid.

mconcat :: [a] -> a #

Fold a list using the monoid.

For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

>>> mconcat ["Hello", " ", "Haskell", "!"]
"Hello Haskell!"

Instances

Instances details
Monoid All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: All #

mappend :: All -> All -> All #

mconcat :: [All] -> All #

Monoid Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Any #

mappend :: Any -> Any -> Any #

mconcat :: [Any] -> Any #

Monoid NumErrors 
Instance details

Defined in Numeric.CollectErrors.Type

Monoid IntSet 
Instance details

Defined in Data.IntSet.Internal

Monoid Ordering

Since: base-2.1

Instance details

Defined in GHC.Base

Monoid ()

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: () #

mappend :: () -> () -> () #

mconcat :: [()] -> () #

Monoid a => Monoid (Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Methods

mempty :: Identity a #

mappend :: Identity a -> Identity a -> Identity a #

mconcat :: [Identity a] -> Identity a #

Monoid (First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

mempty :: First a #

mappend :: First a -> First a -> First a #

mconcat :: [First a] -> First a #

Monoid (Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Methods

mempty :: Last a #

mappend :: Last a -> Last a -> Last a #

mconcat :: [Last a] -> Last a #

Monoid a => Monoid (Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Dual a #

mappend :: Dual a -> Dual a -> Dual a #

mconcat :: [Dual a] -> Dual a #

Monoid (Endo a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Endo a #

mappend :: Endo a -> Endo a -> Endo a #

mconcat :: [Endo a] -> Endo a #

Num a => Monoid (Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Product a #

mappend :: Product a -> Product a -> Product a #

mconcat :: [Product a] -> Product a #

Num a => Monoid (Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Sum a #

mappend :: Sum a -> Sum a -> Sum a #

mconcat :: [Sum a] -> Sum a #

Monoid p => Monoid (Par1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: Par1 p #

mappend :: Par1 p -> Par1 p -> Par1 p #

mconcat :: [Par1 p] -> Par1 p #

Num a => Monoid (AlphaColour a) 
Instance details

Defined in Data.Colour.Internal

Num a => Monoid (Colour a) 
Instance details

Defined in Data.Colour.Internal

Methods

mempty :: Colour a #

mappend :: Colour a -> Colour a -> Colour a #

mconcat :: [Colour a] -> Colour a #

Monoid (IntMap a) 
Instance details

Defined in Data.IntMap.Internal

Methods

mempty :: IntMap a #

mappend :: IntMap a -> IntMap a -> IntMap a #

mconcat :: [IntMap a] -> IntMap a #

Monoid (Seq a) 
Instance details

Defined in Data.Sequence.Internal

Methods

mempty :: Seq a #

mappend :: Seq a -> Seq a -> Seq a #

mconcat :: [Seq a] -> Seq a #

Monoid (MergeSet a) 
Instance details

Defined in Data.Set.Internal

Methods

mempty :: MergeSet a #

mappend :: MergeSet a -> MergeSet a -> MergeSet a #

mconcat :: [MergeSet a] -> MergeSet a #

Ord a => Monoid (Set a) 
Instance details

Defined in Data.Set.Internal

Methods

mempty :: Set a #

mappend :: Set a -> Set a -> Set a #

mconcat :: [Set a] -> Set a #

Monoid a => Monoid (IO a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

mempty :: IO a #

mappend :: IO a -> IO a -> IO a #

mconcat :: [IO a] -> IO a #

Monoid a => Monoid (Q a)

Since: template-haskell-2.17.0.0

Instance details

Defined in Language.Haskell.TH.Syntax

Methods

mempty :: Q a #

mappend :: Q a -> Q a -> Q a #

mconcat :: [Q a] -> Q a #

Semigroup a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."

Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: Maybe a #

mappend :: Maybe a -> Maybe a -> Maybe a #

mconcat :: [Maybe a] -> Maybe a #

Monoid a => Monoid (a)

Since: base-4.15

Instance details

Defined in GHC.Base

Methods

mempty :: (a) #

mappend :: (a) -> (a) -> (a) #

mconcat :: [(a)] -> (a) #

Monoid [a]

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: [a] #

mappend :: [a] -> [a] -> [a] #

mconcat :: [[a]] -> [a] #

Monoid (Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Methods

mempty :: Proxy s #

mappend :: Proxy s -> Proxy s -> Proxy s #

mconcat :: [Proxy s] -> Proxy s #

Monoid (U1 p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: U1 p #

mappend :: U1 p -> U1 p -> U1 p #

mconcat :: [U1 p] -> U1 p #

Ord k => Monoid (Map k v) 
Instance details

Defined in Data.Map.Internal

Methods

mempty :: Map k v #

mappend :: Map k v -> Map k v -> Map k v #

mconcat :: [Map k v] -> Map k v #

Monoid b => Monoid (a -> b)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: a -> b #

mappend :: (a -> b) -> (a -> b) -> a -> b #

mconcat :: [a -> b] -> a -> b #

(Monoid a, Monoid b) => Monoid (a, b)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b) #

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

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

Monoid a => Monoid (Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

Methods

mempty :: Const a b #

mappend :: Const a b -> Const a b -> Const a b #

mconcat :: [Const a b] -> Const a b #

(Applicative f, Monoid a) => Monoid (Ap f a)

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Methods

mempty :: Ap f a #

mappend :: Ap f a -> Ap f a -> Ap f a #

mconcat :: [Ap f a] -> Ap f a #

Alternative f => Monoid (Alt f a)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Methods

mempty :: Alt f a #

mappend :: Alt f a -> Alt f a -> Alt f a #

mconcat :: [Alt f a] -> Alt f a #

Monoid (f p) => Monoid (Rec1 f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: Rec1 f p #

mappend :: Rec1 f p -> Rec1 f p -> Rec1 f p #

mconcat :: [Rec1 f p] -> Rec1 f p #

Monoid a => Monoid (Constant a b) 
Instance details

Defined in Data.Functor.Constant

Methods

mempty :: Constant a b #

mappend :: Constant a b -> Constant a b -> Constant a b #

mconcat :: [Constant a b] -> Constant a b #

(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b, c) #

mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) #

mconcat :: [(a, b, c)] -> (a, b, c) #

(Monoid (f a), Monoid (g a)) => Monoid (Product f g a)

Since: base-4.16.0.0

Instance details

Defined in Data.Functor.Product

Methods

mempty :: Product f g a #

mappend :: Product f g a -> Product f g a -> Product f g a #

mconcat :: [Product f g a] -> Product f g a #

(Monoid (f p), Monoid (g p)) => Monoid ((f :*: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: (f :*: g) p #

mappend :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

mconcat :: [(f :*: g) p] -> (f :*: g) p #

Monoid c => Monoid (K1 i c p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: K1 i c p #

mappend :: K1 i c p -> K1 i c p -> K1 i c p #

mconcat :: [K1 i c p] -> K1 i c p #

(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b, c, d) #

mappend :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) #

mconcat :: [(a, b, c, d)] -> (a, b, c, d) #

Monoid (f (g a)) => Monoid (Compose f g a)

Since: base-4.16.0.0

Instance details

Defined in Data.Functor.Compose

Methods

mempty :: Compose f g a #

mappend :: Compose f g a -> Compose f g a -> Compose f g a #

mconcat :: [Compose f g a] -> Compose f g a #

Monoid (f (g p)) => Monoid ((f :.: g) p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: (f :.: g) p #

mappend :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

mconcat :: [(f :.: g) p] -> (f :.: g) p #

Monoid (f p) => Monoid (M1 i c f p)

Since: base-4.12.0.0

Instance details

Defined in GHC.Generics

Methods

mempty :: M1 i c f p #

mappend :: M1 i c f p -> M1 i c f p -> M1 i c f p #

mconcat :: [M1 i c f p] -> M1 i c f p #

(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e)

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: (a, b, c, d, e) #

mappend :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) #

mconcat :: [(a, b, c, d, e)] -> (a, b, c, d, e) #

data Bool #

Constructors

False 
True 

Instances

Instances details
Arbitrary Bool 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen Bool #

shrink :: Bool -> [Bool] #

CoArbitrary Bool 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Bool -> Gen b -> Gen b #

Function Bool 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Bool -> b) -> Bool :-> b #

Testable Bool 
Instance details

Defined in Test.QuickCheck.Property

Methods

property :: Bool -> Property #

propertyForAllShrinkShow :: Gen a -> (a -> [a]) -> (a -> [String]) -> (a -> Bool) -> Property #

Bounded Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: 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] #

Generic Bool 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type #

Methods

from :: Bool -> Rep Bool x #

to :: Rep Bool x -> Bool #

SingKind Bool

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type DemoteRep Bool

Methods

fromSing :: forall (a :: Bool). Sing a -> DemoteRep Bool

Read Bool

Since: base-2.1

Instance details

Defined in GHC.Read

Show Bool

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Bool -> ShowS #

show :: Bool -> String #

showList :: [Bool] -> ShowS #

Eq Bool 
Instance details

Defined in GHC.Classes

Methods

(==) :: Bool -> Bool -> Bool #

(/=) :: Bool -> Bool -> Bool #

Ord Bool 
Instance details

Defined in GHC.Classes

Methods

compare :: Bool -> Bool -> Ordering #

(<) :: Bool -> Bool -> Bool #

(<=) :: Bool -> Bool -> Bool #

(>) :: Bool -> Bool -> Bool #

(>=) :: Bool -> Bool -> Bool #

max :: Bool -> Bool -> Bool #

min :: Bool -> Bool -> Bool #

Example Bool 
Instance details

Defined in Test.Hspec.Core.Example

Associated Types

type Arg Bool #

CanNeg Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

Associated Types

type NegType Bool Source #

CanTestCertainly Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

SingI 'False

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing 'False

SingI 'True

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing 'True

CanAndOrAsymmetric Bool Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

Associated Types

type AndOrType Bool Bool Source #

HasEqAsymmetric Bool Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Bool Bool Source #

ConvertibleExactly Bool Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

HasIfThenElse Bool t Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

Associated Types

type IfThenElseType Bool t Source #

Methods

ifThenElse :: Bool -> t -> t -> IfThenElseType Bool t Source #

Monad m => Testable m Bool 
Instance details

Defined in Test.SmallCheck.Property

Methods

test :: Bool -> Property m #

Monad m => CoSerial m Bool 
Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Bool -> b) #

Monad m => Serial m Bool 
Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m Bool #

Lift Bool 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Bool -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Bool -> Code m Bool #

(CanAndOrAsymmetric Bool t2, CanBeErrors es) => CanAndOrAsymmetric Bool (CollectErrors es t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

Associated Types

type AndOrType Bool (CollectErrors es t2) Source #

(HasEqAsymmetric Bool b, CanBeErrors es, CanTestCertainly (EqCompareType Bool b)) => HasEqAsymmetric Bool (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Bool (CollectErrors es b) Source #

(ConvertibleExactly Bool t, Monoid es) => ConvertibleExactly Bool (CollectErrors es t) Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

(HasEqAsymmetric (Maybe Bool) b, CanBeErrors es, CanTestCertainly (EqCompareType (Maybe Bool) b)) => HasEqAsymmetric (Maybe Bool) (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (Maybe Bool) (CollectErrors es b) Source #

Example (a -> Bool) 
Instance details

Defined in Test.Hspec.Core.Example

Associated Types

type Arg (a -> Bool) #

Methods

evaluateExample :: (a -> Bool) -> Params -> (ActionWith (Arg (a -> Bool)) -> IO ()) -> ProgressCallback -> IO Result #

(CanAndOrAsymmetric t1 Bool, CanBeErrors es) => CanAndOrAsymmetric (CollectErrors es t1) Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

Associated Types

type AndOrType (CollectErrors es t1) Bool Source #

(HasEqAsymmetric a Bool, CanBeErrors es, CanTestCertainly (EqCompareType a Bool)) => HasEqAsymmetric (CollectErrors es a) Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (CollectErrors es a) Bool Source #

(HasEqAsymmetric a (Maybe Bool), CanBeErrors es, CanTestCertainly (EqCompareType a (Maybe Bool))) => HasEqAsymmetric (CollectErrors es a) (Maybe Bool) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (CollectErrors es a) (Maybe Bool) Source #

type DemoteRep Bool 
Instance details

Defined in GHC.Generics

type DemoteRep Bool = Bool
type Rep Bool

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep Bool = D1 ('MetaData "Bool" "GHC.Types" "ghc-prim" 'False) (C1 ('MetaCons "False" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "True" 'PrefixI 'False) (U1 :: Type -> Type))
data Sing (a :: Bool) 
Instance details

Defined in GHC.Generics

data Sing (a :: Bool) where
type Arg Bool 
Instance details

Defined in Test.Hspec.Core.Example

type Arg Bool = ()
type NegType Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

type AndOrType Bool Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

type EqCompareType Bool Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type IfThenElseType Bool t Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

type IfThenElseType Bool t = t
type AndOrType Bool (CollectErrors es t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

type EqCompareType Bool (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType (Maybe Bool) (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type Arg (a -> Bool) 
Instance details

Defined in Test.Hspec.Core.Example

type Arg (a -> Bool) = a
type AndOrType (CollectErrors es t1) Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Bool

type EqCompareType (CollectErrors es a) Bool Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType (CollectErrors es a) (Maybe Bool) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type String = [Char] #

A String is a list of characters. String constants in Haskell are values of type String.

See Data.List for operations on lists.

data Char #

The character type Char is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) code points (i.e. characters, see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 characters), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char.

To convert a Char to or from the corresponding Int value defined by Unicode, use toEnum and fromEnum from the Enum class respectively (or equivalently ord and chr).

Instances

Instances details
Arbitrary Char 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen Char #

shrink :: Char -> [Char] #

CoArbitrary Char 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Char -> Gen b -> Gen b #

Function Char 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Char -> b) -> Char :-> b #

Bounded Char

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Char

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: 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] #

Read Char

Since: base-2.1

Instance details

Defined in GHC.Read

Show Char

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Char -> ShowS #

show :: Char -> String #

showList :: [Char] -> ShowS #

IsChar Char

Since: base-2.1

Instance details

Defined in Text.Printf

Methods

toChar :: Char -> Char #

fromChar :: Char -> Char #

PrintfArg Char

Since: base-2.1

Instance details

Defined in Text.Printf

Eq Char 
Instance details

Defined in GHC.Classes

Methods

(==) :: Char -> Char -> Bool #

(/=) :: Char -> Char -> Bool #

Ord Char 
Instance details

Defined in GHC.Classes

Methods

compare :: Char -> Char -> Ordering #

(<) :: Char -> Char -> Bool #

(<=) :: Char -> Char -> Bool #

(>) :: Char -> Char -> Bool #

(>=) :: Char -> Char -> Bool #

max :: Char -> Char -> Char #

min :: Char -> Char -> Char #

ErrorList Char 
Instance details

Defined in Control.Monad.Trans.Error

Methods

listMsg :: String -> [Char] #

Convertible Int16 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

HasEqAsymmetric Char Char Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Char Char Source #

Monad m => CoSerial m Char 
Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Char -> b) #

Monad m => Serial m Char 
Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m Char #

Lift Char 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Char -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Char -> Code m Char #

Generic1 (URec Char :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Char) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Char a -> Rep1 (URec Char) a #

to1 :: forall (a :: k0). Rep1 (URec Char) a -> URec Char a #

Monad m => Testable m (Either Reason Reason)

Works like the Bool instance, but includes an explanation of the result.

Left and Right correspond to test failure and success respectively.

Since: smallcheck-1.1

Instance details

Defined in Test.SmallCheck.Property

Foldable (UChar :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UChar m -> m #

foldMap :: Monoid m => (a -> m) -> UChar a -> m #

foldMap' :: Monoid m => (a -> m) -> UChar a -> m #

foldr :: (a -> b -> b) -> b -> UChar a -> b #

foldr' :: (a -> b -> b) -> b -> UChar a -> b #

foldl :: (b -> a -> b) -> b -> UChar a -> b #

foldl' :: (b -> a -> b) -> b -> UChar a -> b #

foldr1 :: (a -> a -> a) -> UChar a -> a #

foldl1 :: (a -> a -> a) -> UChar a -> a #

toList :: UChar a -> [a] #

null :: UChar a -> Bool #

length :: UChar a -> Int #

elem :: Eq a => a -> UChar a -> Bool #

maximum :: Ord a => UChar a -> a #

minimum :: Ord a => UChar a -> a #

sum :: Num a => UChar a -> a #

product :: Num a => UChar a -> a #

Traversable (UChar :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UChar a -> f (UChar b) #

sequenceA :: Applicative f => UChar (f a) -> f (UChar a) #

mapM :: Monad m => (a -> m b) -> UChar a -> m (UChar b) #

sequence :: Monad m => UChar (m a) -> m (UChar a) #

Functor (URec Char :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Char a -> URec Char b #

(<$) :: a -> URec Char b -> URec Char a #

Generic (URec Char p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Char p) :: Type -> Type #

Methods

from :: URec Char p -> Rep (URec Char p) x #

to :: Rep (URec Char p) x -> URec Char p #

Show (URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Char p -> ShowS #

show :: URec Char p -> String #

showList :: [URec Char p] -> ShowS #

Eq (URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: URec Char p -> URec Char p -> Bool #

(/=) :: URec Char p -> URec Char p -> Bool #

Ord (URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Char p -> URec Char p -> Ordering #

(<) :: URec Char p -> URec Char p -> Bool #

(<=) :: URec Char p -> URec Char p -> Bool #

(>) :: URec Char p -> URec Char p -> Bool #

(>=) :: URec Char p -> URec Char p -> Bool #

max :: URec Char p -> URec Char p -> URec Char p #

min :: URec Char p -> URec Char p -> URec Char p #

data URec Char (p :: k)

Used for marking occurrences of Char#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Char (p :: k) = UChar {}
type EqCompareType Char Char Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type Rep1 (URec Char :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (URec Char :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UChar :: k -> Type)))
type Rep (URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep (URec Char p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "uChar#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UChar :: Type -> Type)))

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

Instances

Instances details
Arbitrary Double 
Instance details

Defined in Test.QuickCheck.Arbitrary

CoArbitrary Double 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Double -> Gen b -> Gen b #

Function Double 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Double -> b) -> Double :-> b #

Floating Double

Since: base-2.1

Instance details

Defined in GHC.Float

RealFloat Double

Since: base-2.1

Instance details

Defined in GHC.Float

Read Double

Since: base-2.1

Instance details

Defined in GHC.Read

PrintfArg Double

Since: base-2.1

Instance details

Defined in Text.Printf

Eq Double

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

>>> 0/0 == (0/0 :: Double)
False

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

>>> 0 == (-0 :: Double)
True
>>> recip 0 == recip (-0 :: Double)
False
Instance details

Defined in GHC.Classes

Methods

(==) :: Double -> Double -> Bool #

(/=) :: Double -> Double -> Bool #

Ord Double

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

>>> 0/0 <= (0/0 :: Double)
False

Also note that, due to the same, Ord's operator interactions are not respected by Double's instance:

>>> (0/0 :: Double) > 1
False
>>> compare (0/0 :: Double) 1
GT
Instance details

Defined in GHC.Classes

CanNeg Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type NegType Double Source #

CanExp Double Source # 
Instance details

Defined in Numeric.MixedTypes.Elementary

Associated Types

type ExpType Double Source #

CanLog Double Source # 
Instance details

Defined in Numeric.MixedTypes.Elementary

Associated Types

type LogType Double Source #

CanSinCos Double Source # 
Instance details

Defined in Numeric.MixedTypes.Elementary

Associated Types

type SinCosType Double Source #

CanSqrt Double Source # 
Instance details

Defined in Numeric.MixedTypes.Elementary

Associated Types

type SqrtType Double Source #

CanTestFinite Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestInteger Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestNaN Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Methods

isNaN :: Double -> Bool Source #

CanTestZero Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanAbs Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type AbsType Double Source #

CanTestPosNeg Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

CanTestIsIntegerType Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanGiveUpIfVeryInaccurate Double Source # 
Instance details

Defined in Numeric.MixedTypes.Reduce

CanRound Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type RoundType Double Source #

HasIntegerBounds Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Convertible Int16 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

CanAddAsymmetric Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Rational Double Source #

CanAddAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Integer Double Source #

CanAddAsymmetric Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Double Rational Source #

CanAddAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Double Integer Source #

CanAddAsymmetric Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Double Double Source #

CanAddAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Double Int Source #

CanAddAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Int Double Source #

CanSub Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Rational Double Source #

CanSub Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Integer Double Source #

CanSub Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Double Rational Source #

CanSub Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Double Integer Source #

CanSub Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Double Double Source #

CanSub Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Double Int Source #

CanSub Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Int Double Source #

CanDiv Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Rational Double Source #

CanDiv Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Integer Double Source #

CanDiv Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Double Rational Source #

CanDiv Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Double Integer Source #

CanDiv Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Double Double Source #

CanDiv Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Double Int Source #

CanDiv Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Int Double Source #

HasEqAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Integer Double Source #

HasEqAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Double Integer Source #

HasEqAsymmetric Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Double Double Source #

HasEqAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Double Int Source #

HasEqAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Int Double Source #

ConvertibleExactly Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

CanMinMaxAsymmetric Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Rational Double Source #

CanMinMaxAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Integer Double Source #

CanMinMaxAsymmetric Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Double Rational Source #

CanMinMaxAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Double Integer Source #

CanMinMaxAsymmetric Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Double Double Source #

CanMinMaxAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Double Int Source #

CanMinMaxAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Int Double Source #

CanMulAsymmetric Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Rational Double Source #

CanMulAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Integer Double Source #

CanMulAsymmetric Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Double Rational Source #

CanMulAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Double Integer Source #

CanMulAsymmetric Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Double Double Source #

CanMulAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Double Int Source #

CanMulAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Int Double Source #

HasOrderAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Integer Double Source #

HasOrderAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Double Integer Source #

HasOrderAsymmetric Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Double Double Source #

HasOrderAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Double Int Source #

HasOrderAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Int Double Source #

CanPow Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Double Int Source #

type PPowType Double Int Source #

CanPow Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Int Double Source #

type PPowType Int Double Source #

CanDivIMod Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

CanDivIMod Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Monad m => CoSerial m Double 
Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Double -> b) #

Monad m => Serial m Double 
Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m Double #

Lift Double 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Double -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Double -> Code m Double #

CanAddAsymmetric Double b => CanAddAsymmetric Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type AddType Double (Complex b) Source #

Methods

add :: Double -> Complex b -> AddType Double (Complex b) Source #

CanSub Double b => CanSub Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type SubType Double (Complex b) Source #

Methods

sub :: Double -> Complex b -> SubType Double (Complex b) Source #

(CanMulAsymmetric Double b, CanMulAsymmetric b b, CanAddSameType (MulType b b), CanDiv (MulType Double b) (MulType b b)) => CanDiv Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type DivType Double (Complex b) Source #

(CanDiv Double b, CanTestZero b) => CanDiv Double (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Double (CN b) Source #

Methods

divide :: Double -> CN b -> DivType Double (CN b) Source #

HasEqAsymmetric Double b => HasEqAsymmetric Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type EqCompareType Double (Complex b) Source #

CanMulAsymmetric Double b => CanMulAsymmetric Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type MulType Double (Complex b) Source #

Methods

mul :: Double -> Complex b -> MulType Double (Complex b) Source #

(CanMulAsymmetric Double b, CanGiveUpIfVeryInaccurate (MulType Double b)) => CanMulAsymmetric Double (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Double (CN b) Source #

Methods

mul :: Double -> CN b -> MulType Double (CN b) Source #

(CanPow Double e, HasOrderCertainly e Integer, CanTestIsIntegerType e, CanTestInteger e) => CanPow Double (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Double (CN e) Source #

type PPowType Double (CN e) Source #

Methods

pow :: Double -> CN e -> PowType Double (CN e) Source #

ppow :: Double -> CN e -> PPowType Double (CN e) Source #

(CanDivIMod Double t2, CanTestPosNeg t2) => CanDivIMod Double (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Double (CN t2) Source #

type ModType Double (CN t2) Source #

Methods

divIMod :: Double -> CN t2 -> (DivIType Double (CN t2), ModType Double (CN t2)) Source #

mod :: Double -> CN t2 -> ModType Double (CN t2) Source #

divI :: Double -> CN t2 -> DivIType Double (CN t2) Source #

Generic1 (URec Double :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Double) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Double a -> Rep1 (URec Double) a #

to1 :: forall (a :: k0). Rep1 (URec Double) a -> URec Double a #

(CanAddAsymmetric Double b, CanBeErrors es) => CanAddAsymmetric Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Double (CollectErrors es b) Source #

(CanSub Double b, CanBeErrors es) => CanSub Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Double (CollectErrors es b) Source #

(HasEqAsymmetric Double b, CanBeErrors es, CanTestCertainly (EqCompareType Double b)) => HasEqAsymmetric Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Double (CollectErrors es b) Source #

(ConvertibleExactly Double t, Monoid es) => ConvertibleExactly Double (CollectErrors es t) Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

(CanMinMaxAsymmetric Double b, CanBeErrors es) => CanMinMaxAsymmetric Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Double (CollectErrors es b) Source #

(HasOrderAsymmetric Double b, CanBeErrors es, CanTestCertainly (OrderCompareType Double b)) => HasOrderAsymmetric Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Double (CollectErrors es b) Source #

Foldable (UDouble :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UDouble m -> m #

foldMap :: Monoid m => (a -> m) -> UDouble a -> m #

foldMap' :: Monoid m => (a -> m) -> UDouble a -> m #

foldr :: (a -> b -> b) -> b -> UDouble a -> b #

foldr' :: (a -> b -> b) -> b -> UDouble a -> b #

foldl :: (b -> a -> b) -> b -> UDouble a -> b #

foldl' :: (b -> a -> b) -> b -> UDouble a -> b #

foldr1 :: (a -> a -> a) -> UDouble a -> a #

foldl1 :: (a -> a -> a) -> UDouble a -> a #

toList :: UDouble a -> [a] #

null :: UDouble a -> Bool #

length :: UDouble a -> Int #

elem :: Eq a => a -> UDouble a -> Bool #

maximum :: Ord a => UDouble a -> a #

minimum :: Ord a => UDouble a -> a #

sum :: Num a => UDouble a -> a #

product :: Num a => UDouble a -> a #

Traversable (UDouble :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UDouble a -> f (UDouble b) #

sequenceA :: Applicative f => UDouble (f a) -> f (UDouble a) #

mapM :: Monad m => (a -> m b) -> UDouble a -> m (UDouble b) #

sequence :: Monad m => UDouble (m a) -> m (UDouble a) #

CanAddAsymmetric a Double => CanAddAsymmetric (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type AddType (Complex a) Double Source #

Methods

add :: Complex a -> Double -> AddType (Complex a) Double Source #

CanSub a Double => CanSub (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type SubType (Complex a) Double Source #

Methods

sub :: Complex a -> Double -> SubType (Complex a) Double Source #

CanDiv a Double => CanDiv (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type DivType (Complex a) Double Source #

CanDiv a Double => CanDiv (CN a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType (CN a) Double Source #

Methods

divide :: CN a -> Double -> DivType (CN a) Double Source #

HasEqAsymmetric a Double => HasEqAsymmetric (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type EqCompareType (Complex a) Double Source #

CanMulAsymmetric a Double => CanMulAsymmetric (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type MulType (Complex a) Double Source #

Methods

mul :: Complex a -> Double -> MulType (Complex a) Double Source #

(CanMulAsymmetric a Double, CanGiveUpIfVeryInaccurate (MulType a Double)) => CanMulAsymmetric (CN a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType (CN a) Double Source #

Methods

mul :: CN a -> Double -> MulType (CN a) Double Source #

(CanPow b Double, HasOrderCertainly b Integer, HasEqCertainly b Integer, CanTestIsIntegerType b) => CanPow (CN b) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType (CN b) Double Source #

type PPowType (CN b) Double Source #

Methods

pow :: CN b -> Double -> PowType (CN b) Double Source #

ppow :: CN b -> Double -> PPowType (CN b) Double Source #

CanDivIMod t1 Double => CanDivIMod (CN t1) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType (CN t1) Double Source #

type ModType (CN t1) Double Source #

Methods

divIMod :: CN t1 -> Double -> (DivIType (CN t1) Double, ModType (CN t1) Double) Source #

mod :: CN t1 -> Double -> ModType (CN t1) Double Source #

divI :: CN t1 -> Double -> DivIType (CN t1) Double Source #

Functor (URec Double :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Double a -> URec Double b #

(<$) :: a -> URec Double b -> URec Double a #

(CanAddAsymmetric a Double, CanBeErrors es) => CanAddAsymmetric (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType (CollectErrors es a) Double Source #

(CanSub a Double, CanBeErrors es) => CanSub (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType (CollectErrors es a) Double Source #

(HasEqAsymmetric a Double, CanBeErrors es, CanTestCertainly (EqCompareType a Double)) => HasEqAsymmetric (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (CollectErrors es a) Double Source #

(CanMinMaxAsymmetric a Double, CanBeErrors es) => CanMinMaxAsymmetric (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType (CollectErrors es a) Double Source #

(HasOrderAsymmetric a Double, CanBeErrors es, CanTestCertainly (OrderCompareType a Double)) => HasOrderAsymmetric (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType (CollectErrors es a) Double Source #

Generic (URec Double p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Double p) :: Type -> Type #

Methods

from :: URec Double p -> Rep (URec Double p) x #

to :: Rep (URec Double p) x -> URec Double p #

Show (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Double p -> ShowS #

show :: URec Double p -> String #

showList :: [URec Double p] -> ShowS #

Eq (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: URec Double p -> URec Double p -> Bool #

(/=) :: URec Double p -> URec Double p -> Bool #

Ord (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Double p -> URec Double p -> Ordering #

(<) :: URec Double p -> URec Double p -> Bool #

(<=) :: URec Double p -> URec Double p -> Bool #

(>) :: URec Double p -> URec Double p -> Bool #

(>=) :: URec Double p -> URec Double p -> Bool #

max :: URec Double p -> URec Double p -> URec Double p #

min :: URec Double p -> URec Double p -> URec Double p #

type NegType Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type ExpType Double Source # 
Instance details

Defined in Numeric.MixedTypes.Elementary

type LogType Double Source # 
Instance details

Defined in Numeric.MixedTypes.Elementary

type SinCosType Double Source # 
Instance details

Defined in Numeric.MixedTypes.Elementary

type SqrtType Double Source # 
Instance details

Defined in Numeric.MixedTypes.Elementary

type AbsType Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type RoundType Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

data URec Double (p :: k)

Used for marking occurrences of Double#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Double (p :: k) = UDouble {}
type AddType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type DivType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type EqCompareType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MulType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type OrderCompareType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type PPowType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type DivIType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Double Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type AddType Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type SubType Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType Double (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Double (CN b) = CN (DivType Double b)
type EqCompareType Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType Double (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType Double (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Double (CN b) = CN (MulType Double b)
type PPowType Double (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double (CN e) = CN (PowType Double e)
type DivIType Double (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Double (CN t2) = CN (DivIType Double t2)
type ModType Double (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Double (CN t2) = CN (ModType Double t2)
type Rep1 (URec Double :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (URec Double :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UDouble" 'PrefixI 'True) (S1 ('MetaSel ('Just "uDouble#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UDouble :: k -> Type)))
type AddType Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type EqCompareType Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type OrderCompareType Double (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type AddType (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type SubType (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType (CN a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType (CN a) Double = CN (DivType a Double)
type EqCompareType (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType (Complex a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType (CN a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType (CN a) Double = CN (MulType a Double)
type PPowType (CN b) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType (CN b) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType (CN b) Double = CN (PowType b Double)
type DivIType (CN t1) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType (CN t1) Double = CN (DivIType t1 Double)
type ModType (CN t1) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType (CN t1) Double = CN (ModType t1 Double)
type AddType (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type EqCompareType (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type OrderCompareType (CollectErrors es a) Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type Rep (URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep (URec Double p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UDouble" 'PrefixI 'True) (S1 ('MetaSel ('Just "uDouble#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UDouble :: Type -> Type)))

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

Instances

Instances details
Arbitrary Float 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen Float #

shrink :: Float -> [Float] #

CoArbitrary Float 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Float -> Gen b -> Gen b #

Function Float 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Float -> b) -> Float :-> b #

Floating Float

Since: base-2.1

Instance details

Defined in GHC.Float

RealFloat Float

Since: base-2.1

Instance details

Defined in GHC.Float

Read Float

Since: base-2.1

Instance details

Defined in GHC.Read

PrintfArg Float

Since: base-2.1

Instance details

Defined in Text.Printf

Eq Float

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

>>> 0/0 == (0/0 :: Float)
False

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

>>> 0 == (-0 :: Float)
True
>>> recip 0 == recip (-0 :: Float)
False
Instance details

Defined in GHC.Classes

Methods

(==) :: Float -> Float -> Bool #

(/=) :: Float -> Float -> Bool #

Ord Float

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

>>> 0/0 <= (0/0 :: Float)
False

Also note that, due to the same, Ord's operator interactions are not respected by Float's instance:

>>> (0/0 :: Float) > 1
False
>>> compare (0/0 :: Float) 1
GT
Instance details

Defined in GHC.Classes

Methods

compare :: Float -> Float -> Ordering #

(<) :: Float -> Float -> Bool #

(<=) :: Float -> Float -> Bool #

(>) :: Float -> Float -> Bool #

(>=) :: Float -> Float -> Bool #

max :: Float -> Float -> Float #

min :: Float -> Float -> Float #

Convertible Int16 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Monad m => CoSerial m Float 
Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Float -> b) #

Monad m => Serial m Float 
Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m Float #

Lift Float 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Float -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Float -> Code m Float #

Generic1 (URec Float :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Float) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Float a -> Rep1 (URec Float) a #

to1 :: forall (a :: k0). Rep1 (URec Float) a -> URec Float a #

Foldable (UFloat :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UFloat m -> m #

foldMap :: Monoid m => (a -> m) -> UFloat a -> m #

foldMap' :: Monoid m => (a -> m) -> UFloat a -> m #

foldr :: (a -> b -> b) -> b -> UFloat a -> b #

foldr' :: (a -> b -> b) -> b -> UFloat a -> b #

foldl :: (b -> a -> b) -> b -> UFloat a -> b #

foldl' :: (b -> a -> b) -> b -> UFloat a -> b #

foldr1 :: (a -> a -> a) -> UFloat a -> a #

foldl1 :: (a -> a -> a) -> UFloat a -> a #

toList :: UFloat a -> [a] #

null :: UFloat a -> Bool #

length :: UFloat a -> Int #

elem :: Eq a => a -> UFloat a -> Bool #

maximum :: Ord a => UFloat a -> a #

minimum :: Ord a => UFloat a -> a #

sum :: Num a => UFloat a -> a #

product :: Num a => UFloat a -> a #

Traversable (UFloat :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UFloat a -> f (UFloat b) #

sequenceA :: Applicative f => UFloat (f a) -> f (UFloat a) #

mapM :: Monad m => (a -> m b) -> UFloat a -> m (UFloat b) #

sequence :: Monad m => UFloat (m a) -> m (UFloat a) #

Functor (URec Float :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Float a -> URec Float b #

(<$) :: a -> URec Float b -> URec Float a #

Generic (URec Float p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Float p) :: Type -> Type #

Methods

from :: URec Float p -> Rep (URec Float p) x #

to :: Rep (URec Float p) x -> URec Float p #

Show (URec Float p) 
Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Float p -> ShowS #

show :: URec Float p -> String #

showList :: [URec Float p] -> ShowS #

Eq (URec Float p) 
Instance details

Defined in GHC.Generics

Methods

(==) :: URec Float p -> URec Float p -> Bool #

(/=) :: URec Float p -> URec Float p -> Bool #

Ord (URec Float p) 
Instance details

Defined in GHC.Generics

Methods

compare :: URec Float p -> URec Float p -> Ordering #

(<) :: URec Float p -> URec Float p -> Bool #

(<=) :: URec Float p -> URec Float p -> Bool #

(>) :: URec Float p -> URec Float p -> Bool #

(>=) :: URec Float p -> URec Float p -> Bool #

max :: URec Float p -> URec Float p -> URec Float p #

min :: URec Float p -> URec Float p -> URec Float p #

data URec Float (p :: k)

Used for marking occurrences of Float#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Float (p :: k) = UFloat {}
type Rep1 (URec Float :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (URec Float :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UFloat" 'PrefixI 'True) (S1 ('MetaSel ('Just "uFloat#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UFloat :: k -> Type)))
type Rep (URec Float p) 
Instance details

Defined in GHC.Generics

type Rep (URec Float p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UFloat" 'PrefixI 'True) (S1 ('MetaSel ('Just "uFloat#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UFloat :: Type -> Type)))

data Int #

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

Instances

Instances details
Arbitrary Int 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen Int #

shrink :: Int -> [Int] #

CoArbitrary Int 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Int -> Gen b -> Gen b #

Function Int 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Int -> b) -> Int :-> b #

Bounded Int

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

minBound :: Int #

maxBound :: Int #

Enum Int

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: 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] #

Num Int

Since: base-2.1

Instance details

Defined in GHC.Num

Methods

(+) :: Int -> Int -> Int #

(-) :: Int -> Int -> Int #

(*) :: Int -> Int -> Int #

negate :: Int -> Int #

abs :: Int -> Int #

signum :: Int -> Int #

fromInteger :: Integer -> Int #

Read Int

Since: base-2.1

Instance details

Defined in GHC.Read

Integral Int

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

quot :: 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) #

toInteger :: Int -> Integer #

Real Int

Since: base-2.0.1

Instance details

Defined in GHC.Real

Methods

toRational :: Int -> Rational #

Show Int

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Int -> ShowS #

show :: Int -> String #

showList :: [Int] -> ShowS #

PrintfArg Int

Since: base-2.1

Instance details

Defined in Text.Printf

Eq Int 
Instance details

Defined in GHC.Classes

Methods

(==) :: Int -> Int -> Bool #

(/=) :: Int -> Int -> Bool #

Ord Int 
Instance details

Defined in GHC.Classes

Methods

compare :: Int -> Int -> Ordering #

(<) :: Int -> Int -> Bool #

(<=) :: Int -> Int -> Bool #

(>) :: Int -> Int -> Bool #

(>=) :: Int -> Int -> Bool #

max :: Int -> Int -> Int #

min :: Int -> Int -> Int #

CanNeg Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type NegType Int Source #

Methods

negate :: Int -> NegType Int Source #

CanPickNonZero Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Methods

pickNonZero :: [(Int, s)] -> Maybe (Int, s) Source #

CanTestFinite Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestInteger Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestZero Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanAbs Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type AbsType Int Source #

Methods

abs :: Int -> AbsType Int Source #

CanTestPosNeg Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

CanTestIsIntegerType Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanGiveUpIfVeryInaccurate Int Source # 
Instance details

Defined in Numeric.MixedTypes.Reduce

HasIntegerBounds Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Convertible Int16 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

CanAddAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Rational Int Source #

CanAddAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Integer Int Source #

CanAddAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Double Int Source #

CanAddAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Int Rational Source #

CanAddAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Int Integer Source #

CanAddAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Int Double Source #

CanAddAsymmetric Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Int Int Source #

Methods

add :: Int -> Int -> AddType Int Int Source #

CanSub Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Rational Int Source #

CanSub Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Integer Int Source #

CanSub Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Double Int Source #

CanSub Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Int Rational Source #

CanSub Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Int Integer Source #

CanSub Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Int Double Source #

CanSub Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Int Int Source #

Methods

sub :: Int -> Int -> SubType Int Int Source #

CanDiv Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Rational Int Source #

CanDiv Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Integer Int Source #

CanDiv Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Double Int Source #

CanDiv Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Int Rational Source #

CanDiv Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Int Integer Source #

CanDiv Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Int Double Source #

CanDiv Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Int Int Source #

Methods

divide :: Int -> Int -> DivType Int Int Source #

HasEqAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Rational Int Source #

HasEqAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Integer Int Source #

HasEqAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Double Int Source #

HasEqAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Int Rational Source #

HasEqAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Int Integer Source #

HasEqAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Int Double Source #

HasEqAsymmetric Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Int Int Source #

ConvertibleExactly Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

CanMinMaxAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Rational Int Source #

CanMinMaxAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Integer Int Source #

CanMinMaxAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Double Int Source #

CanMinMaxAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Int Rational Source #

CanMinMaxAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Int Integer Source #

CanMinMaxAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Int Double Source #

CanMinMaxAsymmetric Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Int Int Source #

CanMulAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Rational Int Source #

CanMulAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Integer Int Source #

CanMulAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Double Int Source #

CanMulAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Int Rational Source #

CanMulAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Int Integer Source #

CanMulAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Int Double Source #

CanMulAsymmetric Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Int Int Source #

Methods

mul :: Int -> Int -> MulType Int Int Source #

HasOrderAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Rational Int Source #

HasOrderAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Integer Int Source #

HasOrderAsymmetric Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Double Int Source #

HasOrderAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Int Rational Source #

HasOrderAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Int Integer Source #

HasOrderAsymmetric Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Int Double Source #

HasOrderAsymmetric Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Int Int Source #

CanPow Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Rational Int Source #

type PPowType Rational Int Source #

CanPow Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Integer Int Source #

type PPowType Integer Int Source #

CanPow Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Double Int Source #

type PPowType Double Int Source #

CanPow Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Int Integer Source #

type PPowType Int Integer Source #

CanPow Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Int Double Source #

type PPowType Int Double Source #

CanPow Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Int Int Source #

type PPowType Int Int Source #

CanDivIMod Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Rational Int Source #

type ModType Rational Int Source #

CanDivIMod Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Integer Int Source #

type ModType Integer Int Source #

CanDivIMod Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Int Rational Source #

type ModType Int Rational Source #

CanDivIMod Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Int Integer Source #

type ModType Int Integer Source #

CanDivIMod Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Int Int Source #

type ModType Int Int Source #

Monad m => CoSerial m Int 
Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Int -> b) #

Monad m => Serial m Int 
Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m Int #

Lift Int 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Int -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Int -> Code m Int #

CanAddAsymmetric Int b => CanAddAsymmetric Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type AddType Int (Complex b) Source #

Methods

add :: Int -> Complex b -> AddType Int (Complex b) Source #

CanSub Int b => CanSub Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type SubType Int (Complex b) Source #

Methods

sub :: Int -> Complex b -> SubType Int (Complex b) Source #

(CanMulAsymmetric Int b, CanMulAsymmetric b b, CanAddSameType (MulType b b), CanDiv (MulType Int b) (MulType b b)) => CanDiv Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type DivType Int (Complex b) Source #

Methods

divide :: Int -> Complex b -> DivType Int (Complex b) Source #

(CanDiv Int b, CanTestZero b) => CanDiv Int (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Int (CN b) Source #

Methods

divide :: Int -> CN b -> DivType Int (CN b) Source #

HasEqAsymmetric Int b => HasEqAsymmetric Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type EqCompareType Int (Complex b) Source #

ConvertibleExactly Int t => ConvertibleExactly Int (Complex t) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

CanMulAsymmetric Int b => CanMulAsymmetric Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type MulType Int (Complex b) Source #

Methods

mul :: Int -> Complex b -> MulType Int (Complex b) Source #

(CanMulAsymmetric Int b, CanGiveUpIfVeryInaccurate (MulType Int b)) => CanMulAsymmetric Int (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Int (CN b) Source #

Methods

mul :: Int -> CN b -> MulType Int (CN b) Source #

(CanPow Int e, HasOrderCertainly e Integer, CanTestIsIntegerType e, CanTestInteger e) => CanPow Int (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Int (CN e) Source #

type PPowType Int (CN e) Source #

Methods

pow :: Int -> CN e -> PowType Int (CN e) Source #

ppow :: Int -> CN e -> PPowType Int (CN e) Source #

(CanDivIMod Int t2, CanTestPosNeg t2) => CanDivIMod Int (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Int (CN t2) Source #

type ModType Int (CN t2) Source #

Methods

divIMod :: Int -> CN t2 -> (DivIType Int (CN t2), ModType Int (CN t2)) Source #

mod :: Int -> CN t2 -> ModType Int (CN t2) Source #

divI :: Int -> CN t2 -> DivIType Int (CN t2) Source #

Generic1 (URec Int :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Int) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Int a -> Rep1 (URec Int) a #

to1 :: forall (a :: k0). Rep1 (URec Int) a -> URec Int a #

(CanAddAsymmetric Int b, CanBeErrors es) => CanAddAsymmetric Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Int (CollectErrors es b) Source #

Methods

add :: Int -> CollectErrors es b -> AddType Int (CollectErrors es b) Source #

(CanSub Int b, CanBeErrors es) => CanSub Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Int (CollectErrors es b) Source #

Methods

sub :: Int -> CollectErrors es b -> SubType Int (CollectErrors es b) Source #

(HasEqAsymmetric Int b, CanBeErrors es, CanTestCertainly (EqCompareType Int b)) => HasEqAsymmetric Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Int (CollectErrors es b) Source #

(ConvertibleExactly Int t, Monoid es) => ConvertibleExactly Int (CollectErrors es t) Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

(CanMinMaxAsymmetric Int b, CanBeErrors es) => CanMinMaxAsymmetric Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Int (CollectErrors es b) Source #

(HasOrderAsymmetric Int b, CanBeErrors es, CanTestCertainly (OrderCompareType Int b)) => HasOrderAsymmetric Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Int (CollectErrors es b) Source #

Foldable (UInt :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UInt m -> m #

foldMap :: Monoid m => (a -> m) -> UInt a -> m #

foldMap' :: Monoid m => (a -> m) -> UInt a -> m #

foldr :: (a -> b -> b) -> b -> UInt a -> b #

foldr' :: (a -> b -> b) -> b -> UInt a -> b #

foldl :: (b -> a -> b) -> b -> UInt a -> b #

foldl' :: (b -> a -> b) -> b -> UInt a -> b #

foldr1 :: (a -> a -> a) -> UInt a -> a #

foldl1 :: (a -> a -> a) -> UInt a -> a #

toList :: UInt a -> [a] #

null :: UInt a -> Bool #

length :: UInt a -> Int #

elem :: Eq a => a -> UInt a -> Bool #

maximum :: Ord a => UInt a -> a #

minimum :: Ord a => UInt a -> a #

sum :: Num a => UInt a -> a #

product :: Num a => UInt a -> a #

Traversable (UInt :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UInt a -> f (UInt b) #

sequenceA :: Applicative f => UInt (f a) -> f (UInt a) #

mapM :: Monad m => (a -> m b) -> UInt a -> m (UInt b) #

sequence :: Monad m => UInt (m a) -> m (UInt a) #

CanAddAsymmetric a Int => CanAddAsymmetric (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type AddType (Complex a) Int Source #

Methods

add :: Complex a -> Int -> AddType (Complex a) Int Source #

CanSub a Int => CanSub (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type SubType (Complex a) Int Source #

Methods

sub :: Complex a -> Int -> SubType (Complex a) Int Source #

CanDiv a Int => CanDiv (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type DivType (Complex a) Int Source #

Methods

divide :: Complex a -> Int -> DivType (Complex a) Int Source #

CanDiv a Int => CanDiv (CN a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType (CN a) Int Source #

Methods

divide :: CN a -> Int -> DivType (CN a) Int Source #

HasEqAsymmetric a Int => HasEqAsymmetric (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type EqCompareType (Complex a) Int Source #

CanMulAsymmetric a Int => CanMulAsymmetric (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type MulType (Complex a) Int Source #

Methods

mul :: Complex a -> Int -> MulType (Complex a) Int Source #

(CanMulAsymmetric a Int, CanGiveUpIfVeryInaccurate (MulType a Int)) => CanMulAsymmetric (CN a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType (CN a) Int Source #

Methods

mul :: CN a -> Int -> MulType (CN a) Int Source #

(CanPow b Int, HasOrderCertainly b Integer, HasEqCertainly b Integer, CanTestIsIntegerType b) => CanPow (CN b) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType (CN b) Int Source #

type PPowType (CN b) Int Source #

Methods

pow :: CN b -> Int -> PowType (CN b) Int Source #

ppow :: CN b -> Int -> PPowType (CN b) Int Source #

CanDivIMod t1 Int => CanDivIMod (CN t1) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType (CN t1) Int Source #

type ModType (CN t1) Int Source #

Methods

divIMod :: CN t1 -> Int -> (DivIType (CN t1) Int, ModType (CN t1) Int) Source #

mod :: CN t1 -> Int -> ModType (CN t1) Int Source #

divI :: CN t1 -> Int -> DivIType (CN t1) Int Source #

Functor (URec Int :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Int a -> URec Int b #

(<$) :: a -> URec Int b -> URec Int a #

(CanAddAsymmetric a Int, CanBeErrors es) => CanAddAsymmetric (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType (CollectErrors es a) Int Source #

Methods

add :: CollectErrors es a -> Int -> AddType (CollectErrors es a) Int Source #

(CanSub a Int, CanBeErrors es) => CanSub (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType (CollectErrors es a) Int Source #

Methods

sub :: CollectErrors es a -> Int -> SubType (CollectErrors es a) Int Source #

(HasEqAsymmetric a Int, CanBeErrors es, CanTestCertainly (EqCompareType a Int)) => HasEqAsymmetric (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (CollectErrors es a) Int Source #

(CanMinMaxAsymmetric a Int, CanBeErrors es) => CanMinMaxAsymmetric (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType (CollectErrors es a) Int Source #

(HasOrderAsymmetric a Int, CanBeErrors es, CanTestCertainly (OrderCompareType a Int)) => HasOrderAsymmetric (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType (CollectErrors es a) Int Source #

Generic (URec Int p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Int p) :: Type -> Type #

Methods

from :: URec Int p -> Rep (URec Int p) x #

to :: Rep (URec Int p) x -> URec Int p #

Show (URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Int p -> ShowS #

show :: URec Int p -> String #

showList :: [URec Int p] -> ShowS #

Eq (URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: URec Int p -> URec Int p -> Bool #

(/=) :: URec Int p -> URec Int p -> Bool #

Ord (URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Int p -> URec Int p -> Ordering #

(<) :: URec Int p -> URec Int p -> Bool #

(<=) :: URec Int p -> URec Int p -> Bool #

(>) :: URec Int p -> URec Int p -> Bool #

(>=) :: URec Int p -> URec Int p -> Bool #

max :: URec Int p -> URec Int p -> URec Int p #

min :: URec Int p -> URec Int p -> URec Int p #

type NegType Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type NegType Int = Int
type AbsType Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type AbsType Int = Int
data URec Int (p :: k)

Used for marking occurrences of Int#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Int (p :: k) = UInt {}
type AddType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type DivType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type EqCompareType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MulType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type OrderCompareType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type PPowType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Int Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type DivIType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Int Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type AddType Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type SubType Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType Int (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Int (CN b) = CN (DivType Int b)
type EqCompareType Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType Int (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType Int (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Int (CN b) = CN (MulType Int b)
type PPowType Int (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Int (CN e) = CN (PPowType Int e)
type PowType Int (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Int (CN e) = CN (PowType Int e)
type DivIType Int (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Int (CN t2) = CN (DivIType Int t2)
type ModType Int (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Int (CN t2) = CN (ModType Int t2)
type Rep1 (URec Int :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (URec Int :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UInt" 'PrefixI 'True) (S1 ('MetaSel ('Just "uInt#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UInt :: k -> Type)))
type AddType Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type EqCompareType Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type OrderCompareType Int (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type AddType (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type SubType (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType (CN a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType (CN a) Int = CN (DivType a Int)
type EqCompareType (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType (Complex a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType (CN a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType (CN a) Int = CN (MulType a Int)
type PPowType (CN b) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType (CN b) Int = CN (PPowType b Int)
type PowType (CN b) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType (CN b) Int = CN (PowType b Int)
type DivIType (CN t1) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType (CN t1) Int = CN (DivIType t1 Int)
type ModType (CN t1) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType (CN t1) Int = CN (ModType t1 Int)
type AddType (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type EqCompareType (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type OrderCompareType (CollectErrors es a) Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type Rep (URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep (URec Int p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UInt" 'PrefixI 'True) (S1 ('MetaSel ('Just "uInt#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UInt :: Type -> Type)))

data 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 (fit into an Int), IS constructor is used. Otherwise Integer and IN constructors are used to store a BigNat representing respectively the positive or the negative value magnitude.

Invariant: Integer and IN are used iff value doesn't fit in IS

Instances

Instances details
Arbitrary Integer 
Instance details

Defined in Test.QuickCheck.Arbitrary

CoArbitrary Integer 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Integer -> Gen b -> Gen b #

Function Integer 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Integer -> b) -> Integer :-> b #

Enum Integer

Since: base-2.1

Instance details

Defined in GHC.Enum

Num Integer

Since: base-2.1

Instance details

Defined in GHC.Num

Read Integer

Since: base-2.1

Instance details

Defined in GHC.Read

Integral Integer

Since: base-2.0.1

Instance details

Defined in GHC.Real

Real Integer

Since: base-2.0.1

Instance details

Defined in GHC.Real

Show Integer

Since: base-2.1

Instance details

Defined in GHC.Show

PrintfArg Integer

Since: base-2.1

Instance details

Defined in Text.Printf

Eq Integer 
Instance details

Defined in GHC.Num.Integer

Methods

(==) :: Integer -> Integer -> Bool #

(/=) :: Integer -> Integer -> Bool #

Ord Integer 
Instance details

Defined in GHC.Num.Integer

CanNeg Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type NegType Rational Source #

CanNeg Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type NegType Integer Source #

CanPickNonZero Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Methods

pickNonZero :: [(Rational, s)] -> Maybe (Rational, s) Source #

CanPickNonZero Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Methods

pickNonZero :: [(Integer, s)] -> Maybe (Integer, s) Source #

CanTestFinite Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestFinite Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestInteger Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestInteger Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestNaN Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Methods

isNaN :: Rational -> Bool Source #

CanTestNaN Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Methods

isNaN :: Integer -> Bool Source #

CanTestZero Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

CanTestZero Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Field Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Field

OrderedCertainlyField Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Field

OrderedField Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Field

CanAbs Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type AbsType Rational Source #

CanAbs Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type AbsType Integer Source #

CanTestPosNeg Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

CanTestPosNeg Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

CanTestIsIntegerType Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanTestIsIntegerType Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanGiveUpIfVeryInaccurate Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Reduce

CanGiveUpIfVeryInaccurate Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Reduce

OrderedCertainlyRing Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

OrderedCertainlyRing Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

OrderedRing Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

OrderedRing Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

Ring Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

Ring Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

CanRound Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type RoundType Rational Source #

HasIntegerBounds Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

HasIntegerBounds Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Convertible Int16 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int16 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

CanAddAsymmetric Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Rational Rational Source #

CanAddAsymmetric Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Rational Integer Source #

CanAddAsymmetric Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Rational Double Source #

CanAddAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Rational Int Source #

CanAddAsymmetric Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Integer Rational Source #

CanAddAsymmetric Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Integer Integer Source #

CanAddAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Integer Double Source #

CanAddAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Integer Int Source #

CanAddAsymmetric Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Double Rational Source #

CanAddAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Double Integer Source #

CanAddAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Int Rational Source #

CanAddAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Int Integer Source #

CanSub Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Rational Rational Source #

CanSub Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Rational Integer Source #

CanSub Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Rational Double Source #

CanSub Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Rational Int Source #

CanSub Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Integer Rational Source #

CanSub Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Integer Integer Source #

CanSub Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Integer Double Source #

CanSub Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Integer Int Source #

CanSub Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Double Rational Source #

CanSub Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Double Integer Source #

CanSub Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Int Rational Source #

CanSub Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Int Integer Source #

CanDiv Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Rational Rational Source #

CanDiv Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Rational Integer Source #

CanDiv Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Rational Double Source #

CanDiv Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Rational Int Source #

CanDiv Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Integer Rational Source #

CanDiv Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Integer Integer Source #

CanDiv Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Integer Double Source #

CanDiv Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Integer Int Source #

CanDiv Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Double Rational Source #

CanDiv Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Double Integer Source #

CanDiv Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Int Rational Source #

CanDiv Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Int Integer Source #

HasEqAsymmetric Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Rational Rational Source #

HasEqAsymmetric Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Rational Integer Source #

HasEqAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Rational Int Source #

HasEqAsymmetric Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Integer Rational Source #

HasEqAsymmetric Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Integer Integer Source #

HasEqAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Integer Double Source #

HasEqAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Integer Int Source #

HasEqAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Double Integer Source #

HasEqAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Int Rational Source #

HasEqAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Int Integer Source #

ConvertibleExactly Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

ConvertibleExactly Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

CanMinMaxAsymmetric Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Rational Rational Source #

CanMinMaxAsymmetric Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Rational Integer Source #

CanMinMaxAsymmetric Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Rational Double Source #

CanMinMaxAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Rational Int Source #

CanMinMaxAsymmetric Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Integer Rational Source #

CanMinMaxAsymmetric Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Integer Integer Source #

CanMinMaxAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Integer Double Source #

CanMinMaxAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Integer Int Source #

CanMinMaxAsymmetric Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Double Rational Source #

CanMinMaxAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Double Integer Source #

CanMinMaxAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Int Rational Source #

CanMinMaxAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Int Integer Source #

CanMulAsymmetric Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Rational Rational Source #

CanMulAsymmetric Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Rational Integer Source #

CanMulAsymmetric Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Rational Double Source #

CanMulAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Rational Int Source #

CanMulAsymmetric Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Integer Rational Source #

CanMulAsymmetric Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Integer Integer Source #

CanMulAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Integer Double Source #

CanMulAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Integer Int Source #

CanMulAsymmetric Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Double Rational Source #

CanMulAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Double Integer Source #

CanMulAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Int Rational Source #

CanMulAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Int Integer Source #

HasOrderAsymmetric Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

HasOrderAsymmetric Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

HasOrderAsymmetric Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Rational Int Source #

HasOrderAsymmetric Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

HasOrderAsymmetric Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Integer Integer Source #

HasOrderAsymmetric Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Integer Double Source #

HasOrderAsymmetric Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Integer Int Source #

HasOrderAsymmetric Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Double Integer Source #

HasOrderAsymmetric Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Int Rational Source #

HasOrderAsymmetric Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Int Integer Source #

CanPow Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Rational Int Source #

type PPowType Rational Int Source #

CanPow Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Integer Int Source #

type PPowType Integer Int Source #

CanPow Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

CanPow Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Int Integer Source #

type PPowType Int Integer Source #

CanDivIMod Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

CanDivIMod Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

CanDivIMod Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Rational Int Source #

type ModType Rational Int Source #

CanDivIMod Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

CanDivIMod Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

CanDivIMod Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Integer Int Source #

type ModType Integer Int Source #

CanDivIMod Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

CanDivIMod Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Int Rational Source #

type ModType Int Rational Source #

CanDivIMod Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Int Integer Source #

type ModType Int Integer Source #

Monad m => CoSerial m Integer 
Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Integer -> b) #

Monad m => Serial m Integer 
Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m Integer #

Lift Integer 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Integer -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Integer -> Code m Integer #

CanAddAsymmetric Rational b => CanAddAsymmetric Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type AddType Rational (Complex b) Source #

CanAddAsymmetric Integer b => CanAddAsymmetric Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type AddType Integer (Complex b) Source #

CanSub Rational b => CanSub Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type SubType Rational (Complex b) Source #

CanSub Integer b => CanSub Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type SubType Integer (Complex b) Source #

(CanMulAsymmetric Rational b, CanMulAsymmetric b b, CanAddSameType (MulType b b), CanDiv (MulType Rational b) (MulType b b)) => CanDiv Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type DivType Rational (Complex b) Source #

(CanDiv Rational b, CanTestZero b) => CanDiv Rational (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Rational (CN b) Source #

Methods

divide :: Rational -> CN b -> DivType Rational (CN b) Source #

(CanMulAsymmetric Integer b, CanMulAsymmetric b b, CanAddSameType (MulType b b), CanDiv (MulType Integer b) (MulType b b)) => CanDiv Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type DivType Integer (Complex b) Source #

(CanDiv Integer b, CanTestZero b) => CanDiv Integer (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType Integer (CN b) Source #

Methods

divide :: Integer -> CN b -> DivType Integer (CN b) Source #

HasEqAsymmetric Rational b => HasEqAsymmetric Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type EqCompareType Rational (Complex b) Source #

HasEqAsymmetric Integer b => HasEqAsymmetric Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type EqCompareType Integer (Complex b) Source #

ConvertibleExactly Rational t => ConvertibleExactly Rational (Complex t) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

ConvertibleExactly Integer t => ConvertibleExactly Integer (Complex t) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

CanMulAsymmetric Rational b => CanMulAsymmetric Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type MulType Rational (Complex b) Source #

(CanMulAsymmetric Rational b, CanGiveUpIfVeryInaccurate (MulType Rational b)) => CanMulAsymmetric Rational (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Rational (CN b) Source #

Methods

mul :: Rational -> CN b -> MulType Rational (CN b) Source #

CanMulAsymmetric Integer b => CanMulAsymmetric Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type MulType Integer (Complex b) Source #

(CanMulAsymmetric Integer b, CanGiveUpIfVeryInaccurate (MulType Integer b)) => CanMulAsymmetric Integer (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType Integer (CN b) Source #

Methods

mul :: Integer -> CN b -> MulType Integer (CN b) Source #

(CanPow Rational e, HasOrderCertainly e Integer, CanTestIsIntegerType e, CanTestInteger e) => CanPow Rational (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Rational (CN e) Source #

type PPowType Rational (CN e) Source #

Methods

pow :: Rational -> CN e -> PowType Rational (CN e) Source #

ppow :: Rational -> CN e -> PPowType Rational (CN e) Source #

(CanPow Integer e, HasOrderCertainly e Integer, CanTestIsIntegerType e, CanTestInteger e) => CanPow Integer (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType Integer (CN e) Source #

type PPowType Integer (CN e) Source #

Methods

pow :: Integer -> CN e -> PowType Integer (CN e) Source #

ppow :: Integer -> CN e -> PPowType Integer (CN e) Source #

(CanDivIMod Rational t2, CanTestPosNeg t2) => CanDivIMod Rational (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Rational (CN t2) Source #

type ModType Rational (CN t2) Source #

Methods

divIMod :: Rational -> CN t2 -> (DivIType Rational (CN t2), ModType Rational (CN t2)) Source #

mod :: Rational -> CN t2 -> ModType Rational (CN t2) Source #

divI :: Rational -> CN t2 -> DivIType Rational (CN t2) Source #

(CanDivIMod Integer t2, CanTestPosNeg t2) => CanDivIMod Integer (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType Integer (CN t2) Source #

type ModType Integer (CN t2) Source #

Methods

divIMod :: Integer -> CN t2 -> (DivIType Integer (CN t2), ModType Integer (CN t2)) Source #

mod :: Integer -> CN t2 -> ModType Integer (CN t2) Source #

divI :: Integer -> CN t2 -> DivIType Integer (CN t2) Source #

(CanAddAsymmetric Rational b, CanBeErrors es) => CanAddAsymmetric Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Rational (CollectErrors es b) Source #

(CanAddAsymmetric Integer b, CanBeErrors es) => CanAddAsymmetric Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType Integer (CollectErrors es b) Source #

(CanSub Rational b, CanBeErrors es) => CanSub Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Rational (CollectErrors es b) Source #

(CanSub Integer b, CanBeErrors es) => CanSub Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType Integer (CollectErrors es b) Source #

(HasEqAsymmetric Rational b, CanBeErrors es, CanTestCertainly (EqCompareType Rational b)) => HasEqAsymmetric Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Rational (CollectErrors es b) Source #

(HasEqAsymmetric Integer b, CanBeErrors es, CanTestCertainly (EqCompareType Integer b)) => HasEqAsymmetric Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType Integer (CollectErrors es b) Source #

(ConvertibleExactly Rational t, Monoid es) => ConvertibleExactly Rational (CollectErrors es t) Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

(ConvertibleExactly Integer t, Monoid es) => ConvertibleExactly Integer (CollectErrors es t) Source # 
Instance details

Defined in Numeric.MixedTypes.Literals

(CanMinMaxAsymmetric Rational b, CanBeErrors es) => CanMinMaxAsymmetric Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Rational (CollectErrors es b) Source #

(CanMinMaxAsymmetric Integer b, CanBeErrors es) => CanMinMaxAsymmetric Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType Integer (CollectErrors es b) Source #

(HasOrderAsymmetric Rational b, CanBeErrors es, CanTestCertainly (OrderCompareType Rational b)) => HasOrderAsymmetric Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Rational (CollectErrors es b) Source #

(HasOrderAsymmetric Integer b, CanBeErrors es, CanTestCertainly (OrderCompareType Integer b)) => HasOrderAsymmetric Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType Integer (CollectErrors es b) Source #

Field (CN Rational) Source # 
Instance details

Defined in Numeric.MixedTypes.Field

OrderedCertainlyField (CN Rational) Source # 
Instance details

Defined in Numeric.MixedTypes.Field

OrderedField (CN Rational) Source # 
Instance details

Defined in Numeric.MixedTypes.Field

OrderedCertainlyRing (CN Rational) Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

OrderedCertainlyRing (CN Integer) Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

OrderedRing (CN Rational) Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

OrderedRing (CN Integer) Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

Ring (CN Rational) Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

Ring (CN Integer) Source # 
Instance details

Defined in Numeric.MixedTypes.Ring

CanAddAsymmetric a Rational => CanAddAsymmetric (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type AddType (Complex a) Rational Source #

CanAddAsymmetric a Integer => CanAddAsymmetric (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type AddType (Complex a) Integer Source #

CanSub a Rational => CanSub (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type SubType (Complex a) Rational Source #

CanSub a Integer => CanSub (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type SubType (Complex a) Integer Source #

CanDiv a Rational => CanDiv (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type DivType (Complex a) Rational Source #

CanDiv a Integer => CanDiv (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type DivType (Complex a) Integer Source #

CanDiv a Rational => CanDiv (CN a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType (CN a) Rational Source #

Methods

divide :: CN a -> Rational -> DivType (CN a) Rational Source #

CanDiv a Integer => CanDiv (CN a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType (CN a) Integer Source #

Methods

divide :: CN a -> Integer -> DivType (CN a) Integer Source #

HasEqAsymmetric a Rational => HasEqAsymmetric (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type EqCompareType (Complex a) Rational Source #

HasEqAsymmetric a Integer => HasEqAsymmetric (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type EqCompareType (Complex a) Integer Source #

CanMulAsymmetric a Rational => CanMulAsymmetric (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type MulType (Complex a) Rational Source #

CanMulAsymmetric a Integer => CanMulAsymmetric (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

Associated Types

type MulType (Complex a) Integer Source #

(CanMulAsymmetric a Rational, CanGiveUpIfVeryInaccurate (MulType a Rational)) => CanMulAsymmetric (CN a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType (CN a) Rational Source #

Methods

mul :: CN a -> Rational -> MulType (CN a) Rational Source #

(CanMulAsymmetric a Integer, CanGiveUpIfVeryInaccurate (MulType a Integer)) => CanMulAsymmetric (CN a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType (CN a) Integer Source #

Methods

mul :: CN a -> Integer -> MulType (CN a) Integer Source #

(CanPow b Rational, HasOrderCertainly b Integer, HasEqCertainly b Integer, CanTestIsIntegerType b) => CanPow (CN b) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType (CN b) Rational Source #

type PPowType (CN b) Rational Source #

Methods

pow :: CN b -> Rational -> PowType (CN b) Rational Source #

ppow :: CN b -> Rational -> PPowType (CN b) Rational Source #

(CanPow b Integer, HasOrderCertainly b Integer, HasEqCertainly b Integer, CanTestIsIntegerType b) => CanPow (CN b) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType (CN b) Integer Source #

type PPowType (CN b) Integer Source #

Methods

pow :: CN b -> Integer -> PowType (CN b) Integer Source #

ppow :: CN b -> Integer -> PPowType (CN b) Integer Source #

CanDivIMod t1 Rational => CanDivIMod (CN t1) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType (CN t1) Rational Source #

type ModType (CN t1) Rational Source #

Methods

divIMod :: CN t1 -> Rational -> (DivIType (CN t1) Rational, ModType (CN t1) Rational) Source #

mod :: CN t1 -> Rational -> ModType (CN t1) Rational Source #

divI :: CN t1 -> Rational -> DivIType (CN t1) Rational Source #

CanDivIMod t1 Integer => CanDivIMod (CN t1) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

Associated Types

type DivIType (CN t1) Integer Source #

type ModType (CN t1) Integer Source #

Methods

divIMod :: CN t1 -> Integer -> (DivIType (CN t1) Integer, ModType (CN t1) Integer) Source #

mod :: CN t1 -> Integer -> ModType (CN t1) Integer Source #

divI :: CN t1 -> Integer -> DivIType (CN t1) Integer Source #

(CanAddAsymmetric a Rational, CanBeErrors es) => CanAddAsymmetric (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType (CollectErrors es a) Rational Source #

(CanAddAsymmetric a Integer, CanBeErrors es) => CanAddAsymmetric (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType (CollectErrors es a) Integer Source #

(CanSub a Rational, CanBeErrors es) => CanSub (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType (CollectErrors es a) Rational Source #

(CanSub a Integer, CanBeErrors es) => CanSub (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType (CollectErrors es a) Integer Source #

(HasEqAsymmetric a Rational, CanBeErrors es, CanTestCertainly (EqCompareType a Rational)) => HasEqAsymmetric (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (CollectErrors es a) Rational Source #

(HasEqAsymmetric a Integer, CanBeErrors es, CanTestCertainly (EqCompareType a Integer)) => HasEqAsymmetric (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (CollectErrors es a) Integer Source #

(CanMinMaxAsymmetric a Rational, CanBeErrors es) => CanMinMaxAsymmetric (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType (CollectErrors es a) Rational Source #

(CanMinMaxAsymmetric a Integer, CanBeErrors es) => CanMinMaxAsymmetric (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType (CollectErrors es a) Integer Source #

(HasOrderAsymmetric a Rational, CanBeErrors es, CanTestCertainly (OrderCompareType a Rational)) => HasOrderAsymmetric (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType (CollectErrors es a) Rational Source #

(HasOrderAsymmetric a Integer, CanBeErrors es, CanTestCertainly (OrderCompareType a Integer)) => HasOrderAsymmetric (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

Associated Types

type OrderCompareType (CollectErrors es a) Integer Source #

type NegType Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type NegType Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type AbsType Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type AbsType Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type RoundType Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type AddType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type DivType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type EqCompareType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MulType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type OrderCompareType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type PPowType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Rational Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Integer Double Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type DivIType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Rational Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Rational Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Rational Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Integer Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Integer Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Integer Int Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Double Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Int Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Int Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type AddType Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type AddType Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type SubType Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type SubType Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType Rational (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType Integer (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type EqCompareType Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type EqCompareType Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType Rational (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType Rational (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType Integer (Complex b) Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType Integer (CN b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type PPowType Rational (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType Integer (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Rational (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType Integer (CN e) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type DivIType Rational (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType Integer (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Rational (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Integer (CN t2) Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType Integer (CN t2) = CN (ModType Integer t2)
type AddType Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type EqCompareType Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type OrderCompareType Rational (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType Integer (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type AddType (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type AddType (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type SubType (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type SubType (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type DivType (CN a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType (CN a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type EqCompareType (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type EqCompareType (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType (Complex a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType (Complex a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Complex

type MulType (CN a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType (CN a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type PPowType (CN b) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType (CN b) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType (CN b) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType (CN b) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type DivIType (CN t1) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type DivIType (CN t1) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType (CN t1) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType (CN t1) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Round

type ModType (CN t1) Integer = CN (ModType t1 Integer)
type AddType (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type EqCompareType (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type OrderCompareType (CollectErrors es a) Rational Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

type OrderCompareType (CollectErrors es a) Integer Source # 
Instance details

Defined in Numeric.MixedTypes.Ord

data 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

Nothing 
Just a 

Instances

Instances details
Arbitrary1 Maybe 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

liftArbitrary :: Gen a -> Gen (Maybe a) #

liftShrink :: (a -> [a]) -> Maybe a -> [Maybe a] #

MonadFail Maybe

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Methods

fail :: String -> Maybe a #

Foldable Maybe

Since: base-2.1

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Maybe m -> m #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m #

foldMap' :: Monoid m => (a -> m) -> Maybe a -> m #

foldr :: (a -> b -> b) -> b -> Maybe a -> b #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b #

foldl :: (b -> a -> b) -> b -> Maybe a -> b #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b #

foldr1 :: (a -> a -> a) -> Maybe a -> a #

foldl1 :: (a -> a -> a) -> Maybe a -> a #

toList :: Maybe a -> [a] #

null :: Maybe a -> Bool #

length :: Maybe a -> Int #

elem :: Eq a => a -> Maybe a -> Bool #

maximum :: Ord a => Maybe a -> a #

minimum :: Ord a => Maybe a -> a #

sum :: Num a => Maybe a -> a #

product :: Num a => Maybe a -> a #

Eq1 Maybe

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool #

Ord1 Maybe

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering #

Read1 Maybe

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) #

liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] #

liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Maybe a) #

liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Maybe a] #

Show1 Maybe

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS #

Traversable Maybe

Since: base-2.1

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) #

sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) #

mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) #

sequence :: Monad m => Maybe (m a) -> m (Maybe a) #

Alternative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

empty :: Maybe a #

(<|>) :: Maybe a -> Maybe a -> Maybe a #

some :: Maybe a -> Maybe [a] #

many :: Maybe a -> Maybe [a] #

Applicative Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> Maybe a #

(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b #

liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c #

(*>) :: Maybe a -> Maybe b -> Maybe b #

(<*) :: Maybe a -> Maybe b -> Maybe a #

Functor Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> Maybe a -> Maybe b #

(<$) :: a -> Maybe b -> Maybe a #

Monad Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b #

(>>) :: Maybe a -> Maybe b -> Maybe b #

return :: a -> Maybe a #

MonadPlus Maybe

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mzero :: Maybe a #

mplus :: Maybe a -> Maybe a -> Maybe a #

Generic1 Maybe 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 Maybe :: k -> Type #

Methods

from1 :: forall (a :: k). Maybe a -> Rep1 Maybe a #

to1 :: forall (a :: k). Rep1 Maybe a -> Maybe a #

CoSerial m a => CoSerial m (Maybe a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Maybe a -> b) #

Serial m a => Serial m (Maybe a) 
Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m (Maybe a) #

Lift a => Lift (Maybe a :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Maybe a -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Maybe a -> Code m (Maybe a) #

Arbitrary a => Arbitrary (Maybe a) 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen (Maybe a) #

shrink :: Maybe a -> [Maybe a] #

CoArbitrary a => CoArbitrary (Maybe a) 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Maybe a -> Gen b -> Gen b #

Function a => Function (Maybe a) 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Maybe a -> b) -> Maybe a :-> b #

Testable prop => Testable (Maybe prop) 
Instance details

Defined in Test.QuickCheck.Property

Methods

property :: Maybe prop -> Property #

propertyForAllShrinkShow :: Gen a -> (a -> [a]) -> (a -> [String]) -> (a -> Maybe prop) -> Property #

Semigroup a => Monoid (Maybe a)

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."

Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

mempty :: Maybe a #

mappend :: Maybe a -> Maybe a -> Maybe a #

mconcat :: [Maybe a] -> Maybe a #

Semigroup a => Semigroup (Maybe a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: Maybe a -> Maybe a -> Maybe a #

sconcat :: NonEmpty (Maybe a) -> Maybe a #

stimes :: Integral b => b -> Maybe a -> Maybe a #

Generic (Maybe a) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Maybe a) :: Type -> Type #

Methods

from :: Maybe a -> Rep (Maybe a) x #

to :: Rep (Maybe a) x -> Maybe a #

SingKind a => SingKind (Maybe a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type DemoteRep (Maybe a)

Methods

fromSing :: forall (a0 :: Maybe a). Sing a0 -> DemoteRep (Maybe a)

Read a => Read (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Read

Show a => Show (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Maybe a -> ShowS #

show :: Maybe a -> String #

showList :: [Maybe a] -> ShowS #

Eq a => Eq (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Maybe

Methods

(==) :: Maybe a -> Maybe a -> Bool #

(/=) :: Maybe a -> Maybe a -> Bool #

Ord a => Ord (Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Maybe

Methods

compare :: Maybe a -> Maybe a -> Ordering #

(<) :: Maybe a -> Maybe a -> Bool #

(<=) :: Maybe a -> Maybe a -> Bool #

(>) :: Maybe a -> Maybe a -> Bool #

(>=) :: Maybe a -> Maybe a -> Bool #

max :: Maybe a -> Maybe a -> Maybe a #

min :: Maybe a -> Maybe a -> Maybe a #

SingI ('Nothing :: Maybe a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing 'Nothing

CanAddAsymmetric a b => CanAddAsymmetric (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type AddType (Maybe a) (Maybe b) Source #

Methods

add :: Maybe a -> Maybe b -> AddType (Maybe a) (Maybe b) Source #

CanSub a b => CanSub (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

Associated Types

type SubType (Maybe a) (Maybe b) Source #

Methods

sub :: Maybe a -> Maybe b -> SubType (Maybe a) (Maybe b) Source #

CanDiv a b => CanDiv (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

Associated Types

type DivType (Maybe a) (Maybe b) Source #

Methods

divide :: Maybe a -> Maybe b -> DivType (Maybe a) (Maybe b) Source #

HasEqAsymmetric a b => HasEqAsymmetric (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (Maybe a) (Maybe b) Source #

CanMinMaxAsymmetric a b => CanMinMaxAsymmetric (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

Associated Types

type MinMaxType (Maybe a) (Maybe b) Source #

Methods

min :: Maybe a -> Maybe b -> MinMaxType (Maybe a) (Maybe b) Source #

max :: Maybe a -> Maybe b -> MinMaxType (Maybe a) (Maybe b) Source #

CanMulAsymmetric a b => CanMulAsymmetric (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

Associated Types

type MulType (Maybe a) (Maybe b) Source #

Methods

mul :: Maybe a -> Maybe b -> MulType (Maybe a) (Maybe b) Source #

CanPow a b => CanPow (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

Associated Types

type PowType (Maybe a) (Maybe b) Source #

type PPowType (Maybe a) (Maybe b) Source #

Methods

pow :: Maybe a -> Maybe b -> PowType (Maybe a) (Maybe b) Source #

ppow :: Maybe a -> Maybe b -> PPowType (Maybe a) (Maybe b) Source #

SingI a2 => SingI ('Just a2 :: Maybe a1)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing ('Just a2)

(HasEqAsymmetric (Maybe Bool) b, CanBeErrors es, CanTestCertainly (EqCompareType (Maybe Bool) b)) => HasEqAsymmetric (Maybe Bool) (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (Maybe Bool) (CollectErrors es b) Source #

(HasEqAsymmetric a (Maybe Bool), CanBeErrors es, CanTestCertainly (EqCompareType a (Maybe Bool))) => HasEqAsymmetric (CollectErrors es a) (Maybe Bool) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

Associated Types

type EqCompareType (CollectErrors es a) (Maybe Bool) Source #

type Rep1 Maybe

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep1 Maybe = D1 ('MetaData "Maybe" "GHC.Maybe" "base" 'False) (C1 ('MetaCons "Nothing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Just" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) Par1))
type DemoteRep (Maybe a) 
Instance details

Defined in GHC.Generics

type DemoteRep (Maybe a) = Maybe (DemoteRep a)
type Rep (Maybe a)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep (Maybe a) = D1 ('MetaData "Maybe" "GHC.Maybe" "base" 'False) (C1 ('MetaCons "Nothing" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Just" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
data Sing (b :: Maybe a) 
Instance details

Defined in GHC.Generics

data Sing (b :: Maybe a) where
type AddType (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type AddType (Maybe a) (Maybe b) = Maybe (AddType a b)
type SubType (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.AddSub

type SubType (Maybe a) (Maybe b) = Maybe (SubType a b)
type DivType (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Div

type DivType (Maybe a) (Maybe b) = Maybe (DivType a b)
type EqCompareType (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type MinMaxType (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.MinMaxAbs

type MinMaxType (Maybe a) (Maybe b) = Maybe (MinMaxType a b)
type MulType (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Mul

type MulType (Maybe a) (Maybe b) = Maybe (MulType a b)
type PPowType (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PPowType (Maybe a) (Maybe b) = PowType (Maybe a) (Maybe b)
type PowType (Maybe a) (Maybe b) Source # 
Instance details

Defined in Numeric.MixedTypes.Power

type PowType (Maybe a) (Maybe b) = Maybe (PowType a b)
type EqCompareType (Maybe Bool) (CollectErrors es b) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

type EqCompareType (CollectErrors es a) (Maybe Bool) Source # 
Instance details

Defined in Numeric.MixedTypes.Eq

data Ordering #

Constructors

LT 
EQ 
GT 

Instances

Instances details
Arbitrary Ordering 
Instance details

Defined in Test.QuickCheck.Arbitrary

CoArbitrary Ordering 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Ordering -> Gen b -> Gen b #

Function Ordering 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Ordering -> b) -> Ordering :-> b #

Monoid Ordering

Since: base-2.1

Instance details

Defined in GHC.Base

Semigroup Ordering

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Bounded Ordering

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Ordering

Since: base-2.1

Instance details

Defined in GHC.Enum

Generic Ordering 
Instance details

Defined in GHC.Generics

Associated Types

type Rep Ordering :: Type -> Type #

Methods

from :: Ordering -> Rep Ordering x #

to :: Rep Ordering x -> Ordering #

Read Ordering

Since: base-2.1

Instance details

Defined in GHC.Read

Show Ordering

Since: base-2.1

Instance details

Defined in GHC.Show

Eq Ordering 
Instance details

Defined in GHC.Classes

Ord Ordering 
Instance details

Defined in GHC.Classes

Monad m => CoSerial m Ordering

Since: smallcheck-1.2.1

Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Ordering -> b) #

Monad m => Serial m Ordering

Since: smallcheck-1.2.1

Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m Ordering #

type Rep Ordering

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep Ordering = D1 ('MetaData "Ordering" "GHC.Types" "ghc-prim" 'False) (C1 ('MetaCons "LT" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EQ" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "GT" 'PrefixI 'False) (U1 :: Type -> Type)))

type Rational = Ratio Integer #

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

data IO a #

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

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

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

Instances

Instances details
MonadFail IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Methods

fail :: String -> IO a #

Alternative IO

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

empty :: IO a #

(<|>) :: IO a -> IO a -> IO a #

some :: IO a -> IO [a] #

many :: IO a -> IO [a] #

Applicative IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

pure :: a -> IO a #

(<*>) :: IO (a -> b) -> IO a -> IO b #

liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c #

(*>) :: IO a -> IO b -> IO b #

(<*) :: IO a -> IO b -> IO a #

Functor IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

fmap :: (a -> b) -> IO a -> IO b #

(<$) :: a -> IO b -> IO a #

Monad IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

(>>=) :: IO a -> (a -> IO b) -> IO b #

(>>) :: IO a -> IO b -> IO b #

return :: a -> IO a #

MonadPlus IO

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

mzero :: IO a #

mplus :: IO a -> IO a -> IO a #

Example Expectation 
Instance details

Defined in Test.Hspec.Core.Example

Associated Types

type Arg Expectation #

Quasi IO 
Instance details

Defined in Language.Haskell.TH.Syntax

Quote IO 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

newName :: String -> IO Name #

Monoid a => Monoid (IO a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Methods

mempty :: IO a #

mappend :: IO a -> IO a -> IO a #

mconcat :: [IO a] -> IO a #

Semigroup a => Semigroup (IO a)

Since: base-4.10.0.0

Instance details

Defined in GHC.Base

Methods

(<>) :: IO a -> IO a -> IO a #

sconcat :: NonEmpty (IO a) -> IO a #

stimes :: Integral b => b -> IO a -> IO a #

a ~ () => HPrintfType (IO a)

Since: base-4.7.0.0

Instance details

Defined in Text.Printf

Methods

hspr :: Handle -> String -> [UPrintf] -> IO a

a ~ () => PrintfType (IO a)

Since: base-4.7.0.0

Instance details

Defined in Text.Printf

Methods

spr :: String -> [UPrintf] -> IO a

Example (a -> Expectation) 
Instance details

Defined in Test.Hspec.Core.Example

Associated Types

type Arg (a -> Expectation) #

Methods

evaluateExample :: (a -> Expectation) -> Params -> (ActionWith (Arg (a -> Expectation)) -> IO ()) -> ProgressCallback -> IO Result #

type Arg Expectation 
Instance details

Defined in Test.Hspec.Core.Example

type Arg Expectation = ()
type Arg (Property IO) 
Instance details

Defined in Test.Hspec.SmallCheck

type Arg (Property IO) = ()
type Arg (a -> Expectation) 
Instance details

Defined in Test.Hspec.Core.Example

type Arg (a -> Expectation) = a

data Word #

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

Instances

Instances details
Arbitrary Word 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen Word #

shrink :: Word -> [Word] #

CoArbitrary Word 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Word -> Gen b -> Gen b #

Function Word 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Word -> b) -> Word :-> b #

Bounded Word

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Word

Since: base-2.1

Instance details

Defined in GHC.Enum

Methods

succ :: 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] #

Num Word

Since: base-2.1

Instance details

Defined in GHC.Num

Methods

(+) :: Word -> Word -> Word #

(-) :: Word -> Word -> Word #

(*) :: Word -> Word -> Word #

negate :: Word -> Word #

abs :: Word -> Word #

signum :: Word -> Word #

fromInteger :: Integer -> Word #

Read Word

Since: base-4.5.0.0

Instance details

Defined in GHC.Read

Integral Word

Since: base-2.1

Instance details

Defined in GHC.Real

Methods

quot :: 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) #

toInteger :: Word -> Integer #

Real Word

Since: base-2.1

Instance details

Defined in GHC.Real

Methods

toRational :: Word -> Rational #

Show Word

Since: base-2.1

Instance details

Defined in GHC.Show

Methods

showsPrec :: Int -> Word -> ShowS #

show :: Word -> String #

showList :: [Word] -> ShowS #

PrintfArg Word

Since: base-2.1

Instance details

Defined in Text.Printf

Eq Word 
Instance details

Defined in GHC.Classes

Methods

(==) :: Word -> Word -> Bool #

(/=) :: Word -> Word -> Bool #

Ord Word 
Instance details

Defined in GHC.Classes

Methods

compare :: Word -> Word -> Ordering #

(<) :: Word -> Word -> Bool #

(<=) :: Word -> Word -> Bool #

(>) :: Word -> Word -> Bool #

(>=) :: Word -> Word -> Bool #

max :: Word -> Word -> Word #

min :: Word -> Word -> Word #

Convertible Int16 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int32 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int64 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int8 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Rational Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word16 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word32 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word64 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word8 Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Integer Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Char Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Double Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Float Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Int Word Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Rational Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Word16 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Word32 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Word64 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Word8 Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Integer Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Char Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Double Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Float Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Convertible Word Int Source # 
Instance details

Defined in Data.Convertible.Instances.Num

Monad m => CoSerial m Word

Since: smallcheck-1.1.3

Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b -> Series m (Word -> b) #

Monad m => Serial m Word

Since: smallcheck-1.1.3

Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m Word #

Lift Word 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Word -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Word -> Code m Word #

Generic1 (URec Word :: k -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (URec Word) :: k -> Type #

Methods

from1 :: forall (a :: k0). URec Word a -> Rep1 (URec Word) a #

to1 :: forall (a :: k0). Rep1 (URec Word) a -> URec Word a #

Foldable (UWord :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => UWord m -> m #

foldMap :: Monoid m => (a -> m) -> UWord a -> m #

foldMap' :: Monoid m => (a -> m) -> UWord a -> m #

foldr :: (a -> b -> b) -> b -> UWord a -> b #

foldr' :: (a -> b -> b) -> b -> UWord a -> b #

foldl :: (b -> a -> b) -> b -> UWord a -> b #

foldl' :: (b -> a -> b) -> b -> UWord a -> b #

foldr1 :: (a -> a -> a) -> UWord a -> a #

foldl1 :: (a -> a -> a) -> UWord a -> a #

toList :: UWord a -> [a] #

null :: UWord a -> Bool #

length :: UWord a -> Int #

elem :: Eq a => a -> UWord a -> Bool #

maximum :: Ord a => UWord a -> a #

minimum :: Ord a => UWord a -> a #

sum :: Num a => UWord a -> a #

product :: Num a => UWord a -> a #

Traversable (UWord :: Type -> Type)

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a -> f b) -> UWord a -> f (UWord b) #

sequenceA :: Applicative f => UWord (f a) -> f (UWord a) #

mapM :: Monad m => (a -> m b) -> UWord a -> m (UWord b) #

sequence :: Monad m => UWord (m a) -> m (UWord a) #

Functor (URec Word :: TYPE LiftedRep -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

fmap :: (a -> b) -> URec Word a -> URec Word b #

(<$) :: a -> URec Word b -> URec Word a #

Generic (URec Word p) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (URec Word p) :: Type -> Type #

Methods

from :: URec Word p -> Rep (URec Word p) x #

to :: Rep (URec Word p) x -> URec Word p #

Show (URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

showsPrec :: Int -> URec Word p -> ShowS #

show :: URec Word p -> String #

showList :: [URec Word p] -> ShowS #

Eq (URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

(==) :: URec Word p -> URec Word p -> Bool #

(/=) :: URec Word p -> URec Word p -> Bool #

Ord (URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

compare :: URec Word p -> URec Word p -> Ordering #

(<) :: URec Word p -> URec Word p -> Bool #

(<=) :: URec Word p -> URec Word p -> Bool #

(>) :: URec Word p -> URec Word p -> Bool #

(>=) :: URec Word p -> URec Word p -> Bool #

max :: URec Word p -> URec Word p -> URec Word p #

min :: URec Word p -> URec Word p -> URec Word p #

data URec Word (p :: k)

Used for marking occurrences of Word#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Word (p :: k) = UWord {}
type Rep1 (URec Word :: k -> Type)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 (URec Word :: k -> Type) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UWord" 'PrefixI 'True) (S1 ('MetaSel ('Just "uWord#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UWord :: k -> Type)))
type Rep (URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep (URec Word p) = D1 ('MetaData "URec" "GHC.Generics" "base" 'False) (C1 ('MetaCons "UWord" 'PrefixI 'True) (S1 ('MetaSel ('Just "uWord#") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (UWord :: Type -> Type)))

data 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

Expand

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:

>>> let s = Left "foo" :: Either String Int
>>> s
Left "foo"
>>> let n = Right 3 :: Either String Int
>>> n
Right 3
>>> :type s
s :: Either String Int
>>> :type n
n :: Either String Int

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

>>> let s = Left "foo" :: Either String Int
>>> let n = Right 3 :: Either String Int
>>> fmap (*2) s
Left "foo"
>>> fmap (*2) n
Right 6

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

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

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

>>> :{
    let parseMultiple :: Either String Int
        parseMultiple = do
          x <- parseEither '1'
          y <- parseEither '2'
          return (x + y)
>>> :}
>>> parseMultiple
Right 3

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

>>> :{
    let parseMultiple :: Either String Int
        parseMultiple = do
          x <- parseEither 'm'
          y <- parseEither '2'
          return (x + y)
>>> :}
>>> parseMultiple
Left "parse error"

Constructors

Left a 
Right b 

Instances

Instances details
Arbitrary2 Either 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

liftArbitrary2 :: Gen a -> Gen b -> Gen (Either a b) #

liftShrink2 :: (a -> [a]) -> (b -> [b]) -> Either a b -> [Either a b] #

Eq2 Either

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Either a c -> Either b d -> Bool #

Ord2 Either

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Either a c -> Either b d -> Ordering #

Read2 Either

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Either a b) #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] #

Show2 Either

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Either a b -> ShowS #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Either a b] -> ShowS #

Generic1 (Either a :: Type -> Type) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep1 (Either a) :: k -> Type #

Methods

from1 :: forall (a0 :: k). Either a a0 -> Rep1 (Either a) a0 #

to1 :: forall (a0 :: k). Rep1 (Either a) a0 -> Either a a0 #

Monad m => Testable m (Either Reason Reason)

Works like the Bool instance, but includes an explanation of the result.

Left and Right correspond to test failure and success respectively.

Since: smallcheck-1.1

Instance details

Defined in Test.SmallCheck.Property

(CoSerial m a, CoSerial m b) => CoSerial m (Either a b) 
Instance details

Defined in Test.SmallCheck.Series

Methods

coseries :: Series m b0 -> Series m (Either a b -> b0) #

(Serial m a, Serial m b) => Serial m (Either a b) 
Instance details

Defined in Test.SmallCheck.Series

Methods

series :: Series m (Either a b) #

(Lift a, Lift b) => Lift (Either a b :: Type) 
Instance details

Defined in Language.Haskell.TH.Syntax

Methods

lift :: Quote m => Either a b -> m Exp #

liftTyped :: forall (m :: Type -> Type). Quote m => Either a b -> Code m (Either a b) #

Arbitrary a => Arbitrary1 (Either a) 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

liftArbitrary :: Gen a0 -> Gen (Either a a0) #

liftShrink :: (a0 -> [a0]) -> Either a a0 -> [Either a a0] #

Foldable (Either a)

Since: base-4.7.0.0

Instance details

Defined in Data.Foldable

Methods

fold :: Monoid m => Either a m -> m #

foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m #

foldMap' :: Monoid m => (a0 -> m) -> Either a a0 -> m #

foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b #

foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b #

foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b #

foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b #

foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 #

foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 #

toList :: Either a a0 -> [a0] #

null :: Either a a0 -> Bool #

length :: Either a a0 -> Int #

elem :: Eq a0 => a0 -> Either a a0 -> Bool #

maximum :: Ord a0 => Either a a0 -> a0 #

minimum :: Ord a0 => Either a a0 -> a0 #

sum :: Num a0 => Either a a0 -> a0 #

product :: Num a0 => Either a a0 -> a0 #

Eq a => Eq1 (Either a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftEq :: (a0 -> b -> Bool) -> Either a a0 -> Either a b -> Bool #

Ord a => Ord1 (Either a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftCompare :: (a0 -> b -> Ordering) -> Either a a0 -> Either a b -> Ordering #

Read a => Read1 (Either a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Either a a0) #

liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] #

liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) #

liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] #

Show a => Show1 (Either a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Classes

Methods

liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Either a a0 -> ShowS #

liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Either a a0] -> ShowS #

Traversable (Either a)

Since: base-4.7.0.0

Instance details

Defined in Data.Traversable

Methods

traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) #

sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) #

mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) #

sequence :: Monad m => Either a (m a0) -> m (Either a a0) #

Applicative (Either e)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

pure :: a -> Either e a #

(<*>) :: Either e (a -> b) -> Either e a -> Either e b #

liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c #

(*>) :: Either e a -> Either e b -> Either e b #

(<*) :: Either e a -> Either e b -> Either e a #

Functor (Either a)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

fmap :: (a0 -> b) -> Either a a0 -> Either a b #

(<$) :: a0 -> Either a b -> Either a a0 #

Monad (Either e)

Since: base-4.4.0.0

Instance details

Defined 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 #

(Arbitrary a, Arbitrary b) => Arbitrary (Either a b) 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

arbitrary :: Gen (Either a b) #

shrink :: Either a b -> [Either a b] #

(CoArbitrary a, CoArbitrary b) => CoArbitrary (Either a b) 
Instance details

Defined in Test.QuickCheck.Arbitrary

Methods

coarbitrary :: Either a b -> Gen b0 -> Gen b0 #

(Function a, Function b) => Function (Either a b) 
Instance details

Defined in Test.QuickCheck.Function

Methods

function :: (Either a b -> b0) -> Either a b :-> b0 #

Semigroup (Either a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Either

Methods

(<>) :: Either a b -> Either a b -> Either a b #

sconcat :: NonEmpty (Either a b) -> Either a b #

stimes :: Integral b0 => b0 -> Either a b -> Either a b #

Generic (Either a b) 
Instance details

Defined in GHC.Generics

Associated Types

type Rep (Either a b) :: Type -> Type #

Methods

from :: Either a b -> Rep (Either a b) x #

to :: Rep (Either a b) x -> Either a b #

(Read a, Read b) => Read (Either a b)

Since: base-3.0

Instance details

Defined in Data.Either

(Show a, Show b) => Show (Either a b)

Since: base-3.0

Instance details

Defined in Data.Either

Methods

showsPrec :: Int -> Either a b -> ShowS #

show :: Either a b -> String #

showList :: [Either a b] -> ShowS #

(Eq a, Eq b) => Eq (Either a b)

Since: base-2.1

Instance details

Defined in Data.Either

Methods

(==) :: Either a b -> Either a b -> Bool #

(/=) :: Either a b -> Either a b -> Bool #

(Ord a, Ord b) => Ord (Either a b)

Since: base-2.1

Instance details

Defined in Data.Either

Methods

compare :: Either a b -> Either a b -> Ordering #

(<) :: Either a b -> Either a b -> Bool #

(<=) :: Either a b -> Either a b -> Bool #

(>) :: Either a b -> Either a b -> Bool #

(>=) :: Either a b -> Either a b -> Bool #

max :: Either a b -> Either a b -> Either a b #

min :: Either a b -> Either a b -> Either a b #

type Rep1 (Either a :: Type -> Type)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

type Rep (Either a b)

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

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

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

The computation writeFile file str function writes the string str, to the file file.

readLn :: Read a => IO a #

The readLn function combines getLine and readIO.

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

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

putStrLn :: String -> IO () #

The same as putStr, but adds a newline character.

putStr :: String -> IO () #

Write a string to the standard output device (same as hPutStr stdout).

putChar :: Char -> IO () #

Write a character to the standard output device (same as hPutChar stdout).

interact :: (String -> String) -> IO () #

The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.

getLine :: IO String #

Read a line from the standard input device (same as hGetLine stdin).

getContents :: IO String #

The getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin).

getChar :: IO Char #

Read a character from the standard input device (same as hGetChar stdin).

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

main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])

ioError :: IOError -> IO a #

Raise an IOException in the IO monad.

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

type IOError = IOException #

The Haskell 2010 type for exceptions in the IO monad. Any I/O operation may raise an IOException instead of returning a result. For a more general type of exception, including also those that arise in pure code, see Exception.

In Haskell 2010, this is an opaque type.

userError :: String -> IOError #

Construct an IOException value with a string describing the error. The fail method of the IO instance of the Monad class raises a userError, thus:

instance Monad IO where
  ...
  fail s = ioError (userError s)

sequence_ :: (Foldable t, Monad m) => t (m a) -> m () #

Evaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see sequence.

sequence_ is just like sequenceA_, but specialised to monadic actions.

notElem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 #

notElem is the negation of elem.

Examples

Expand

Basic usage:

>>> 3 `notElem` []
True
>>> 3 `notElem` [1,2]
True
>>> 3 `notElem` [1,2,3,4,5]
False

For infinite structures, notElem terminates if the value exists at a finite distance from the left side of the structure:

>>> 3 `notElem` [1..]
False
>>> 3 `notElem` ([4..] ++ [3])
* Hangs forever *

mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see mapM.

mapM_ is just like traverse_, but specialised to monadic actions.

concatMap :: Foldable t => (a -> [b]) -> t a -> [b] #

Map a function over all the elements of a container and concatenate the resulting lists.

Examples

Expand

Basic usage:

>>> concatMap (take 3) [[1..], [10..], [100..], [1000..]]
[1,2,3,10,11,12,100,101,102,1000,1001,1002]
>>> concatMap (take 3) (Just [1..])
[1,2,3]

concat :: Foldable t => t [a] -> [a] #

The concatenation of all the elements of a container of lists.

Examples

Expand

Basic usage:

>>> concat (Just [1, 2, 3])
[1,2,3]
>>> concat (Left 42)
[]
>>> concat [[1, 2, 3], [4, 5], [6], []]
[1,2,3,4,5,6]

any :: Foldable t => (a -> Bool) -> t a -> Bool #

Determines whether any element of the structure satisfies the predicate.

Examples

Expand

Basic usage:

>>> any (> 3) []
False
>>> any (> 3) [1,2]
False
>>> any (> 3) [1,2,3,4,5]
True
>>> any (> 3) [1..]
True
>>> any (> 3) [0, -1..]
* Hangs forever *

all :: Foldable t => (a -> Bool) -> t a -> Bool #

Determines whether all elements of the structure satisfy the predicate.

Examples

Expand

Basic usage:

>>> all (> 3) []
True
>>> all (> 3) [1,2]
False
>>> all (> 3) [1,2,3,4,5]
False
>>> all (> 3) [1..]
False
>>> all (> 3) [4..]
* Hangs forever *

words :: String -> [String] #

words breaks a string up into a list of words, which were delimited by white space.

>>> words "Lorem ipsum\ndolor"
["Lorem","ipsum","dolor"]

unwords :: [String] -> String #

unwords is an inverse operation to words. It joins words with separating spaces.

>>> unwords ["Lorem", "ipsum", "dolor"]
"Lorem ipsum dolor"

unlines :: [String] -> String #

unlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each.

>>> unlines ["Hello", "World", "!"]
"Hello\nWorld\n!\n"

lines :: String -> [String] #

lines breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines.

Note that after splitting the string at newline characters, the last part of the string is considered a line even if it doesn't end with a newline. For example,

>>> lines ""
[]
>>> lines "\n"
[""]
>>> lines "one"
["one"]
>>> lines "one\n"
["one"]
>>> lines "one\n\n"
["one",""]
>>> lines "one\ntwo"
["one","two"]
>>> lines "one\ntwo\n"
["one","two"]

Thus lines s contains at least as many elements as newlines in s.

reads :: Read a => ReadS a #

equivalent to readsPrec with a precedence of 0.

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

>>> read "123" :: Int
123
>>> read "hello" :: Int
*** Exception: Prelude.read: no parse

either :: (a -> c) -> (b -> c) -> Either a b -> c #

Case analysis for the Either type. If the value is Left a, apply the first function to a; if it is Right b, apply the second function to b.

Examples

Expand

We create two values of type Either String Int, one using the Left constructor and another using the Right constructor. Then we apply "either" the length function (if we have a String) or the "times-two" function (if we have an Int):

>>> let s = Left "foo" :: Either String Int
>>> let n = Right 3 :: Either String Int
>>> either length (*2) s
3
>>> either length (*2) n
6

readParen :: Bool -> ReadS a -> ReadS a #

readParen True p parses what p parses, but surrounded with parentheses.

readParen False p parses what p parses, but optionally surrounded with parentheses.

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

type 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).

odd :: Integral a => a -> Bool #

lcm :: Integral a => a -> a -> a #

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

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

even :: Integral a => a -> Bool #

shows :: Show a => a -> ShowS #

equivalent to showsPrec with a precedence of 0.

showString :: String -> ShowS #

utility function converting a String to a show function that simply prepends the string unchanged.

showParen :: Bool -> ShowS -> ShowS #

utility function that surrounds the inner show function with parentheses when the Bool parameter is True.

showChar :: Char -> ShowS #

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

zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] #

The zipWith3 function takes a function which combines three elements, as well as three lists and returns a list of the function applied to corresponding elements, analogous to zipWith. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zipWith3 (,,) xs ys zs == zip3 xs ys zs
zipWith3 f [x1,x2,x3..] [y1,y2,y3..] [z1,z2,z3..] == [f x1 y1 z1, f x2 y2 z2, f x3 y3 z3..]

zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] #

\(\mathcal{O}(\min(m,n))\). zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function.

zipWith (,) xs ys == zip xs ys
zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]

For example, zipWith (+) is applied to two lists to produce the list of corresponding sums:

>>> zipWith (+) [1, 2, 3] [4, 5, 6]
[5,7,9]

zipWith is right-lazy:

>>> let f = undefined
>>> zipWith f [] undefined
[]

zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.

zip3 :: [a] -> [b] -> [c] -> [(a, b, c)] #

zip3 takes three lists and returns a list of triples, analogous to zip. It is capable of list fusion, but it is restricted to its first list argument and its resulting list.

unzip3 :: [(a, b, c)] -> ([a], [b], [c]) #

The unzip3 function takes a list of triples and returns three lists, analogous to unzip.

>>> unzip3 []
([],[],[])
>>> unzip3 [(1, 'a', True), (2, 'b', False)]
([1,2],"ab",[True,False])

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

unzip transforms a list of pairs into a list of first components and a list of second components.

>>> unzip []
([],[])
>>> unzip [(1, 'a'), (2, 'b')]
([1,2],"ab")

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

takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p.

>>> takeWhile (< 3) [1,2,3,4,1,2,3,4]
[1,2]
>>> takeWhile (< 9) [1,2,3]
[1,2,3]
>>> takeWhile (< 0) [1,2,3]
[]

tail :: [a] -> [a] #

\(\mathcal{O}(1)\). Extract the elements after the head of a list, which must be non-empty.

>>> tail [1, 2, 3]
[2,3]
>>> tail [1]
[]
>>> tail []
*** Exception: Prelude.tail: empty list

span :: (a -> Bool) -> [a] -> ([a], [a]) #

span, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that satisfy p and second element is the remainder of the list:

>>> span (< 3) [1,2,3,4,1,2,3,4]
([1,2],[3,4,1,2,3,4])
>>> span (< 9) [1,2,3]
([1,2,3],[])
>>> span (< 0) [1,2,3]
([],[1,2,3])

span p xs is equivalent to (takeWhile p xs, dropWhile p xs)

scanr1 :: (a -> a -> a) -> [a] -> [a] #

\(\mathcal{O}(n)\). scanr1 is a variant of scanr that has no starting value argument.

>>> scanr1 (+) [1..4]
[10,9,7,4]
>>> scanr1 (+) []
[]
>>> scanr1 (-) [1..4]
[-2,3,-1,4]
>>> scanr1 (&&) [True, False, True, True]
[False,False,True,True]
>>> scanr1 (||) [True, True, False, False]
[True,True,False,False]
>>> force $ scanr1 (+) [1..]
*** Exception: stack overflow

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

\(\mathcal{O}(n)\). scanr is the right-to-left dual of scanl. Note that the order of parameters on the accumulating function are reversed compared to scanl. Also note that

head (scanr f z xs) == foldr f z xs.
>>> scanr (+) 0 [1..4]
[10,9,7,4,0]
>>> scanr (+) 42 []
[42]
>>> scanr (-) 100 [1..4]
[98,-97,99,-96,100]
>>> scanr (\nextChar reversedString -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']
["abcdfoo","bcdfoo","cdfoo","dfoo","foo"]
>>> force $ scanr (+) 0 [1..]
*** Exception: stack overflow

scanl1 :: (a -> a -> a) -> [a] -> [a] #

\(\mathcal{O}(n)\). scanl1 is a variant of scanl that has no starting value argument:

scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
>>> scanl1 (+) [1..4]
[1,3,6,10]
>>> scanl1 (+) []
[]
>>> scanl1 (-) [1..4]
[1,-1,-4,-8]
>>> scanl1 (&&) [True, False, True, True]
[True,False,False,False]
>>> scanl1 (||) [False, False, True, True]
[False,False,True,True]
>>> scanl1 (+) [1..]
* Hangs forever *

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

\(\mathcal{O}(n)\). scanl is similar to foldl, but returns a list of successive reduced values from the left:

scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]

Note that

last (scanl f z xs) == foldl f z xs
>>> scanl (+) 0 [1..4]
[0,1,3,6,10]
>>> scanl (+) 42 []
[42]
>>> scanl (-) 100 [1..4]
[100,99,97,94,90]
>>> scanl (\reversedString nextChar -> nextChar : reversedString) "foo" ['a', 'b', 'c', 'd']
["foo","afoo","bafoo","cbafoo","dcbafoo"]
>>> scanl (+) 0 [1..]
* Hangs forever *

reverse :: [a] -> [a] #

reverse xs returns the elements of xs in reverse order. xs must be finite.

>>> reverse []
[]
>>> reverse [42]
[42]
>>> reverse [2,5,7]
[7,5,2]
>>> reverse [1..]
* Hangs forever *

repeat :: a -> [a] #

repeat x is an infinite list, with x the value of every element.

>>> take 20 $ repeat 17
[17,17,17,17,17,17,17,17,17...

lookup :: Eq a => a -> [(a, b)] -> Maybe b #

\(\mathcal{O}(n)\). lookup key assocs looks up a key in an association list.

>>> lookup 2 []
Nothing
>>> lookup 2 [(1, "first")]
Nothing
>>> lookup 2 [(1, "first"), (2, "second"), (3, "third")]
Just "second"

last :: [a] -> a #

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

>>> last [1, 2, 3]
3
>>> last [1..]
* Hangs forever *
>>> last []
*** Exception: Prelude.last: empty list

iterate :: (a -> a) -> a -> [a] #

iterate f x returns an infinite list of repeated applications of f to x:

iterate f x == [x, f x, f (f x), ...]

Note that iterate is lazy, potentially leading to thunk build-up if the consumer doesn't force each iterate. See iterate' for a strict variant of this function.

>>> take 10 $ iterate not True
[True,False,True,False...
>>> take 10 $ iterate (+3) 42
[42,45,48,51,54,57,60,63...

init :: [a] -> [a] #

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

>>> init [1, 2, 3]
[1,2]
>>> init [1]
[]
>>> init []
*** Exception: Prelude.init: empty list

head :: [a] -> a #

\(\mathcal{O}(1)\). Extract the first element of a list, which must be non-empty.

>>> head [1, 2, 3]
1
>>> head [1..]
1
>>> head []
*** Exception: Prelude.head: empty list

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

dropWhile p xs returns the suffix remaining after takeWhile p xs.

>>> dropWhile (< 3) [1,2,3,4,5,1,2,3]
[3,4,5,1,2,3]
>>> dropWhile (< 9) [1,2,3]
[]
>>> dropWhile (< 0) [1,2,3]
[1,2,3]

cycle :: [a] -> [a] #

cycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.

>>> cycle []
*** Exception: Prelude.cycle: empty list
>>> take 20 $ cycle [42]
[42,42,42,42,42,42,42,42,42,42...
>>> take 20 $ cycle [2, 5, 7]
[2,5,7,2,5,7,2,5,7,2,5,7...

break :: (a -> Bool) -> [a] -> ([a], [a]) #

break, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that do not satisfy p and second element is the remainder of the list:

>>> break (> 3) [1,2,3,4,1,2,3,4]
([1,2,3],[4,1,2,3,4])
>>> break (< 9) [1,2,3]
([],[1,2,3])
>>> break (> 9) [1,2,3]
([1,2,3],[])

break p is equivalent to span (not . p).

maybe :: b -> (a -> b) -> Maybe a -> b #

The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.

Examples

Expand

Basic usage:

>>> maybe False odd (Just 3)
True
>>> maybe False odd Nothing
False

Read an integer from a string using readMaybe. If we succeed, return twice the integer; that is, apply (*2) to it. If instead we fail to parse an integer, return 0 by default:

>>> import Text.Read ( readMaybe )
>>> maybe 0 (*2) (readMaybe "5")
10
>>> maybe 0 (*2) (readMaybe "")
0

Apply show to a Maybe Int. If we have Just n, we want to show the underlying Int n. But if we have Nothing, we return the empty string instead of (for example) "Nothing":

>>> maybe "" show (Just 5)
"5"
>>> maybe "" show Nothing
""

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 #

An infix synonym for fmap.

The name of this operator is an allusion to $. Note the similarities between their types:

 ($)  ::              (a -> b) ->   a ->   b
(<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas $ is function application, <$> is function application lifted over a Functor.

Examples

Expand

Convert from a Maybe Int to a Maybe String using show:

>>> show <$> Nothing
Nothing
>>> show <$> Just 3
Just "3"

Convert from an Either Int Int to an Either Int String using show:

>>> show <$> Left 17
Left 17
>>> show <$> Right 17
Right "17"

Double each element of a list:

>>> (*2) <$> [1,2,3]
[2,4,6]

Apply even to the second element of a pair:

>>> even <$> (2,2)
(2,True)

uncurry :: (a -> b -> c) -> (a, b) -> c #

uncurry converts a curried function to a function on pairs.

Examples

Expand
>>> uncurry (+) (1,2)
3
>>> uncurry ($) (show, 1)
"1"
>>> map (uncurry max) [(1,2), (3,4), (6,8)]
[2,4,8]

curry :: ((a, b) -> c) -> a -> b -> c #

curry converts an uncurried function to a curried function.

Examples

Expand
>>> curry fst 1 2
1

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

until :: (a -> Bool) -> (a -> a) -> a -> a #

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

id :: a -> a #

Identity function.

id x = x

flip :: (a -> b -> c) -> b -> a -> c #

flip f takes its (first) two arguments in the reverse order of f.

>>> flip (++) "hello" "world"
"worldhello"

const :: a -> b -> a #

const x is a unary function which evaluates to x for all inputs.

>>> const 42 "hello"
42
>>> map (const 42) [0..3]
[42,42,42,42]

asTypeOf :: a -> a -> a #

asTypeOf is a type-restricted version of const. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the second.

(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 #

Same as >>=, but with the arguments interchanged.

(.) :: (b -> c) -> (a -> b) -> a -> c infixr 9 #

Function composition.

($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b infixr 0 #

Strict (call-by-value) application operator. It takes a function and an argument, evaluates the argument to weak head normal form (WHNF), then calls the function with that value.

undefined :: forall (r :: RuntimeRep) (a :: TYPE r). 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.

errorWithoutStackTrace :: forall (r :: RuntimeRep) (a :: TYPE r). [Char] -> a #

A variant of error that does not produce a stack trace.

Since: base-4.9.0.0

error :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => [Char] -> a #

error stops execution and displays an error message.