protolude-0.3.0: A small prelude.
Safe Haskell Unsafe
Language Haskell2010

Protolude.Base

Synopsis

Documentation

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

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

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.

print :: Show a => a -> IO () Source #

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

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

general coercion from integral types

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

general coercion to fractional types

class Bounded a where Source #

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 .

Instances

Instances details
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

Bounded Int8

Since: base-2.1

Instance details

Defined in GHC.Int

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 Ordering

Since: base-2.1

Instance details

Defined in GHC.Enum

Bounded Word

Since: base-2.1

Instance details

Defined in GHC.Enum

Bounded Word8

Since: base-2.1

Instance details

Defined in GHC.Word

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

Since: base-2.1

Instance details

Defined in GHC.Enum

Bounded CDev
Instance details

Defined in System.Posix.Types

Bounded CIno
Instance details

Defined in System.Posix.Types

Bounded CMode
Instance details

Defined in System.Posix.Types

Bounded COff
Instance details

Defined in System.Posix.Types

Bounded CPid
Instance details

Defined in System.Posix.Types

Bounded CSsize
Instance details

Defined in System.Posix.Types

Bounded CGid
Instance details

Defined in System.Posix.Types

Bounded CNlink
Instance details

Defined in System.Posix.Types

Bounded CUid
Instance details

Defined in System.Posix.Types

Bounded CTcflag
Instance details

Defined in System.Posix.Types

Bounded CRLim
Instance details

Defined in System.Posix.Types

Bounded CBlkSize
Instance details

Defined in System.Posix.Types

Bounded CBlkCnt
Instance details

Defined in System.Posix.Types

Bounded CClockId
Instance details

Defined in System.Posix.Types

Bounded CFsBlkCnt
Instance details

Defined in System.Posix.Types

Bounded CFsFilCnt
Instance details

Defined in System.Posix.Types

Bounded CId
Instance details

Defined in System.Posix.Types

Bounded CKey
Instance details

Defined in System.Posix.Types

Bounded CSocklen
Instance details

Defined in System.Posix.Types

Bounded CNfds
Instance details

Defined in System.Posix.Types

Bounded Fd
Instance details

Defined in System.Posix.Types

Bounded All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Bounded Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Bounded Associativity

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 SourceStrictness

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 CChar
Instance details

Defined in Foreign.C.Types

Bounded CSChar
Instance details

Defined in Foreign.C.Types

Bounded CUChar
Instance details

Defined in Foreign.C.Types

Bounded CShort
Instance details

Defined in Foreign.C.Types

Bounded CUShort
Instance details

Defined in Foreign.C.Types

Bounded CInt
Instance details

Defined in Foreign.C.Types

Bounded CUInt
Instance details

Defined in Foreign.C.Types

Bounded CLong
Instance details

Defined in Foreign.C.Types

Bounded CULong
Instance details

Defined in Foreign.C.Types

Bounded CLLong
Instance details

Defined in Foreign.C.Types

Bounded CULLong
Instance details

Defined in Foreign.C.Types

Bounded CBool
Instance details

Defined in Foreign.C.Types

Bounded CPtrdiff
Instance details

Defined in Foreign.C.Types

Bounded CSize
Instance details

Defined in Foreign.C.Types

Bounded CWchar
Instance details

Defined in Foreign.C.Types

Bounded CSigAtomic
Instance details

Defined in Foreign.C.Types

Bounded CIntPtr
Instance details

Defined in Foreign.C.Types

Bounded CUIntPtr
Instance details

Defined in Foreign.C.Types

Bounded CIntMax
Instance details

Defined in Foreign.C.Types

Bounded CUIntMax
Instance details

Defined in Foreign.C.Types

Bounded WordPtr
Instance details

Defined in Foreign.Ptr

Bounded IntPtr
Instance details

Defined in Foreign.Ptr

Bounded GeneralCategory

Since: base-2.1

Instance details

Defined in GHC.Unicode

Bounded Leniency Source #
Instance details

Defined in Protolude.Conv

Bounded a => Bounded ( Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Bounded a => Bounded ( Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Bounded a => Bounded ( First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Bounded a => Bounded ( Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Bounded m => Bounded ( WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

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

Bounded a => Bounded ( Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Bounded a => Bounded ( Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Bounded a => Bounded ( Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

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

Since: base-2.1

Instance details

Defined in GHC.Enum

Bounded ( Proxy t)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

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

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

Bounded a => Bounded ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

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

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Coercible a b => Bounded ( Coercion a b)

Since: base-4.7.0.0

Instance details

Defined in Data.Type.Coercion

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

Since: base-4.7.0.0

Instance details

Defined in Data.Type.Equality

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

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

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

Since: base-4.10.0.0

Instance details

Defined in Data.Type.Equality

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

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

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

maxBound :: (a, b, c, d, e, f) Source #

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

maxBound :: (a, b, c, d, e, f, g) Source #

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

maxBound :: (a, b, c, d, e, f, g, h) Source #

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

maxBound :: (a, b, c, d, e, f, g, h, i) Source #

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

maxBound :: (a, b, c, d, e, f, g, h, i, j) Source #

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

maxBound :: (a, b, c, d, e, f, g, h, i, j, k) Source #

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

maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l) Source #

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

maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

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

maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

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

maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

class Enum a where Source #

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

the successor of a value. For numeric types, succ adds 1.

pred :: a -> a Source #

the predecessor of a value. For numeric types, pred subtracts 1.

toEnum :: Int -> a Source #

Convert from an Int .

fromEnum :: a -> Int Source #

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

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

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

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

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 Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Char

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Int

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Int8

Since: base-2.1

Instance details

Defined in GHC.Int

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

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Word

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Word8

Since: base-2.1

Instance details

Defined in GHC.Word

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

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum CDev
Instance details

Defined in System.Posix.Types

Enum CIno
Instance details

Defined in System.Posix.Types

Enum CMode
Instance details

Defined in System.Posix.Types

Enum COff
Instance details

Defined in System.Posix.Types

Enum CPid
Instance details

Defined in System.Posix.Types

Enum CSsize
Instance details

Defined in System.Posix.Types

Enum CGid
Instance details

Defined in System.Posix.Types

Enum CNlink
Instance details

Defined in System.Posix.Types

Enum CUid
Instance details

Defined in System.Posix.Types

Enum CCc
Instance details

Defined in System.Posix.Types

Enum CSpeed
Instance details

Defined in System.Posix.Types

Enum CTcflag
Instance details

Defined in System.Posix.Types

Enum CRLim
Instance details

Defined in System.Posix.Types

Enum CBlkSize
Instance details

Defined in System.Posix.Types

Enum CBlkCnt
Instance details

Defined in System.Posix.Types

Enum CClockId
Instance details

Defined in System.Posix.Types

Enum CFsBlkCnt
Instance details

Defined in System.Posix.Types

Enum CFsFilCnt
Instance details

Defined in System.Posix.Types

Enum CId
Instance details

Defined in System.Posix.Types

Enum CKey
Instance details

Defined in System.Posix.Types

Enum CSocklen
Instance details

Defined in System.Posix.Types

Enum CNfds
Instance details

Defined in System.Posix.Types

Enum Fd
Instance details

Defined in System.Posix.Types

Enum Associativity

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 SourceStrictness

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 CChar
Instance details

Defined in Foreign.C.Types

Enum CSChar
Instance details

Defined in Foreign.C.Types

Enum CUChar
Instance details

Defined in Foreign.C.Types

Enum CShort
Instance details

Defined in Foreign.C.Types

Enum CUShort
Instance details

Defined in Foreign.C.Types

Enum CInt
Instance details

Defined in Foreign.C.Types

Enum CUInt
Instance details

Defined in Foreign.C.Types

Enum CLong
Instance details

Defined in Foreign.C.Types

Enum CULong
Instance details

Defined in Foreign.C.Types

Enum CLLong
Instance details

Defined in Foreign.C.Types

Enum CULLong
Instance details

Defined in Foreign.C.Types

Enum CBool
Instance details

Defined in Foreign.C.Types

Enum CFloat
Instance details

Defined in Foreign.C.Types

Enum CDouble
Instance details

Defined in Foreign.C.Types

Enum CPtrdiff
Instance details

Defined in Foreign.C.Types

Enum CSize
Instance details

Defined in Foreign.C.Types

Enum CWchar
Instance details

Defined in Foreign.C.Types

Enum CSigAtomic
Instance details

Defined in Foreign.C.Types

Enum CClock
Instance details

Defined in Foreign.C.Types

Enum CTime
Instance details

Defined in Foreign.C.Types

Enum CUSeconds
Instance details

Defined in Foreign.C.Types

Enum CSUSeconds
Instance details

Defined in Foreign.C.Types

Enum CIntPtr
Instance details

Defined in Foreign.C.Types

Enum CUIntPtr
Instance details

Defined in Foreign.C.Types

Enum CIntMax
Instance details

Defined in Foreign.C.Types

Enum CUIntMax
Instance details

Defined in Foreign.C.Types

Enum WordPtr
Instance details

Defined in Foreign.Ptr

Enum IntPtr
Instance details

Defined in Foreign.Ptr

Enum IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

Enum GeneralCategory

Since: base-2.1

Instance details

Defined in GHC.Unicode

Enum Leniency Source #
Instance details

Defined in Protolude.Conv

Integral a => Enum ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Enum a => Enum ( Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Enum a => Enum ( Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Enum a => Enum ( First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Enum a => Enum ( Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Enum a => Enum ( WrappedMonoid a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Enum a => Enum ( Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Enum a => Enum ( Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Enum ( Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

Enum a => Enum ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

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

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Enum (f a) => Enum ( Alt f a)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Coercible a b => Enum ( Coercion a b)

Since: base-4.7.0.0

Instance details

Defined in Data.Type.Coercion

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

Since: base-4.7.0.0

Instance details

Defined in Data.Type.Equality

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

Since: base-4.10.0.0

Instance details

Defined in Data.Type.Equality

class Fractional a => Floating a where Source #

Trigonometric and hyperbolic functions and related functions.

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

  • exp (a + b) = exp a * exp b
  • exp (fromInteger 0) = fromInteger 1

Methods

pi :: a Source #

exp :: a -> a Source #

log :: a -> a Source #

sqrt :: a -> a Source #

(**) :: a -> a -> a infixr 8 Source #

logBase :: a -> a -> a Source #

sin :: a -> a Source #

cos :: a -> a Source #

tan :: a -> a Source #

asin :: a -> a Source #

acos :: a -> a Source #

atan :: a -> a Source #

sinh :: a -> a Source #

cosh :: a -> a Source #

tanh :: a -> a Source #

asinh :: a -> a Source #

acosh :: a -> a Source #

atanh :: a -> a Source #

log1p :: a -> a Source #

log1p x computes log (1 + x) , but provides more precise results for small (absolute) values of x if possible.

Since: base-4.9.0.0

expm1 :: a -> a Source #

expm1 x computes exp x - 1 , but provides more precise results for small (absolute) values of x if possible.

Since: base-4.9.0.0

log1pexp :: a -> a Source #

log1pexp x computes log (1 + exp x) , but provides more precise results if possible.

Examples:

Since: base-4.9.0.0

log1mexp :: a -> a Source #

log1mexp x computes log (1 - exp x) , but provides more precise results if possible.

Examples:

Since: base-4.9.0.0

Instances

Instances details
Floating Double

Since: base-2.1

Instance details

Defined in GHC.Float

Floating Float

Since: base-2.1

Instance details

Defined in GHC.Float

Floating CFloat
Instance details

Defined in Foreign.C.Types

Floating CDouble
Instance details

Defined in Foreign.C.Types

RealFloat a => Floating ( Complex a)

Since: base-2.1

Instance details

Defined in Data.Complex

Floating a => Floating ( Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Floating a => Floating ( Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Floating a => Floating ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

class Num a => Fractional a where Source #

Fractional numbers, supporting real division.

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

recip gives the multiplicative inverse
x * recip x = recip x * x = fromInteger 1

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

Minimal complete definition

fromRational , ( recip | (/) )

Methods

(/) :: a -> a -> a infixl 7 Source #

Fractional division.

recip :: a -> a Source #

Reciprocal fraction.

fromRational :: Rational -> a Source #

Conversion from a Rational (that is Ratio Integer ). A floating literal stands for an application of fromRational to a value of type Rational , so such literals have type ( Fractional a) => a .

Instances

Instances details
Fractional CFloat
Instance details

Defined in Foreign.C.Types

Fractional CDouble
Instance details

Defined in Foreign.C.Types

Integral a => Fractional ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

RealFloat a => Fractional ( Complex a)

Since: base-2.1

Instance details

Defined in Data.Complex

Fractional a => Fractional ( Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Fractional a => Fractional ( Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Fractional a => Fractional ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

class ( Real a, Enum a) => Integral a where Source #

Integral numbers, supporting integer division.

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

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

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

Minimal complete definition

quotRem , toInteger

Methods

quot :: a -> a -> a infixl 7 Source #

integer division truncated toward zero

rem :: a -> a -> a infixl 7 Source #

integer remainder, satisfying

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

div :: a -> a -> a infixl 7 Source #

integer division truncated toward negative infinity

mod :: a -> a -> a infixl 7 Source #

integer modulus, satisfying

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

quotRem :: a -> a -> (a, a) Source #

simultaneous quot and rem

divMod :: a -> a -> (a, a) Source #

simultaneous div and mod

toInteger :: a -> Integer Source #

conversion to Integer

Instances

Instances details
Integral Int

Since: base-2.0.1

Instance details

Defined in GHC.Real

Integral Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Integral Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Integral Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Integral Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Integral Integer

Since: base-2.0.1

Instance details

Defined in GHC.Real

Integral Natural

Since: base-4.8.0.0

Instance details

Defined in GHC.Real

Integral Word

Since: base-2.1

Instance details

Defined in GHC.Real

Integral Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Integral Word16

Since: base-2.1

Instance details

Defined in GHC.Word

Integral Word32

Since: base-2.1

Instance details

Defined in GHC.Word

Integral Word64

Since: base-2.1

Instance details

Defined in GHC.Word

Integral CDev
Instance details

Defined in System.Posix.Types

Integral CIno
Instance details

Defined in System.Posix.Types

Integral CMode
Instance details

Defined in System.Posix.Types

Integral COff
Instance details

Defined in System.Posix.Types

Integral CPid
Instance details

Defined in System.Posix.Types

Integral CSsize
Instance details

Defined in System.Posix.Types

Integral CGid
Instance details

Defined in System.Posix.Types

Integral CNlink
Instance details

Defined in System.Posix.Types

Integral CUid
Instance details

Defined in System.Posix.Types

Integral CTcflag
Instance details

Defined in System.Posix.Types

Integral CRLim
Instance details

Defined in System.Posix.Types

Integral CBlkSize
Instance details

Defined in System.Posix.Types

Integral CBlkCnt
Instance details

Defined in System.Posix.Types

Integral CClockId
Instance details

Defined in System.Posix.Types

Integral CFsBlkCnt
Instance details

Defined in System.Posix.Types

Integral CFsFilCnt
Instance details

Defined in System.Posix.Types

Integral CId
Instance details

Defined in System.Posix.Types

Integral CKey
Instance details

Defined in System.Posix.Types

Integral CSocklen
Instance details

Defined in System.Posix.Types

Integral CNfds
Instance details

Defined in System.Posix.Types

Integral Fd
Instance details

Defined in System.Posix.Types

Integral CChar
Instance details

Defined in Foreign.C.Types

Integral CSChar
Instance details

Defined in Foreign.C.Types

Integral CUChar
Instance details

Defined in Foreign.C.Types

Integral CShort
Instance details

Defined in Foreign.C.Types

Integral CUShort
Instance details

Defined in Foreign.C.Types

Integral CInt
Instance details

Defined in Foreign.C.Types

Integral CUInt
Instance details

Defined in Foreign.C.Types

Integral CLong
Instance details

Defined in Foreign.C.Types

Integral CULong
Instance details

Defined in Foreign.C.Types

Integral CLLong
Instance details

Defined in Foreign.C.Types

Integral CULLong
Instance details

Defined in Foreign.C.Types

Integral CBool
Instance details

Defined in Foreign.C.Types

Integral CPtrdiff
Instance details

Defined in Foreign.C.Types

Integral CSize
Instance details

Defined in Foreign.C.Types

Integral CWchar
Instance details

Defined in Foreign.C.Types

Integral CSigAtomic
Instance details

Defined in Foreign.C.Types

Integral CIntPtr
Instance details

Defined in Foreign.C.Types

Integral CUIntPtr
Instance details

Defined in Foreign.C.Types

Integral CIntMax
Instance details

Defined in Foreign.C.Types

Integral CUIntMax
Instance details

Defined in Foreign.C.Types

Integral WordPtr
Instance details

Defined in Foreign.Ptr

Integral IntPtr
Instance details

Defined in Foreign.Ptr

Integral a => Integral ( Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Integral a => Integral ( Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Integral a => Integral ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

class Num a where Source #

Basic numeric class.

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

Associativity of ( + )
(x + y) + z = x + (y + z)
Commutativity of ( + )
x + y = y + x
fromInteger 0 is the additive identity
x + fromInteger 0 = x
negate gives the additive inverse
x + negate x = fromInteger 0
Associativity of ( * )
(x * y) * z = x * (y * z)
fromInteger 1 is the multiplicative identity
x * fromInteger 1 = x and fromInteger 1 * x = x
Distributivity of ( * ) with respect to ( + )
a * (b + c) = (a * b) + (a * c) and (b + c) * a = (b * a) + (c * a)

Note that it isn't customarily expected that a type instance of both Num and Ord implement an ordered ring. Indeed, in base only Integer and Rational do.

Minimal complete definition

(+) , (*) , abs , signum , fromInteger , ( negate | (-) )

Methods

(+) :: a -> a -> a infixl 6 Source #

(-) :: a -> a -> a infixl 6 Source #

(*) :: a -> a -> a infixl 7 Source #

negate :: a -> a Source #

Unary negation.

abs :: a -> a Source #

Absolute value.

signum :: a -> a Source #

Sign of a number. The functions abs and signum should satisfy the law:

abs x * signum x == x

For real numbers, the signum is either -1 (negative), 0 (zero) or 1 (positive).

fromInteger :: Integer -> a Source #

Conversion from an Integer . An integer literal represents the application of the function fromInteger to the appropriate value of type Integer , so such literals have type ( Num a) => a .

Instances

Instances details
Num Int

Since: base-2.1

Instance details

Defined in GHC.Num

Num Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Num Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Num Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Num Int64

Since: base-2.1

Instance details

Defined in GHC.Int

Num Integer

Since: base-2.1

Instance details

Defined in GHC.Num

Num Natural

Note that Natural 's Num instance isn't a ring: no element but 0 has an additive inverse. It is a semiring though.

Since: base-4.8.0.0

Instance details

Defined in GHC.Num

Num Word

Since: base-2.1

Instance details

Defined in GHC.Num

Num Word8

Since: base-2.1

Instance details

Defined in GHC.Word

Num Word16

Since: base-2.1

Instance details

Defined in GHC.Word

Num Word32

Since: base-2.1

Instance details

Defined in GHC.Word

Num Word64

Since: base-2.1

Instance details

Defined in GHC.Word

Num CDev
Instance details

Defined in System.Posix.Types

Num CIno
Instance details

Defined in System.Posix.Types

Num CMode
Instance details

Defined in System.Posix.Types

Num COff
Instance details

Defined in System.Posix.Types

Num CPid
Instance details

Defined in System.Posix.Types

Num CSsize
Instance details

Defined in System.Posix.Types

Num CGid
Instance details

Defined in System.Posix.Types

Num CNlink
Instance details

Defined in System.Posix.Types

Num CUid
Instance details

Defined in System.Posix.Types

Num CCc
Instance details

Defined in System.Posix.Types

Num CSpeed
Instance details

Defined in System.Posix.Types

Num CTcflag
Instance details

Defined in System.Posix.Types

Num CRLim
Instance details

Defined in System.Posix.Types

Num CBlkSize
Instance details

Defined in System.Posix.Types

Num CBlkCnt
Instance details

Defined in System.Posix.Types

Num CClockId
Instance details

Defined in System.Posix.Types

Num CFsBlkCnt
Instance details

Defined in System.Posix.Types

Num CFsFilCnt
Instance details

Defined in System.Posix.Types

Num CId
Instance details

Defined in System.Posix.Types

Num CKey
Instance details

Defined in System.Posix.Types

Num CSocklen
Instance details

Defined in System.Posix.Types

Num CNfds
Instance details

Defined in System.Posix.Types

Num Fd
Instance details

Defined in System.Posix.Types

Num CChar
Instance details

Defined in Foreign.C.Types

Num CSChar
Instance details

Defined in Foreign.C.Types

Num CUChar
Instance details

Defined in Foreign.C.Types

Num CShort
Instance details

Defined in Foreign.C.Types

Num CUShort
Instance details

Defined in Foreign.C.Types

Num CInt
Instance details

Defined in Foreign.C.Types

Num CUInt
Instance details

Defined in Foreign.C.Types

Num CLong
Instance details

Defined in Foreign.C.Types

Num CULong
Instance details

Defined in Foreign.C.Types

Num CLLong
Instance details

Defined in Foreign.C.Types

Num CULLong
Instance details

Defined in Foreign.C.Types

Num CBool
Instance details

Defined in Foreign.C.Types

Num CFloat
Instance details

Defined in Foreign.C.Types

Num CDouble
Instance details

Defined in Foreign.C.Types

Num CPtrdiff
Instance details

Defined in Foreign.C.Types

Num CSize
Instance details

Defined in Foreign.C.Types

Num CWchar
Instance details

Defined in Foreign.C.Types

Num CSigAtomic
Instance details

Defined in Foreign.C.Types

Num CClock
Instance details

Defined in Foreign.C.Types

Num CTime
Instance details

Defined in Foreign.C.Types

Num CUSeconds
Instance details

Defined in Foreign.C.Types

Num CSUSeconds
Instance details

Defined in Foreign.C.Types

Num CIntPtr
Instance details

Defined in Foreign.C.Types

Num CUIntPtr
Instance details

Defined in Foreign.C.Types

Num CIntMax
Instance details

Defined in Foreign.C.Types

Num CUIntMax
Instance details

Defined in Foreign.C.Types

Num WordPtr
Instance details

Defined in Foreign.Ptr

Num IntPtr
Instance details

Defined in Foreign.Ptr

Num CodePoint
Instance details

Defined in Data.Text.Encoding

Methods

(+) :: CodePoint -> CodePoint -> CodePoint Source #

(-) :: CodePoint -> CodePoint -> CodePoint Source #

(*) :: CodePoint -> CodePoint -> CodePoint Source #

negate :: CodePoint -> CodePoint Source #

abs :: CodePoint -> CodePoint Source #

signum :: CodePoint -> CodePoint Source #

fromInteger :: Integer -> CodePoint Source #

Num DecoderState
Instance details

Defined in Data.Text.Encoding

Methods

(+) :: DecoderState -> DecoderState -> DecoderState Source #

(-) :: DecoderState -> DecoderState -> DecoderState Source #

(*) :: DecoderState -> DecoderState -> DecoderState Source #

negate :: DecoderState -> DecoderState Source #

abs :: DecoderState -> DecoderState Source #

signum :: DecoderState -> DecoderState Source #

fromInteger :: Integer -> DecoderState Source #

Integral a => Num ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

RealFloat a => Num ( Complex a)

Since: base-2.1

Instance details

Defined in Data.Complex

Num a => Num ( Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Num a => Num ( Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Num a => Num ( Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Num a => Num ( Sum a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Num a => Num ( Product a)

Since: base-4.7.0.0

Instance details

Defined in Data.Semigroup.Internal

Num a => Num ( Down a)

Since: base-4.11.0.0

Instance details

Defined in Data.Ord

Num a => Num ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

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

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

Num (f a) => Num ( Alt f a)

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

class ( Num a, Ord a) => Real a where Source #

Methods

toRational :: a -> Rational Source #

the rational equivalent of its real argument with full precision

Instances

Instances details
Real Int

Since: base-2.0.1

Instance details

Defined in GHC.Real

Real Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Real Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Real Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Real Int64

Since: base-2.1

Instance details

Defined in GHC.Int

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 Word

Since: base-2.1

Instance details

Defined in GHC.Real

Real Word8

Since: base-2.1

Instance details

Defined in GHC.Word

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 CDev
Instance details

Defined in System.Posix.Types

Real CIno
Instance details

Defined in System.Posix.Types

Real CMode
Instance details

Defined in System.Posix.Types

Real COff
Instance details

Defined in System.Posix.Types

Real CPid
Instance details

Defined in System.Posix.Types

Real CSsize
Instance details

Defined in System.Posix.Types

Real CGid
Instance details

Defined in System.Posix.Types

Real CNlink
Instance details

Defined in System.Posix.Types

Real CUid
Instance details

Defined in System.Posix.Types

Real CCc
Instance details

Defined in System.Posix.Types

Real CSpeed
Instance details

Defined in System.Posix.Types

Real CTcflag
Instance details

Defined in System.Posix.Types

Real CRLim
Instance details

Defined in System.Posix.Types

Real CBlkSize
Instance details

Defined in System.Posix.Types

Real CBlkCnt
Instance details

Defined in System.Posix.Types

Real CClockId
Instance details

Defined in System.Posix.Types

Real CFsBlkCnt
Instance details

Defined in System.Posix.Types

Real CFsFilCnt
Instance details

Defined in System.Posix.Types

Real CId
Instance details

Defined in System.Posix.Types

Real CKey
Instance details

Defined in System.Posix.Types

Real CSocklen
Instance details

Defined in System.Posix.Types

Real CNfds
Instance details

Defined in System.Posix.Types

Real Fd
Instance details

Defined in System.Posix.Types

Real CChar
Instance details

Defined in Foreign.C.Types

Real CSChar
Instance details

Defined in Foreign.C.Types

Real CUChar
Instance details

Defined in Foreign.C.Types

Real CShort
Instance details

Defined in Foreign.C.Types

Real CUShort
Instance details

Defined in Foreign.C.Types

Real CInt
Instance details

Defined in Foreign.C.Types

Real CUInt
Instance details

Defined in Foreign.C.Types

Real CLong
Instance details

Defined in Foreign.C.Types

Real CULong
Instance details

Defined in Foreign.C.Types

Real CLLong
Instance details

Defined in Foreign.C.Types

Real CULLong
Instance details

Defined in Foreign.C.Types

Real CBool
Instance details

Defined in Foreign.C.Types

Real CFloat
Instance details

Defined in Foreign.C.Types

Real CDouble
Instance details

Defined in Foreign.C.Types

Real CPtrdiff
Instance details

Defined in Foreign.C.Types

Real CSize
Instance details

Defined in Foreign.C.Types

Real CWchar
Instance details

Defined in Foreign.C.Types

Real CSigAtomic
Instance details

Defined in Foreign.C.Types

Real CClock
Instance details

Defined in Foreign.C.Types

Real CTime
Instance details

Defined in Foreign.C.Types

Real CUSeconds
Instance details

Defined in Foreign.C.Types

Real CSUSeconds
Instance details

Defined in Foreign.C.Types

Real CIntPtr
Instance details

Defined in Foreign.C.Types

Real CUIntPtr
Instance details

Defined in Foreign.C.Types

Real CIntMax
Instance details

Defined in Foreign.C.Types

Real CUIntMax
Instance details

Defined in Foreign.C.Types

Real WordPtr
Instance details

Defined in Foreign.Ptr

Real IntPtr
Instance details

Defined in Foreign.Ptr

Integral a => Real ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Real a => Real ( Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

Real a => Real ( Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

Real a => Real ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

class ( RealFrac a, Floating a) => RealFloat a where Source #

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

Methods

floatRadix :: a -> Integer Source #

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

floatDigits :: a -> Int Source #

a constant function, returning the number of digits of floatRadix in the significand

floatRange :: a -> ( Int , Int ) Source #

a constant function, returning the lowest and highest values the exponent may assume

decodeFloat :: a -> ( Integer , Int ) Source #

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

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

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

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

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

isNaN :: a -> Bool Source #

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

isInfinite :: a -> Bool Source #

True if the argument is an IEEE infinity or negative infinity

isDenormalized :: a -> Bool Source #

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

isNegativeZero :: a -> Bool Source #

True if the argument is an IEEE negative zero

isIEEE :: a -> Bool Source #

True if the argument is an IEEE floating point number

atan2 :: a -> a -> a Source #

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 Double

Since: base-2.1

Instance details

Defined in GHC.Float

RealFloat Float

Since: base-2.1

Instance details

Defined in GHC.Float

RealFloat CFloat
Instance details

Defined in Foreign.C.Types

RealFloat CDouble
Instance details

Defined in Foreign.C.Types

RealFloat a => RealFloat ( Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

RealFloat a => RealFloat ( Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

RealFloat a => RealFloat ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

class ( Real a, Fractional a) => RealFrac a where Source #

Extracting components of fractions.

Minimal complete definition

properFraction

Methods

properFraction :: Integral b => a -> (b, a) Source #

The function properFraction takes a real fractional number x and returns a pair (n,f) such that x = n+f , and:

  • n is an integral number with the same sign as x ; and
  • f is a fraction with the same type and sign as x , and with absolute value less than 1 .

The default definitions of the ceiling , floor , truncate and round functions are in terms of properFraction .

truncate :: Integral b => a -> b Source #

truncate x returns the integer nearest x between zero and x

round :: Integral b => a -> b Source #

round x returns the nearest integer to x ; the even integer if x is equidistant between two integers

ceiling :: Integral b => a -> b Source #

ceiling x returns the least integer not less than x

floor :: Integral b => a -> b Source #

floor x returns the greatest integer not greater than x

Instances

Instances details
RealFrac CFloat
Instance details

Defined in Foreign.C.Types

RealFrac CDouble
Instance details

Defined in Foreign.C.Types

Integral a => RealFrac ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

RealFrac a => RealFrac ( Identity a)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Identity

RealFrac a => RealFrac ( Down a)

Since: base-4.14.0.0

Instance details

Defined in Data.Ord

RealFrac a => RealFrac ( Const a b)

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Const

class Show a where Source #

Conversion of values to readable String s.

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

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

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

showList :: [a] -> ShowS Source #

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 Bool

Since: base-2.1

Instance details

Defined in GHC.Show

Show Char

Since: base-2.1

Instance details

Defined in GHC.Show

Show Int

Since: base-2.1

Instance details

Defined in GHC.Show

Show Int8

Since: base-2.1

Instance details

Defined in GHC.Int

Show Int16

Since: base-2.1

Instance details

Defined in GHC.Int

Show Int32

Since: base-2.1

Instance details

Defined in GHC.Int

Show Int64

Since: base-2.1

Instance details

Defined in GHC.Int

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 Ordering

Since: base-2.1

Instance details

Defined in GHC.Show

Show Word

Since: base-2.1

Instance details

Defined in GHC.Show

Show Word8

Since: base-2.1

Instance details

Defined in GHC.Word

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

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

Show SomeTypeRep

Since: base-4.10.0.0

Instance details

Defined in Data.Typeable.Internal

Show ()

Since: base-2.1

Instance details

Defined in GHC.Show

Show TyCon

Since: base-2.1

Instance details

Defined in GHC.Show

Show Module

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

Show TrName

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

Show KindRep
Instance details

Defined in GHC.Show

Show TypeLitSort

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Show Handle

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

Show ThreadId

Since: base-4.2.0.0

Instance details

Defined in GHC.Conc.Sync

Show AsyncCancelled
Instance details

Defined in Control.Concurrent.Async

Show ExceptionInLinkedThread
Instance details

Defined in Control.Concurrent.Async

Show Void

Since: base-4.8.0.0

Instance details

Defined in Data.Void

Show StaticPtrInfo

Since: base-4.8.0.0

Instance details

Defined in GHC.StaticPtr

Show PatternMatchFail

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Show RecSelError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Show RecConError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Show RecUpdError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Show NoMethodError

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Show TypeError

Since: base-4.9.0.0

Instance details

Defined in Control.Exception.Base

Show NonTermination

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Show NestedAtomically

Since: base-4.0

Instance details

Defined in Control.Exception.Base

Show BlockReason

Since: base-4.3.0.0

Instance details

Defined in GHC.Conc.Sync

Show ThreadStatus

Since: base-4.3.0.0

Instance details

Defined in GHC.Conc.Sync

Show CDev
Instance details

Defined in System.Posix.Types

Show CIno
Instance details

Defined in System.Posix.Types

Show CMode
Instance details

Defined in System.Posix.Types

Show COff
Instance details

Defined in System.Posix.Types

Show CPid
Instance details

Defined in System.Posix.Types

Show CSsize
Instance details

Defined in System.Posix.Types

Show CGid
Instance details

Defined in System.Posix.Types

Show CNlink
Instance details

Defined in System.Posix.Types

Show CUid
Instance details

Defined in System.Posix.Types

Show CCc
Instance details

Defined in System.Posix.Types

Show CSpeed
Instance details

Defined in System.Posix.Types

Show CTcflag
Instance details

Defined in System.Posix.Types

Show CRLim
Instance details

Defined in System.Posix.Types

Show CBlkSize
Instance details

Defined in System.Posix.Types

Show CBlkCnt
Instance details

Defined in System.Posix.Types

Show CClockId
Instance details

Defined in System.Posix.Types

Show CFsBlkCnt
Instance details

Defined in System.Posix.Types

Show CFsFilCnt
Instance details

Defined in System.Posix.Types

Show CId
Instance details

Defined in System.Posix.Types

Show CKey
Instance details

Defined in System.Posix.Types

Show CSocklen
Instance details

Defined in System.Posix.Types

Show CNfds
Instance details

Defined in System.Posix.Types

Show Fd
Instance details

Defined in System.Posix.Types

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 Deadlock

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show AllocationLimitExceeded

Since: base-4.7.1.0

Instance details

Defined in GHC.IO.Exception

Show CompactionFailed

Since: base-4.10.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 SomeAsyncException

Since: base-4.7.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 ArrayException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show FixIOException

Since: base-4.11.0.0

Instance details

Defined in GHC.IO.Exception

Show ExitCode
Instance details

Defined in GHC.IO.Exception

Show IOErrorType

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show HandleType

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Handle.Types

Show BufferMode

Since: base-4.2.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 MaskingState

Since: base-4.3.0.0

Instance details

Defined in GHC.IO

Show IOException

Since: base-4.1.0.0

Instance details

Defined in GHC.IO.Exception

Show ErrorCall

Since: base-4.0.0.0

Instance details

Defined in GHC.Exception

Show ArithException

Since: base-4.0.0.0

Instance details

Defined in GHC.Exception.Type

Show All

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show Any

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show Fixity

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Show Associativity

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Show SourceUnpackedness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show SourceStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show DecidedStrictness

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show SomeSymbol

Since: base-4.7.0.0

Instance details

Defined in GHC.TypeLits

Show SomeNat

Since: base-4.7.0.0

Instance details

Defined in GHC.TypeNats

Show CChar
Instance details

Defined in Foreign.C.Types

Show CSChar
Instance details

Defined in Foreign.C.Types

Show CUChar
Instance details

Defined in Foreign.C.Types

Show CShort
Instance details

Defined in Foreign.C.Types

Show CUShort
Instance details

Defined in Foreign.C.Types

Show CInt
Instance details

Defined in Foreign.C.Types

Show CUInt
Instance details

Defined in Foreign.C.Types

Show CLong
Instance details

Defined in Foreign.C.Types

Show CULong
Instance details

Defined in Foreign.C.Types

Show CLLong
Instance details

Defined in Foreign.C.Types

Show CULLong
Instance details

Defined in Foreign.C.Types

Show CBool
Instance details

Defined in Foreign.C.Types

Show CFloat
Instance details

Defined in Foreign.C.Types

Show CDouble
Instance details

Defined in Foreign.C.Types

Show CPtrdiff
Instance details

Defined in Foreign.C.Types

Show CSize
Instance details

Defined in Foreign.C.Types

Show CWchar
Instance details

Defined in Foreign.C.Types

Show CSigAtomic
Instance details

Defined in Foreign.C.Types

Show CClock
Instance details

Defined in Foreign.C.Types

Show CTime
Instance details

Defined in Foreign.C.Types

Show CUSeconds
Instance details

Defined in Foreign.C.Types

Show CSUSeconds
Instance details

Defined in Foreign.C.Types

Show CIntPtr
Instance details

Defined in Foreign.C.Types

Show CUIntPtr
Instance details

Defined in Foreign.C.Types

Show CIntMax
Instance details

Defined in Foreign.C.Types

Show CUIntMax
Instance details

Defined in Foreign.C.Types

Show WordPtr
Instance details

Defined in Foreign.Ptr

Show IntPtr
Instance details

Defined in Foreign.Ptr

Show IOMode

Since: base-4.2.0.0

Instance details

Defined in GHC.IO.IOMode

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 GeneralCategory

Since: base-2.1

Instance details

Defined in GHC.Unicode

Show SrcLoc

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

Show SomeException

Since: base-3.0

Instance details

Defined in GHC.Exception.Type

Show ByteString
Instance details

Defined in Data.ByteString.Lazy.Internal

Show ByteString
Instance details

Defined in Data.ByteString.Internal

Show IntSet
Instance details

Defined in Data.IntSet.Internal

Show Decoding
Instance details

Defined in Data.Text.Encoding

Show UnicodeException
Instance details

Defined in Data.Text.Encoding.Error

Show CodePoint
Instance details

Defined in Data.Text.Encoding

Show DecoderState
Instance details

Defined in Data.Text.Encoding

Methods

showsPrec :: Int -> DecoderState -> ShowS Source #

show :: DecoderState -> String Source #

showList :: [DecoderState] -> ShowS Source #

Show Leniency Source #
Instance details

Defined in Protolude.Conv

Show FatalError Source #
Instance details

Defined in Protolude.Panic

Show a => Show [a]

Since: base-2.1

Instance details

Defined in GHC.Show

Show a => Show ( Maybe a)

Since: base-2.1

Instance details

Defined in GHC.Show

Show a => Show ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Show ( Ptr a)

Since: base-2.1

Instance details

Defined in GHC.Ptr

Show ( FunPtr a)

Since: base-2.1

Instance details

Defined in GHC.Ptr

Show p => Show ( Par1 p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Show a => Show ( Complex a)

Since: base-2.1

Instance details

Defined in Data.Complex

Show a => Show ( Min a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show ( Max a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show ( First a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show ( Last a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show m => Show ( WrappedMonoid m)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show ( Option a)

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show a => Show ( ZipList a)

Since: base-4.7.0.0

Instance details

Defined in Control.Applicative

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

Show a => Show ( First a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Show a => Show ( Last a)

Since: base-2.1

Instance details

Defined in Data.Monoid

Show a => Show ( Dual a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show a => Show ( Sum a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show a => Show ( Product a)

Since: base-2.1

Instance details

Defined in Data.Semigroup.Internal

Show a => Show ( Down a)

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

Since: base-4.7.0.0

Instance details

Defined in Data.Ord

Show a => Show ( NonEmpty a)

Since: base-4.11.0.0

Instance details

Defined in GHC.Show

Show a => Show ( IntMap a)
Instance details

Defined in Data.IntMap.Internal

Show a => Show ( Seq a)
Instance details

Defined in Data.Sequence.Internal

Show a => Show ( ViewL a)
Instance details

Defined in Data.Sequence.Internal

Show a => Show ( ViewR a)
Instance details

Defined in Data.Sequence.Internal

Show a => Show ( Set a)
Instance details

Defined in Data.Set.Internal

Show a => Show ( Hashed a)
Instance details

Defined in Data.Hashable.Class

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

Since: base-3.0

Instance details

Defined in Data.Either

Show ( V1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( U1 p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( TypeRep a)
Instance details

Defined in Data.Typeable.Internal

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

Since: base-2.1

Instance details

Defined in GHC.Show

Show ( ST s a)

Since: base-2.1

Instance details

Defined in GHC.ST

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

Since: base-2.1

Instance details

Defined in GHC.Arr

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

Since: base-4.9.0.0

Instance details

Defined in Data.Semigroup

Show ( Proxy s)

Since: base-4.7.0.0

Instance details

Defined in Data.Proxy

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

Defined in Data.Map.Internal

( Show1 m, Show a) => Show ( ListT m a)
Instance details

Defined in Control.Monad.Trans.List

( Show1 m, Show a) => Show ( MaybeT m a)
Instance details

Defined in Control.Monad.Trans.Maybe

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

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

Show ( URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( URec Float p)
Instance details

Defined in GHC.Generics

Show ( URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

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

Since: base-2.1

Instance details

Defined in GHC.Show

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

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

Since: base-4.12.0.0

Instance details

Defined in Data.Monoid

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

Since: base-4.8.0.0

Instance details

Defined in Data.Semigroup.Internal

Show ( Coercion a b)

Since: base-4.7.0.0

Instance details

Defined in Data.Type.Coercion

Show (a :~: b)

Since: base-4.7.0.0

Instance details

Defined in Data.Type.Equality

( Show1 f, Show a) => Show ( IdentityT f a)
Instance details

Defined in Control.Monad.Trans.Identity

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

Defined in Control.Monad.Trans.Error

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

Defined in Control.Monad.Trans.Except

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

Defined in Control.Monad.Trans.Writer.Lazy

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

Defined in Control.Monad.Trans.Writer.Strict

Show c => Show ( K1 i c p)

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

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

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

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

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

( 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 Source #

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

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

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

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Product

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

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Sum

Show (a :~~: b)

Since: base-4.10.0.0

Instance details

Defined in Data.Type.Equality

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

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

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

Since: base-4.7.0.0

Instance details

Defined in GHC.Generics

( 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 Source #

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

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

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

Since: base-4.9.0.0

Instance details

Defined in Data.Functor.Compose

( 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 Source #

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

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

( 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 Source #

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

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

( 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 Source #

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

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

( 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 Source #

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

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

( 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 Source #

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

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

( 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 Source #

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

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

( 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 Source #

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

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

( 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 Source #

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

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

( 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 Source #

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

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

( 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 Source #

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

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

class KnownNat (n :: Nat ) Source #

This class gives the integer associated with a type-level natural. There are instances of the class for every concrete literal: 0, 1, 2, etc.

Since: base-4.7.0.0

Minimal complete definition

natSing

class KnownSymbol (n :: Symbol ) Source #

This class gives the string associated with a type-level symbol. There are instances of the class for every concrete literal: "hello", etc.

Since: base-4.7.0.0

Minimal complete definition

symbolSing

class HasField (x :: k) r a | x r -> a where Source #

Constraint representing the fact that the field x belongs to the record type r and has field type a . This will be solved automatically, but manual instances may be provided as well.

Methods

getField :: r -> a Source #

Selector function to extract the field from the record.

data Bool Source #

Instances

Instances details
Bounded Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Bool

Since: base-2.1

Instance details

Defined in GHC.Enum

Eq Bool
Instance details

Defined in GHC.Classes

Ord Bool
Instance details

Defined in GHC.Classes

Read Bool

Since: base-2.1

Instance details

Defined in GHC.Read

Show Bool

Since: base-2.1

Instance details

Defined in GHC.Show

Ix Bool

Since: base-2.1

Instance details

Defined in GHC.Ix

Generic Bool

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep Bool :: Type -> Type Source #

Storable Bool

Since: base-2.1

Instance details

Defined in Foreign.Storable

Bits Bool

Interpret Bool as 1-bit bit-field

Since: base-4.7.0.0

Instance details

Defined in Data.Bits

FiniteBits Bool

Since: base-4.7.0.0

Instance details

Defined in Data.Bits

NFData Bool
Instance details

Defined in Control.DeepSeq

Hashable Bool
Instance details

Defined in Data.Hashable.Class

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

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

type Rep Bool
Instance details

Defined in GHC.Generics

type DemoteRep Bool
Instance details

Defined in GHC.Generics

type DemoteRep Bool = Bool
data Sing (a :: Bool )
Instance details

Defined in GHC.Generics

data Sing (a :: Bool ) where

data Char Source #

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
Bounded Char

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Char

Since: base-2.1

Instance details

Defined in GHC.Enum

Eq Char
Instance details

Defined in GHC.Classes

Ord Char
Instance details

Defined in GHC.Classes

Read Char

Since: base-2.1

Instance details

Defined in GHC.Read

Show Char

Since: base-2.1

Instance details

Defined in GHC.Show

Ix Char

Since: base-2.1

Instance details

Defined in GHC.Ix

Storable Char

Since: base-2.1

Instance details

Defined in Foreign.Storable

NFData Char
Instance details

Defined in Control.DeepSeq

Hashable Char
Instance details

Defined in Data.Hashable.Class

ErrorList Char
Instance details

Defined in Control.Monad.Trans.Error

StringConv String String Source #
Instance details

Defined in Protolude.Conv

StringConv String ByteString Source #
Instance details

Defined in Protolude.Conv

StringConv String ByteString Source #
Instance details

Defined in Protolude.Conv

StringConv String Text Source #
Instance details

Defined in Protolude.Conv

StringConv String Text Source #
Instance details

Defined in Protolude.Conv

StringConv ByteString String Source #
Instance details

Defined in Protolude.Conv

StringConv ByteString String Source #
Instance details

Defined in Protolude.Conv

StringConv Text String Source #
Instance details

Defined in Protolude.Conv

StringConv Text String Source #
Instance details

Defined in Protolude.Conv

ConvertText String String Source #
Instance details

Defined in Protolude.ConvertText

ConvertText String Text Source #
Instance details

Defined in Protolude.ConvertText

ConvertText String Text Source #
Instance details

Defined in Protolude.ConvertText

ConvertText Text String Source #
Instance details

Defined in Protolude.ConvertText

ConvertText Text String Source #
Instance details

Defined in Protolude.ConvertText

Generic1 ( URec Char :: k -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ( URec Char ) :: k -> Type Source #

Foldable ( UChar :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Traversable ( UChar :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Print [ Char ] Source #
Instance details

Defined in Protolude.Show

Functor ( URec Char :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Eq ( URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Ord ( URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic ( URec Char p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( URec Char p) :: Type -> Type Source #

data URec Char (p :: k)

Used for marking occurrences of Char#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 ( URec Char :: k -> Type )
Instance details

Defined in GHC.Generics

type Rep ( URec Char p)
Instance details

Defined in GHC.Generics

data Double Source #

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.

Constructors

D# Double#

Instances

Instances details
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

Floating Double

Since: base-2.1

Instance details

Defined in GHC.Float

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

Read Double

Since: base-2.1

Instance details

Defined in GHC.Read

RealFloat Double

Since: base-2.1

Instance details

Defined in GHC.Float

Storable Double

Since: base-2.1

Instance details

Defined in Foreign.Storable

NFData Double
Instance details

Defined in Control.DeepSeq

Hashable Double

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

The hash of NaN is not well defined.

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Generic1 ( URec Double :: k -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ( URec Double ) :: k -> Type Source #

Foldable ( UDouble :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Traversable ( UDouble :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Functor ( URec Double :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Eq ( URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Ord ( URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic ( URec Double p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec Double (p :: k)

Used for marking occurrences of Double#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 ( URec Double :: k -> Type )
Instance details

Defined in GHC.Generics

type Rep ( URec Double p)
Instance details

Defined in GHC.Generics

data Float Source #

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.

Constructors

F# Float#

Instances

Instances details
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 substitutivity:

>>> 0 == (-0 :: Float)
True
>>> recip 0 == recip (-0 :: Float)
False
Instance details

Defined in GHC.Classes

Floating Float

Since: base-2.1

Instance details

Defined in GHC.Float

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

Read Float

Since: base-2.1

Instance details

Defined in GHC.Read

RealFloat Float

Since: base-2.1

Instance details

Defined in GHC.Float

Storable Float

Since: base-2.1

Instance details

Defined in Foreign.Storable

NFData Float
Instance details

Defined in Control.DeepSeq

Hashable Float

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

The hash of NaN is not well defined.

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Generic1 ( URec Float :: k -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ( URec Float ) :: k -> Type Source #

Foldable ( UFloat :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Traversable ( UFloat :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Functor ( URec Float :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Eq ( URec Float p)
Instance details

Defined in GHC.Generics

Ord ( URec Float p)
Instance details

Defined in GHC.Generics

Show ( URec Float p)
Instance details

Defined in GHC.Generics

Generic ( URec Float p)
Instance details

Defined in GHC.Generics

data URec Float (p :: k)

Used for marking occurrences of Float#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 ( URec Float :: k -> Type )
Instance details

Defined in GHC.Generics

type Rep ( URec Float p)
Instance details

Defined in GHC.Generics

data Int Source #

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
Bounded Int

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Int

Since: base-2.1

Instance details

Defined in GHC.Enum

Eq Int
Instance details

Defined in GHC.Classes

Integral Int

Since: base-2.0.1

Instance details

Defined in GHC.Real

Num Int

Since: base-2.1

Instance details

Defined in GHC.Num

Ord Int
Instance details

Defined in GHC.Classes

Read Int

Since: base-2.1

Instance details

Defined in GHC.Read

Real Int

Since: base-2.0.1

Instance details

Defined in GHC.Real

Show Int

Since: base-2.1

Instance details

Defined in GHC.Show

Ix Int

Since: base-2.1

Instance details

Defined in GHC.Ix

Storable Int

Since: base-2.1

Instance details

Defined in Foreign.Storable

Bits Int

Since: base-2.1

Instance details

Defined in Data.Bits

FiniteBits Int

Since: base-4.6.0.0

Instance details

Defined in Data.Bits

NFData Int
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Int -> () Source #

Hashable Int
Instance details

Defined in Data.Hashable.Class

Generic1 ( URec Int :: k -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ( URec Int ) :: k -> Type Source #

Foldable ( UInt :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Traversable ( UInt :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Functor ( URec Int :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Eq ( URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Ord ( URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic ( URec Int p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( URec Int p) :: Type -> Type Source #

data URec Int (p :: k)

Used for marking occurrences of Int#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 ( URec Int :: k -> Type )
Instance details

Defined in GHC.Generics

type Rep ( URec Int p)
Instance details

Defined in GHC.Generics

data Integer Source #

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

For more information about this type's representation, see the comments in its implementation.

Instances

Instances details
Enum Integer

Since: base-2.1

Instance details

Defined in GHC.Enum

Eq Integer
Instance details

Defined in GHC.Integer.Type

Integral Integer

Since: base-2.0.1

Instance details

Defined in GHC.Real

Num Integer

Since: base-2.1

Instance details

Defined in GHC.Num

Ord Integer
Instance details

Defined in GHC.Integer.Type

Read Integer

Since: base-2.1

Instance details

Defined in GHC.Read

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

Ix Integer

Since: base-2.1

Instance details

Defined in GHC.Ix

Bits Integer

Since: base-2.1

Instance details

Defined in Data.Bits

NFData Integer
Instance details

Defined in Control.DeepSeq

Hashable Integer
Instance details

Defined in Data.Hashable.Class

data Ordering Source #

Instances

Instances details
Bounded Ordering

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Ordering

Since: base-2.1

Instance details

Defined in GHC.Enum

Eq Ordering
Instance details

Defined in GHC.Classes

Ord Ordering
Instance details

Defined in GHC.Classes

Read Ordering

Since: base-2.1

Instance details

Defined in GHC.Read

Show Ordering

Since: base-2.1

Instance details

Defined in GHC.Show

Ix Ordering

Since: base-2.1

Instance details

Defined in GHC.Ix

Generic Ordering

Since: base-4.6.0.0

Instance details

Defined in GHC.Generics

Semigroup Ordering

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

Monoid Ordering

Since: base-2.1

Instance details

Defined in GHC.Base

NFData Ordering
Instance details

Defined in Control.DeepSeq

Hashable Ordering
Instance details

Defined in Data.Hashable.Class

type Rep Ordering
Instance details

Defined in GHC.Generics

data Ratio a Source #

Rational numbers, with numerator and denominator of some Integral type.

Note that Ratio 's instances inherit the deficiencies from the type parameter's. For example, Ratio Natural 's Num instance has similar problems to Natural 's.

Instances

Instances details
NFData1 Ratio

Available on base >=4.9

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> Ratio a -> () Source #

Integral a => Enum ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Eq a => Eq ( Ratio a)

Since: base-2.1

Instance details

Defined in GHC.Real

Integral a => Fractional ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Integral a => Num ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Integral a => Ord ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

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

Since: base-2.1

Instance details

Defined in GHC.Read

Integral a => Real ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Integral a => RealFrac ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

Show a => Show ( Ratio a)

Since: base-2.0.1

Instance details

Defined in GHC.Real

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

Since: base-4.8.0.0

Instance details

Defined in Foreign.Storable

NFData a => NFData ( Ratio a)
Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ratio a -> () Source #

Hashable a => Hashable ( Ratio a)
Instance details

Defined in Data.Hashable.Class

type Rational = Ratio Integer Source #

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

data IO a Source #

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
Monad IO

Since: base-2.1

Instance details

Defined in GHC.Base

Functor IO

Since: base-2.1

Instance details

Defined in GHC.Base

Methods

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

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

MonadFail IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.Fail

Applicative IO

Since: base-2.1

Instance details

Defined in GHC.Base

MonadIO IO

Since: base-4.9.0.0

Instance details

Defined in Control.Monad.IO.Class

Alternative IO

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

MonadPlus IO

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

MonadError IOException IO
Instance details

Defined in Control.Monad.Error.Class

Semigroup a => Semigroup ( IO a)

Since: base-4.10.0.0

Instance details

Defined in GHC.Base

Monoid a => Monoid ( IO a)

Since: base-4.9.0.0

Instance details

Defined in GHC.Base

data Word Source #

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

Instances

Instances details
Bounded Word

Since: base-2.1

Instance details

Defined in GHC.Enum

Enum Word

Since: base-2.1

Instance details

Defined in GHC.Enum

Eq Word
Instance details

Defined in GHC.Classes

Integral Word

Since: base-2.1

Instance details

Defined in GHC.Real

Num Word

Since: base-2.1

Instance details

Defined in GHC.Num

Ord Word
Instance details

Defined in GHC.Classes

Read Word

Since: base-4.5.0.0

Instance details

Defined in GHC.Read

Real Word

Since: base-2.1

Instance details

Defined in GHC.Real

Show Word

Since: base-2.1

Instance details

Defined in GHC.Show

Ix Word

Since: base-4.6.0.0

Instance details

Defined in GHC.Ix

Storable Word

Since: base-2.1

Instance details

Defined in Foreign.Storable

Bits Word

Since: base-2.1

Instance details

Defined in Data.Bits

FiniteBits Word

Since: base-4.6.0.0

Instance details

Defined in Data.Bits

NFData Word
Instance details

Defined in Control.DeepSeq

Hashable Word
Instance details

Defined in Data.Hashable.Class

Generic1 ( URec Word :: k -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ( URec Word ) :: k -> Type Source #

Foldable ( UWord :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Traversable ( UWord :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Functor ( URec Word :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Eq ( URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Ord ( URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Show ( URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic ( URec Word p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( URec Word p) :: Type -> Type Source #

data URec Word (p :: k)

Used for marking occurrences of Word#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

type Rep1 ( URec Word :: k -> Type )
Instance details

Defined in GHC.Generics

type Rep ( URec Word p)
Instance details

Defined in GHC.Generics

data Ptr a Source #

A value of type Ptr a represents a pointer to an object, or an array of objects, which may be marshalled to or from Haskell values of type a .

The type a will often be an instance of class Storable which provides the marshalling operations. However this is not essential, and you can provide your own operations to access the pointer. For example you might write small foreign functions to get or set the fields of a C struct .

Instances

Instances details
NFData1 Ptr

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> Ptr a -> () Source #

Generic1 ( URec ( Ptr ()) :: k -> Type )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep1 ( URec ( Ptr ())) :: k -> Type Source #

Methods

from1 :: forall (a :: k0). URec ( Ptr ()) a -> Rep1 ( URec ( Ptr ())) a Source #

to1 :: forall (a :: k0). Rep1 ( URec ( Ptr ())) a -> URec ( Ptr ()) a Source #

Eq ( Ptr a)

Since: base-2.1

Instance details

Defined in GHC.Ptr

Ord ( Ptr a)

Since: base-2.1

Instance details

Defined in GHC.Ptr

Show ( Ptr a)

Since: base-2.1

Instance details

Defined in GHC.Ptr

Foldable ( UAddr :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Foldable

Traversable ( UAddr :: Type -> Type )

Since: base-4.9.0.0

Instance details

Defined in Data.Traversable

Storable ( Ptr a)

Since: base-2.1

Instance details

Defined in Foreign.Storable

NFData ( Ptr a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: Ptr a -> () Source #

Hashable ( Ptr a)
Instance details

Defined in Data.Hashable.Class

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

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

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

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

Eq ( URec ( Ptr ()) p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Ord ( URec ( Ptr ()) p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Generic ( URec ( Ptr ()) p)

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type Rep ( URec ( Ptr ()) p) :: Type -> Type Source #

data URec ( Ptr ()) (p :: k)

Used for marking occurrences of Addr#

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

data URec ( Ptr ()) (p :: k) = UAddr { }
type Rep1 ( URec ( Ptr ()) :: k -> Type )
Instance details

Defined in GHC.Generics

type Rep ( URec ( Ptr ()) p)
Instance details

Defined in GHC.Generics

data FunPtr a Source #

A value of type FunPtr a is a pointer to a function callable from foreign code. The type a will normally be a foreign type , a function type with zero or more arguments where

A value of type FunPtr a may be a pointer to a foreign function, either returned by another foreign function or imported with a a static address import like

foreign import ccall "stdlib.h &free"
  p_free :: FunPtr (Ptr a -> IO ())

or a pointer to a Haskell function created using a wrapper stub declared to produce a FunPtr of the correct type. For example:

type Compare = Int -> Int -> Bool
foreign import ccall "wrapper"
  mkCompare :: Compare -> IO (FunPtr Compare)

Calls to wrapper stubs like mkCompare allocate storage, which should be released with freeHaskellFunPtr when no longer required.

To convert FunPtr values to corresponding Haskell functions, one can define a dynamic stub for the specific foreign type, e.g.

type IntFunction = CInt -> IO ()
foreign import ccall "dynamic"
  mkFun :: FunPtr IntFunction -> IntFunction

Instances

Instances details
NFData1 FunPtr

Since: deepseq-1.4.3.0

Instance details

Defined in Control.DeepSeq

Methods

liftRnf :: (a -> ()) -> FunPtr a -> () Source #

Eq ( FunPtr a)
Instance details

Defined in GHC.Ptr

Ord ( FunPtr a)
Instance details

Defined in GHC.Ptr

Show ( FunPtr a)

Since: base-2.1

Instance details

Defined in GHC.Ptr

Storable ( FunPtr a)

Since: base-2.1

Instance details

Defined in Foreign.Storable

NFData ( FunPtr a)

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

Methods

rnf :: FunPtr a -> () Source #

Hashable ( FunPtr a)
Instance details

Defined in Data.Hashable.Class

type Type = Type Source #

The kind of types with lifted values. For example Int :: Type .

data Constraint Source #

The kind of constraints, like Show a

data Nat Source #

(Kind) This is the kind of type-level natural numbers.

data Symbol Source #

(Kind) This is the kind of type-level symbols. Declared here because class IP needs it

Instances

Instances details
SingKind Symbol

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Associated Types

type DemoteRep Symbol

Methods

fromSing :: forall (a :: Symbol ). Sing a -> DemoteRep Symbol

KnownSymbol a => SingI (a :: Symbol )

Since: base-4.9.0.0

Instance details

Defined in GHC.Generics

Methods

sing :: Sing a

type DemoteRep Symbol
Instance details

Defined in GHC.Generics

type DemoteRep Symbol = String
data Sing (s :: Symbol )
Instance details

Defined in GHC.Generics

data Sing (s :: Symbol ) where

type family CmpNat (a :: Nat ) (b :: Nat ) :: Ordering where ... Source #

Comparison of type-level naturals, as a function.

Since: base-4.7.0.0

class a ~R# b => Coercible (a :: k) (b :: k) Source #

Coercible is a two-parameter class that has instances for types a and b if the compiler can infer that they have the same representation. This class does not have regular instances; instead they are created on-the-fly during type-checking. Trying to manually declare an instance of Coercible is an error.

Nevertheless one can pretend that the following three kinds of instances exist. First, as a trivial base-case:

instance Coercible a a

Furthermore, for every type constructor there is an instance that allows to coerce under the type constructor. For example, let D be a prototypical type constructor ( data or newtype ) with three type arguments, which have roles nominal , representational resp. phantom . Then there is an instance of the form

instance Coercible b b' => Coercible (D a b c) (D a b' c')

Note that the nominal type arguments are equal, the representational type arguments can differ, but need to have a Coercible instance themself, and the phantom type arguments can be changed arbitrarily.

The third kind of instance exists for every newtype NT = MkNT T and comes in two variants, namely

instance Coercible a T => Coercible a NT
instance Coercible T b => Coercible NT b

This instance is only usable if the constructor MkNT is in scope.

If, as a library author of a type constructor like Set a , you want to prevent a user of your module to write coerce :: Set T -> Set NT , you need to set the role of Set 's type parameter to nominal , by writing

type role Set nominal

For more details about this feature, please refer to Safe Coercions by Joachim Breitner, Richard A. Eisenberg, Simon Peyton Jones and Stephanie Weirich.

Since: ghc-prim-4.7.0.0

data StaticPtr a Source #

A reference to a value of type a .

Instances

Instances details
IsStatic StaticPtr

Since: base-4.9.0.0

Instance details

Defined in GHC.StaticPtr

data CallStack Source #

CallStack s are a lightweight method of obtaining a partial call-stack at any point in the program.

A function can request its call-site with the HasCallStack constraint. For example, we can define

putStrLnWithCallStack :: HasCallStack => String -> IO ()

as a variant of putStrLn that will get its call-site and print it, along with the string given as argument. We can access the call-stack inside putStrLnWithCallStack with callStack .

putStrLnWithCallStack :: HasCallStack => String -> IO ()
putStrLnWithCallStack msg = do
  putStrLn msg
  putStrLn (prettyCallStack callStack)

Thus, if we call putStrLnWithCallStack we will get a formatted call-stack alongside our string.

>>> putStrLnWithCallStack "hello"
hello
CallStack (from HasCallStack):
  putStrLnWithCallStack, called at <interactive>:2:1 in interactive:Ghci1

GHC solves HasCallStack constraints in three steps:

  1. If there is a CallStack in scope -- i.e. the enclosing function has a HasCallStack constraint -- GHC will append the new call-site to the existing CallStack .
  2. If there is no CallStack in scope -- e.g. in the GHCi session above -- and the enclosing definition does not have an explicit type signature, GHC will infer a HasCallStack constraint for the enclosing definition (subject to the monomorphism restriction).
  3. If there is no CallStack in scope and the enclosing definition has an explicit type signature, GHC will solve the HasCallStack constraint for the singleton CallStack containing just the current call-site.

CallStack s do not interact with the RTS and do not require compilation with -prof . On the other hand, as they are built up explicitly via the HasCallStack constraints, they will generally not contain as much information as the simulated call-stacks maintained by the RTS.

A CallStack is a [(String, SrcLoc)] . The String is the name of function that was called, the SrcLoc is the call-site. The list is ordered with the most recently called function at the head.

NOTE: The intrepid user may notice that HasCallStack is just an alias for an implicit parameter ?callStack :: CallStack . This is an implementation detail and should not be considered part of the CallStack API, we may decide to change the implementation in the future.

Since: base-4.8.1.0

Instances

Instances details
IsList CallStack

Be aware that 'fromList . toList = id' only for unfrozen CallStack s, since toList removes frozenness information.

Since: base-4.9.0.0

Instance details

Defined in GHC.Exts

Associated Types

type Item CallStack Source #

Show CallStack

Since: base-4.9.0.0

Instance details

Defined in GHC.Show

NFData CallStack

Since: deepseq-1.4.2.0

Instance details

Defined in Control.DeepSeq

type Item CallStack
Instance details

Defined in GHC.Exts

showStackTrace :: IO ( Maybe String ) Source #

Get a string representation of the current execution stack state.

getStackTrace :: IO ( Maybe [ Location ]) Source #

Get a trace of the current execution stack state.

Returns Nothing if stack trace support isn't available on host machine.

data SrcLoc Source #

A location in the original program source.

data Location Source #

Location information about an address from a backtrace.

putStrLn :: String -> IO () Source #

The same as putStr , but adds a newline character.

putStr :: String -> IO () Source #

Write a string to the standard output device (same as hPutStr stdout ).

withFrozenCallStack :: HasCallStack => ( HasCallStack => a) -> a Source #

Perform some computation without adding new entries to the CallStack .

Since: base-4.9.0.0

callStack :: HasCallStack => CallStack Source #

Return the current CallStack .

Does *not* include the call-site of callStack .

Since: base-4.9.0.0

prettySrcLoc :: SrcLoc -> String Source #

Pretty print a SrcLoc .

Since: base-4.9.0.0

someSymbolVal :: String -> SomeSymbol Source #

Convert a string into an unknown type-level symbol.

Since: base-4.7.0.0

someNatVal :: Integer -> Maybe SomeNat Source #

Convert an integer into an unknown type-level natural.

Since: base-4.7.0.0

symbolVal :: forall (n :: Symbol ) proxy. KnownSymbol n => proxy n -> String Source #

Since: base-4.7.0.0

natVal :: forall (n :: Nat ) proxy. KnownNat n => proxy n -> Integer Source #

Since: base-4.7.0.0

showSignedFloat Source #

Arguments

:: RealFloat a
=> (a -> ShowS )

a function that can show unsigned values

-> Int

the precedence of the enclosing context

-> a

the value to show

-> ShowS

showFloat :: RealFloat a => a -> ShowS Source #

Show a signed RealFloat value to full precision using standard decimal notation for arguments whose absolute value lies between 0.1 and 9,999,999 , and scientific notation otherwise.

lcm :: Integral a => a -> a -> a Source #

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

gcd :: Integral a => a -> a -> a Source #

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.

(^^) :: ( Fractional a, Integral b) => a -> b -> a infixr 8 Source #

raise a number to an integral power

(^) :: ( Num a, Integral b) => a -> b -> a infixr 8 Source #

raise a number to a non-negative integral power

showSigned Source #

Arguments

:: Real a
=> (a -> ShowS )

a function that can show unsigned values

-> Int

the precedence of the enclosing context

-> a

the value to show

-> ShowS

Converts a possibly-negative Real value to a string.

denominator :: Ratio a -> a Source #

Extract the denominator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive.

numerator :: Ratio a -> a Source #

Extract the numerator of the ratio in reduced form: the numerator and denominator have no common factor and the denominator is positive.

(%) :: Integral a => a -> a -> Ratio a infixl 7 Source #

Forms the ratio of two integral numbers.

reduce :: Integral a => a -> a -> Ratio a Source #

reduce is a subsidiary function used only in this module. It normalises a ratio by dividing both numerator and denominator by their greatest common divisor.

subtract :: Num a => a -> a -> a Source #

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.

currentCallStack :: IO [ String ] Source #

Returns a [String] representing the current call stack. This can be useful for debugging.

The implementation uses the call-stack simulation maintained by the profiler, so it only works if the program was compiled with -prof and contains suitable SCC annotations (e.g. by using -fprof-auto ). Otherwise, the list returned is likely to be empty or uninformative.

Since: base-4.5.0.0

asTypeOf :: a -> a -> a Source #

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.

until :: (a -> Bool ) -> (a -> a) -> a -> a Source #

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

ord :: Char -> Int Source #

The fromEnum method restricted to the type Char .

getCallStack :: CallStack -> [([ Char ], SrcLoc )] Source #

Extract a list of call-sites from the CallStack .

The list is ordered by most recent call.

Since: base-4.8.1.0

type HasCallStack = ?callStack :: CallStack Source #

Request a CallStack.

NOTE: The implicit parameter ?callStack :: CallStack is an implementation detail and should not be considered part of the CallStack API, we may decide to change the implementation in the future.

Since: base-4.9.0.0

($!) :: (a -> b) -> a -> b infixr 0 Source #