foundation-0.0.15: Alternative prelude with batteries and no dependencies

LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Foundation

Contents

Description

I tried to picture clusters of information As they moved through the computer What do they look like?

Alternative Prelude

Synopsis

Standard

Operators

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

Application operator. This operator is redundant, since ordinary application (f x) means the same as (f $ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:

    f $ g $ h x  =  f (g (h x))

It is also useful in higher-order situations, such as map ($ 0) xs, or zipWith ($) fs xs.

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

Strict (call-by-value) application operator. It takes a function and an argument, evaluates the argument to weak head normal form (WHNF), then calls the function with that value.

(&&) :: Bool -> Bool -> Bool infixr 3 #

Boolean "and"

(||) :: Bool -> Bool -> Bool infixr 2 #

Boolean "or"

(.) :: Category k cat => forall b c a. cat b c -> cat a b -> cat a c #

morphism composition

Functions

not :: Bool -> Bool #

Boolean "not"

otherwise :: Bool #

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

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

data Tuple2 a b #

Strict tuple (a,b)

Constructors

Tuple2 !a !b 

Instances

Bifunctor Tuple2 # 

Methods

bimap :: (a -> b) -> (c -> d) -> Tuple2 a c -> Tuple2 b d #

first :: (a -> b) -> Tuple2 a c -> Tuple2 b c #

second :: (b -> c) -> Tuple2 a b -> Tuple2 a c #

Nthable 1 (Tuple2 a b) # 

Associated Types

type NthTy (1 :: Nat) (Tuple2 a b) :: * #

Methods

nth :: proxy 1 -> Tuple2 a b -> NthTy 1 (Tuple2 a b) #

Nthable 2 (Tuple2 a b) # 

Associated Types

type NthTy (2 :: Nat) (Tuple2 a b) :: * #

Methods

nth :: proxy 2 -> Tuple2 a b -> NthTy 2 (Tuple2 a b) #

(Eq b, Eq a) => Eq (Tuple2 a b) # 

Methods

(==) :: Tuple2 a b -> Tuple2 a b -> Bool #

(/=) :: Tuple2 a b -> Tuple2 a b -> Bool #

(Data b, Data a) => Data (Tuple2 a b) # 

Methods

gfoldl :: (forall d c. Data d => c (d -> c) -> d -> c c) -> (forall g. g -> c g) -> Tuple2 a b -> c (Tuple2 a b) #

gunfold :: (forall c r. Data c => c (c -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tuple2 a b) #

toConstr :: Tuple2 a b -> Constr #

dataTypeOf :: Tuple2 a b -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Tuple2 a b)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tuple2 a b)) #

gmapT :: (forall c. Data c => c -> c) -> Tuple2 a b -> Tuple2 a b #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tuple2 a b -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tuple2 a b -> r #

gmapQ :: (forall d. Data d => d -> u) -> Tuple2 a b -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Tuple2 a b -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple2 a b -> m (Tuple2 a b) #

(Ord b, Ord a) => Ord (Tuple2 a b) # 

Methods

compare :: Tuple2 a b -> Tuple2 a b -> Ordering #

(<) :: Tuple2 a b -> Tuple2 a b -> Bool #

(<=) :: Tuple2 a b -> Tuple2 a b -> Bool #

(>) :: Tuple2 a b -> Tuple2 a b -> Bool #

(>=) :: Tuple2 a b -> Tuple2 a b -> Bool #

max :: Tuple2 a b -> Tuple2 a b -> Tuple2 a b #

min :: Tuple2 a b -> Tuple2 a b -> Tuple2 a b #

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

Methods

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

show :: Tuple2 a b -> String #

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

Generic (Tuple2 a b) # 

Associated Types

type Rep (Tuple2 a b) :: * -> * #

Methods

from :: Tuple2 a b -> Rep (Tuple2 a b) x #

to :: Rep (Tuple2 a b) x -> Tuple2 a b #

(NormalForm a, NormalForm b) => NormalForm (Tuple2 a b) # 

Methods

toNormalForm :: Tuple2 a b -> () #

Sndable (Tuple2 a b) # 

Associated Types

type ProductSecond (Tuple2 a b) :: * #

Methods

snd :: Tuple2 a b -> ProductSecond (Tuple2 a b) #

Fstable (Tuple2 a b) # 

Associated Types

type ProductFirst (Tuple2 a b) :: * #

Methods

fst :: Tuple2 a b -> ProductFirst (Tuple2 a b) #

(Hashable a, Hashable b) => Hashable (Tuple2 a b) # 

Methods

hashMix :: Hasher st => Tuple2 a b -> st -> st #

type NthTy 1 (Tuple2 a b) # 
type NthTy 1 (Tuple2 a b) = a
type NthTy 2 (Tuple2 a b) # 
type NthTy 2 (Tuple2 a b) = b
type Rep (Tuple2 a b) # 
type Rep (Tuple2 a b) = D1 (MetaData "Tuple2" "Foundation.Tuple" "foundation-0.0.15-HudUleeP1JdGuh4zUjgkMa" False) (C1 (MetaCons "Tuple2" PrefixI False) ((:*:) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 a)) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 b))))
type ProductSecond (Tuple2 a b) # 
type ProductSecond (Tuple2 a b) = b
type ProductFirst (Tuple2 a b) # 
type ProductFirst (Tuple2 a b) = a

data Tuple3 a b c #

Strict tuple (a,b,c)

Constructors

Tuple3 !a !b !c 

Instances

Nthable 1 (Tuple3 a b c) # 

Associated Types

type NthTy (1 :: Nat) (Tuple3 a b c) :: * #

Methods

nth :: proxy 1 -> Tuple3 a b c -> NthTy 1 (Tuple3 a b c) #

Nthable 2 (Tuple3 a b c) # 

Associated Types

type NthTy (2 :: Nat) (Tuple3 a b c) :: * #

Methods

nth :: proxy 2 -> Tuple3 a b c -> NthTy 2 (Tuple3 a b c) #

Nthable 3 (Tuple3 a b c) # 

Associated Types

type NthTy (3 :: Nat) (Tuple3 a b c) :: * #

Methods

nth :: proxy 3 -> Tuple3 a b c -> NthTy 3 (Tuple3 a b c) #

(Eq c, Eq b, Eq a) => Eq (Tuple3 a b c) # 

Methods

(==) :: Tuple3 a b c -> Tuple3 a b c -> Bool #

(/=) :: Tuple3 a b c -> Tuple3 a b c -> Bool #

(Data c, Data b, Data a) => Data (Tuple3 a b c) # 

Methods

gfoldl :: (forall d e. Data d => c (d -> e) -> d -> c e) -> (forall g. g -> c g) -> Tuple3 a b c -> c (Tuple3 a b c) #

gunfold :: (forall d r. Data d => c (d -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tuple3 a b c) #

toConstr :: Tuple3 a b c -> Constr #

dataTypeOf :: Tuple3 a b c -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Tuple3 a b c)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Tuple3 a b c)) #

gmapT :: (forall d. Data d => d -> d) -> Tuple3 a b c -> Tuple3 a b c #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Tuple3 a b c -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Tuple3 a b c -> r #

gmapQ :: (forall d. Data d => d -> u) -> Tuple3 a b c -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Tuple3 a b c -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Tuple3 a b c -> m (Tuple3 a b c) #

(Ord c, Ord b, Ord a) => Ord (Tuple3 a b c) # 

Methods

compare :: Tuple3 a b c -> Tuple3 a b c -> Ordering #

(<) :: Tuple3 a b c -> Tuple3 a b c -> Bool #

(<=) :: Tuple3 a b c -> Tuple3 a b c -> Bool #

(>) :: Tuple3 a b c -> Tuple3 a b c -> Bool #

(>=) :: Tuple3 a b c -> Tuple3 a b c -> Bool #

max :: Tuple3 a b c -> Tuple3 a b c -> Tuple3 a b c #

min :: Tuple3 a b c -> Tuple3 a b c -> Tuple3 a b c #

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

Methods

showsPrec :: Int -> Tuple3 a b c -> ShowS #

show :: Tuple3 a b c -> String #

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

Generic (Tuple3 a b c) # 

Associated Types

type Rep (Tuple3 a b c) :: * -> * #

Methods

from :: Tuple3 a b c -> Rep (Tuple3 a b c) x #

to :: Rep (Tuple3 a b c) x -> Tuple3 a b c #

(NormalForm a, NormalForm b, NormalForm c) => NormalForm (Tuple3 a b c) # 

Methods

toNormalForm :: Tuple3 a b c -> () #

Thdable (Tuple3 a b c) # 

Associated Types

type ProductThird (Tuple3 a b c) :: * #

Methods

thd :: Tuple3 a b c -> ProductThird (Tuple3 a b c) #

Sndable (Tuple3 a b c) # 

Associated Types

type ProductSecond (Tuple3 a b c) :: * #

Methods

snd :: Tuple3 a b c -> ProductSecond (Tuple3 a b c) #

Fstable (Tuple3 a b c) # 

Associated Types

type ProductFirst (Tuple3 a b c) :: * #

Methods

fst :: Tuple3 a b c -> ProductFirst (Tuple3 a b c) #

(Hashable a, Hashable b, Hashable c) => Hashable (Tuple3 a b c) # 

Methods

hashMix :: Hasher st => Tuple3 a b c -> st -> st #

type NthTy 1 (Tuple3 a b c) # 
type NthTy 1 (Tuple3 a b c) = a
type NthTy 2 (Tuple3 a b c) # 
type NthTy 2 (Tuple3 a b c) = b
type NthTy 3 (Tuple3 a b c) # 
type NthTy 3 (Tuple3 a b c) = c
type Rep (Tuple3 a b c) # 
type ProductThird (Tuple3 a b c) # 
type ProductThird (Tuple3 a b c) = c
type ProductSecond (Tuple3 a b c) # 
type ProductSecond (Tuple3 a b c) = b
type ProductFirst (Tuple3 a b c) # 
type ProductFirst (Tuple3 a b c) = a

data Tuple4 a b c d #

Strict tuple (a,b,c,d)

Constructors

Tuple4 !a !b !c !d 

Instances

Nthable 1 (Tuple4 a b c d) # 

Associated Types

type NthTy (1 :: Nat) (Tuple4 a b c d) :: * #

Methods

nth :: proxy 1 -> Tuple4 a b c d -> NthTy 1 (Tuple4 a b c d) #

Nthable 2 (Tuple4 a b c d) # 

Associated Types

type NthTy (2 :: Nat) (Tuple4 a b c d) :: * #

Methods

nth :: proxy 2 -> Tuple4 a b c d -> NthTy 2 (Tuple4 a b c d) #

Nthable 3 (Tuple4 a b c d) # 

Associated Types

type NthTy (3 :: Nat) (Tuple4 a b c d) :: * #

Methods

nth :: proxy 3 -> Tuple4 a b c d -> NthTy 3 (Tuple4 a b c d) #

Nthable 4 (Tuple4 a b c d) # 

Associated Types

type NthTy (4 :: Nat) (Tuple4 a b c d) :: * #

Methods

nth :: proxy 4 -> Tuple4 a b c d -> NthTy 4 (Tuple4 a b c d) #

(Eq d, Eq c, Eq b, Eq a) => Eq (Tuple4 a b c d) # 

Methods

(==) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool #

(/=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool #

(Data d, Data c, Data b, Data a) => Data (Tuple4 a b c d) # 

Methods

gfoldl :: (forall e f. Data e => c (e -> f) -> e -> c f) -> (forall g. g -> c g) -> Tuple4 a b c d -> c (Tuple4 a b c d) #

gunfold :: (forall e r. Data e => c (e -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Tuple4 a b c d) #

toConstr :: Tuple4 a b c d -> Constr #

dataTypeOf :: Tuple4 a b c d -> DataType #

dataCast1 :: Typeable (* -> *) t => (forall e. Data e => c (t e)) -> Maybe (c (Tuple4 a b c d)) #

dataCast2 :: Typeable (* -> * -> *) t => (forall e f. (Data e, Data f) => c (t e f)) -> Maybe (c (Tuple4 a b c d)) #

gmapT :: (forall e. Data e => e -> e) -> Tuple4 a b c d -> Tuple4 a b c d #

gmapQl :: (r -> r' -> r) -> r -> (forall e. Data e => e -> r') -> Tuple4 a b c d -> r #

gmapQr :: (r' -> r -> r) -> r -> (forall e. Data e => e -> r') -> Tuple4 a b c d -> r #

gmapQ :: (forall e. Data e => e -> u) -> Tuple4 a b c d -> [u] #

gmapQi :: Int -> (forall e. Data e => e -> u) -> Tuple4 a b c d -> u #

gmapM :: Monad m => (forall e. Data e => e -> m e) -> Tuple4 a b c d -> m (Tuple4 a b c d) #

gmapMp :: MonadPlus m => (forall e. Data e => e -> m e) -> Tuple4 a b c d -> m (Tuple4 a b c d) #

gmapMo :: MonadPlus m => (forall e. Data e => e -> m e) -> Tuple4 a b c d -> m (Tuple4 a b c d) #

(Ord d, Ord c, Ord b, Ord a) => Ord (Tuple4 a b c d) # 

Methods

compare :: Tuple4 a b c d -> Tuple4 a b c d -> Ordering #

(<) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool #

(<=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool #

(>) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool #

(>=) :: Tuple4 a b c d -> Tuple4 a b c d -> Bool #

max :: Tuple4 a b c d -> Tuple4 a b c d -> Tuple4 a b c d #

min :: Tuple4 a b c d -> Tuple4 a b c d -> Tuple4 a b c d #

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

Methods

showsPrec :: Int -> Tuple4 a b c d -> ShowS #

show :: Tuple4 a b c d -> String #

showList :: [Tuple4 a b c d] -> ShowS #

Generic (Tuple4 a b c d) # 

Associated Types

type Rep (Tuple4 a b c d) :: * -> * #

Methods

from :: Tuple4 a b c d -> Rep (Tuple4 a b c d) x #

to :: Rep (Tuple4 a b c d) x -> Tuple4 a b c d #

(NormalForm a, NormalForm b, NormalForm c, NormalForm d) => NormalForm (Tuple4 a b c d) # 

Methods

toNormalForm :: Tuple4 a b c d -> () #

Thdable (Tuple4 a b c d) # 

Associated Types

type ProductThird (Tuple4 a b c d) :: * #

Methods

thd :: Tuple4 a b c d -> ProductThird (Tuple4 a b c d) #

Sndable (Tuple4 a b c d) # 

Associated Types

type ProductSecond (Tuple4 a b c d) :: * #

Methods

snd :: Tuple4 a b c d -> ProductSecond (Tuple4 a b c d) #

Fstable (Tuple4 a b c d) # 

Associated Types

type ProductFirst (Tuple4 a b c d) :: * #

Methods

fst :: Tuple4 a b c d -> ProductFirst (Tuple4 a b c d) #

(Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (Tuple4 a b c d) # 

Methods

hashMix :: Hasher st => Tuple4 a b c d -> st -> st #

type NthTy 1 (Tuple4 a b c d) # 
type NthTy 1 (Tuple4 a b c d) = a
type NthTy 2 (Tuple4 a b c d) # 
type NthTy 2 (Tuple4 a b c d) = b
type NthTy 3 (Tuple4 a b c d) # 
type NthTy 3 (Tuple4 a b c d) = c
type NthTy 4 (Tuple4 a b c d) # 
type NthTy 4 (Tuple4 a b c d) = d
type Rep (Tuple4 a b c d) # 
type ProductThird (Tuple4 a b c d) # 
type ProductThird (Tuple4 a b c d) = c
type ProductSecond (Tuple4 a b c d) # 
type ProductSecond (Tuple4 a b c d) = b
type ProductFirst (Tuple4 a b c d) # 
type ProductFirst (Tuple4 a b c d) = a

class Fstable a where #

Class of product types that have a first element

Minimal complete definition

fst

Associated Types

type ProductFirst a #

Methods

fst :: a -> ProductFirst a #

Instances

Fstable (a, b) # 

Associated Types

type ProductFirst (a, b) :: * #

Methods

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

Fstable (Tuple2 a b) # 

Associated Types

type ProductFirst (Tuple2 a b) :: * #

Methods

fst :: Tuple2 a b -> ProductFirst (Tuple2 a b) #

Fstable (a, b, c) # 

Associated Types

type ProductFirst (a, b, c) :: * #

Methods

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

Fstable (Tuple3 a b c) # 

Associated Types

type ProductFirst (Tuple3 a b c) :: * #

Methods

fst :: Tuple3 a b c -> ProductFirst (Tuple3 a b c) #

Fstable (a, b, c, d) # 

Associated Types

type ProductFirst (a, b, c, d) :: * #

Methods

fst :: (a, b, c, d) -> ProductFirst (a, b, c, d) #

Fstable (Tuple4 a b c d) # 

Associated Types

type ProductFirst (Tuple4 a b c d) :: * #

Methods

fst :: Tuple4 a b c d -> ProductFirst (Tuple4 a b c d) #

class Sndable a where #

Class of product types that have a second element

Minimal complete definition

snd

Associated Types

type ProductSecond a #

Methods

snd :: a -> ProductSecond a #

Instances

Sndable (a, b) # 

Associated Types

type ProductSecond (a, b) :: * #

Methods

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

Sndable (Tuple2 a b) # 

Associated Types

type ProductSecond (Tuple2 a b) :: * #

Methods

snd :: Tuple2 a b -> ProductSecond (Tuple2 a b) #

Sndable (a, b, c) # 

Associated Types

type ProductSecond (a, b, c) :: * #

Methods

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

Sndable (Tuple3 a b c) # 

Associated Types

type ProductSecond (Tuple3 a b c) :: * #

Methods

snd :: Tuple3 a b c -> ProductSecond (Tuple3 a b c) #

Sndable (a, b, c, d) # 

Associated Types

type ProductSecond (a, b, c, d) :: * #

Methods

snd :: (a, b, c, d) -> ProductSecond (a, b, c, d) #

Sndable (Tuple4 a b c d) # 

Associated Types

type ProductSecond (Tuple4 a b c d) :: * #

Methods

snd :: Tuple4 a b c d -> ProductSecond (Tuple4 a b c d) #

class Thdable a where #

Class of product types that have a third element

Minimal complete definition

thd

Associated Types

type ProductThird a #

Methods

thd :: a -> ProductThird a #

Instances

Thdable (a, b, c) # 

Associated Types

type ProductThird (a, b, c) :: * #

Methods

thd :: (a, b, c) -> ProductThird (a, b, c) #

Thdable (Tuple3 a b c) # 

Associated Types

type ProductThird (Tuple3 a b c) :: * #

Methods

thd :: Tuple3 a b c -> ProductThird (Tuple3 a b c) #

Thdable (a, b, c, d) # 

Associated Types

type ProductThird (a, b, c, d) :: * #

Methods

thd :: (a, b, c, d) -> ProductThird (a, b, c, d) #

Thdable (Tuple4 a b c d) # 

Associated Types

type ProductThird (Tuple4 a b c d) :: * #

Methods

thd :: Tuple4 a b c d -> ProductThird (Tuple4 a b c d) #

id :: Category k cat => forall a. cat a a #

the identity morphism

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

The maybe function takes a default value, a function, and a Maybe value. If the Maybe value is Nothing, the function returns the default value. Otherwise, it applies the function to the value inside the Just and returns the result.

Examples

Basic usage:

>>> maybe False odd (Just 3)
True
>>> maybe False odd Nothing
False

Read an integer from a string using readMaybe. If we succeed, return twice the integer; that is, apply (*2) to it. If instead we fail to parse an integer, return 0 by default:

>>> import Text.Read ( readMaybe )
>>> maybe 0 (*2) (readMaybe "5")
10
>>> maybe 0 (*2) (readMaybe "")
0

Apply show to a Maybe Int. If we have Just n, we want to show the underlying Int n. But if we have Nothing, we return the empty string instead of (for example) "Nothing":

>>> maybe "" show (Just 5)
"5"
>>> maybe "" show Nothing
""

either :: (a -> c) -> (b -> c) -> Either a b -> c #

Case analysis for the Either type. If the value is Left a, apply the first function to a; if it is Right b, apply the second function to b.

Examples

We create two values of type Either String Int, one using the Left constructor and another using the Right constructor. Then we apply "either" the length function (if we have a String) or the "times-two" function (if we have an Int):

>>> let s = Left "foo" :: Either String Int
>>> let n = Right 3 :: Either String Int
>>> either length (*2) s
3
>>> either length (*2) n
6

flip :: (a -> b -> c) -> b -> a -> c #

flip f takes its (first) two arguments in the reverse order of f.

const :: a -> b -> a #

const x is a unary function which evaluates to x for all inputs.

For instance,

>>> map (const 42) [0..3]
[42,42,42,42]

error :: HasCallStack => String -> a #

stop execution and displays an error message

putStr :: String -> IO () #

Print a string to standard output

putStrLn :: String -> IO () #

Print a string with a newline to standard output

getArgs :: IO [String] #

Returns a list of the program's command line arguments (not including the program name).

uncurry :: (a -> b -> c) -> (a, b) -> c #

uncurry converts a curried function to a function on pairs.

curry :: ((a, b) -> c) -> a -> b -> c #

curry converts an uncurried function to a curried function.

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

Swap the components of a pair.

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

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

asTypeOf :: a -> a -> a #

asTypeOf is a type-restricted version of const. It is usually used as an infix operator, and its typing forces its first argument (which is usually overloaded) to have the same type as the second.

undefined :: HasCallStack => a #

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

seq :: a -> b -> b #

The value of seq a b is bottom if a is bottom, and otherwise equal to b. 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.

class NormalForm a #

Data that can be fully evaluated in Normal Form

Minimal complete definition

toNormalForm

Instances

NormalForm Bool 

Methods

toNormalForm :: Bool -> () #

NormalForm Char 

Methods

toNormalForm :: Char -> () #

NormalForm Double 

Methods

toNormalForm :: Double -> () #

NormalForm Float 

Methods

toNormalForm :: Float -> () #

NormalForm Int 

Methods

toNormalForm :: Int -> () #

NormalForm Int8 

Methods

toNormalForm :: Int8 -> () #

NormalForm Int16 

Methods

toNormalForm :: Int16 -> () #

NormalForm Int32 

Methods

toNormalForm :: Int32 -> () #

NormalForm Int64 

Methods

toNormalForm :: Int64 -> () #

NormalForm Integer 

Methods

toNormalForm :: Integer -> () #

NormalForm Word 

Methods

toNormalForm :: Word -> () #

NormalForm Word8 

Methods

toNormalForm :: Word8 -> () #

NormalForm Word16 

Methods

toNormalForm :: Word16 -> () #

NormalForm Word32 

Methods

toNormalForm :: Word32 -> () #

NormalForm Word64 

Methods

toNormalForm :: Word64 -> () #

NormalForm () 

Methods

toNormalForm :: () -> () #

NormalForm Natural 

Methods

toNormalForm :: Natural -> () #

NormalForm CChar 

Methods

toNormalForm :: CChar -> () #

NormalForm CSChar 

Methods

toNormalForm :: CSChar -> () #

NormalForm CUChar 

Methods

toNormalForm :: CUChar -> () #

NormalForm CShort 

Methods

toNormalForm :: CShort -> () #

NormalForm CUShort 

Methods

toNormalForm :: CUShort -> () #

NormalForm CInt 

Methods

toNormalForm :: CInt -> () #

NormalForm CUInt 

Methods

toNormalForm :: CUInt -> () #

NormalForm CLong 

Methods

toNormalForm :: CLong -> () #

NormalForm CULong 

Methods

toNormalForm :: CULong -> () #

NormalForm CLLong 

Methods

toNormalForm :: CLLong -> () #

NormalForm CULLong 

Methods

toNormalForm :: CULLong -> () #

NormalForm CFloat 

Methods

toNormalForm :: CFloat -> () #

NormalForm CDouble 

Methods

toNormalForm :: CDouble -> () #

NormalForm String 

Methods

toNormalForm :: String -> () #

NormalForm Word256 

Methods

toNormalForm :: Word256 -> () #

NormalForm Word128 

Methods

toNormalForm :: Word128 -> () #

NormalForm Char7 

Methods

toNormalForm :: Char7 -> () #

NormalForm IPv4 # 

Methods

toNormalForm :: IPv4 -> () #

NormalForm IPv6 # 

Methods

toNormalForm :: IPv6 -> () #

NormalForm UUID # 

Methods

toNormalForm :: UUID -> () #

NormalForm a => NormalForm [a] 

Methods

toNormalForm :: [a] -> () #

NormalForm a => NormalForm (Maybe a) 

Methods

toNormalForm :: Maybe a -> () #

NormalForm (Ptr a) 

Methods

toNormalForm :: Ptr a -> () #

NormalForm a => NormalForm (Array a) 

Methods

toNormalForm :: Array a -> () #

NormalForm (UArray ty) 

Methods

toNormalForm :: UArray ty -> () #

NormalForm (Block ty) 

Methods

toNormalForm :: Block ty -> () #

NormalForm (Offset a) 

Methods

toNormalForm :: Offset a -> () #

NormalForm (CountOf a) 

Methods

toNormalForm :: CountOf a -> () #

NormalForm a => NormalForm (LE a) 

Methods

toNormalForm :: LE a -> () #

NormalForm a => NormalForm (BE a) 

Methods

toNormalForm :: BE a -> () #

NormalForm (ChunkedUArray ty) # 

Methods

toNormalForm :: ChunkedUArray ty -> () #

(NormalForm l, NormalForm r) => NormalForm (Either l r) 

Methods

toNormalForm :: Either l r -> () #

(NormalForm a, NormalForm b) => NormalForm (a, b) 

Methods

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

(NormalForm a, NormalForm b) => NormalForm (These a b) 

Methods

toNormalForm :: These a b -> () #

(NormalForm a, NormalForm b) => NormalForm (Tuple2 a b) # 

Methods

toNormalForm :: Tuple2 a b -> () #

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

Methods

toNormalForm :: (a, b, c) -> () #

(NormalForm a, NormalForm b, NormalForm c) => NormalForm (Tuple3 a b c) # 

Methods

toNormalForm :: Tuple3 a b c -> () #

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

Methods

toNormalForm :: (a, b, c, d) -> () #

(NormalForm a, NormalForm b, NormalForm c, NormalForm d) => NormalForm (Tuple4 a b c d) # 

Methods

toNormalForm :: Tuple4 a b c d -> () #

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

Methods

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

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

Methods

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

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

Methods

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

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

Methods

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

deepseq :: NormalForm a => a -> b -> b #

force :: NormalForm a => a -> a #

Type classes

class Show a #

Conversion of values to readable Strings.

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

  • The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.
  • If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.
  • the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression.
  • If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.

For example, given the declarations

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

the derived instance of Show is equivalent to

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

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

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

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

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

Minimal complete definition

showsPrec | show

Instances

Show Bool 

Methods

showsPrec :: Int -> Bool -> ShowS #

show :: Bool -> String #

showList :: [Bool] -> ShowS #

Show Char 

Methods

showsPrec :: Int -> Char -> ShowS #

show :: Char -> String #

showList :: [Char] -> ShowS #

Show Int 

Methods

showsPrec :: Int -> Int -> ShowS #

show :: Int -> String #

showList :: [Int] -> ShowS #

Show Int8 

Methods

showsPrec :: Int -> Int8 -> ShowS #

show :: Int8 -> String #

showList :: [Int8] -> ShowS #

Show Int16 

Methods

showsPrec :: Int -> Int16 -> ShowS #

show :: Int16 -> String #

showList :: [Int16] -> ShowS #

Show Int32 

Methods

showsPrec :: Int -> Int32 -> ShowS #

show :: Int32 -> String #

showList :: [Int32] -> ShowS #

Show Int64 

Methods

showsPrec :: Int -> Int64 -> ShowS #

show :: Int64 -> String #

showList :: [Int64] -> ShowS #

Show Integer 
Show Ordering 
Show Word 

Methods

showsPrec :: Int -> Word -> ShowS #

show :: Word -> String #

showList :: [Word] -> ShowS #

Show Word8 

Methods

showsPrec :: Int -> Word8 -> ShowS #

show :: Word8 -> String #

showList :: [Word8] -> ShowS #

Show Word16 
Show Word32 
Show Word64 
Show CallStack 
Show TypeRep 
Show () 

Methods

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

show :: () -> String #

showList :: [()] -> ShowS #

Show TyCon 

Methods

showsPrec :: Int -> TyCon -> ShowS #

show :: TyCon -> String #

showList :: [TyCon] -> ShowS #

Show Module 
Show TrName 
Show FD 

Methods

showsPrec :: Int -> FD -> ShowS #

show :: FD -> String #

showList :: [FD] -> ShowS #

Show HandleType 

Methods

showsPrec :: Int -> HandleType -> ShowS #

show :: HandleType -> String #

showList :: [HandleType] -> ShowS #

Show Natural 
Show Void 

Methods

showsPrec :: Int -> Void -> ShowS #

show :: Void -> String #

showList :: [Void] -> ShowS #

Show DataType 
Show Constr 
Show DataRep 
Show ConstrRep 
Show Fixity 
Show Version 
Show GCStats 
Show HandlePosn 
Show PatternMatchFail 
Show RecSelError 
Show RecConError 
Show RecUpdError 
Show NoMethodError 
Show TypeError 
Show NonTermination 
Show NestedAtomically 
Show CDev 

Methods

showsPrec :: Int -> CDev -> ShowS #

show :: CDev -> String #

showList :: [CDev] -> ShowS #

Show CIno 

Methods

showsPrec :: Int -> CIno -> ShowS #

show :: CIno -> String #

showList :: [CIno] -> ShowS #

Show CMode 

Methods

showsPrec :: Int -> CMode -> ShowS #

show :: CMode -> String #

showList :: [CMode] -> ShowS #

Show COff 

Methods

showsPrec :: Int -> COff -> ShowS #

show :: COff -> String #

showList :: [COff] -> ShowS #

Show CPid 

Methods

showsPrec :: Int -> CPid -> ShowS #

show :: CPid -> String #

showList :: [CPid] -> ShowS #

Show CSsize 
Show CGid 

Methods

showsPrec :: Int -> CGid -> ShowS #

show :: CGid -> String #

showList :: [CGid] -> ShowS #

Show CNlink 
Show CUid 

Methods

showsPrec :: Int -> CUid -> ShowS #

show :: CUid -> String #

showList :: [CUid] -> ShowS #

Show CCc 

Methods

showsPrec :: Int -> CCc -> ShowS #

show :: CCc -> String #

showList :: [CCc] -> ShowS #

Show CSpeed 
Show CTcflag 
Show CRLim 

Methods

showsPrec :: Int -> CRLim -> ShowS #

show :: CRLim -> String #

showList :: [CRLim] -> ShowS #

Show Fd 

Methods

showsPrec :: Int -> Fd -> ShowS #

show :: Fd -> String #

showList :: [Fd] -> ShowS #

Show ThreadId 
Show BlockReason 
Show ThreadStatus 
Show BlockedIndefinitelyOnMVar 
Show BlockedIndefinitelyOnSTM 
Show Deadlock 
Show AllocationLimitExceeded 
Show AssertionFailed 
Show SomeAsyncException 
Show AsyncException 
Show ArrayException 
Show ExitCode 
Show IOErrorType 
Show Handle 
Show BufferMode 
Show Newline 
Show NewlineMode 
Show WordPtr 
Show IntPtr 
Show CChar 

Methods

showsPrec :: Int -> CChar -> ShowS #

show :: CChar -> String #

showList :: [CChar] -> ShowS #

Show CSChar 
Show CUChar 
Show CShort 
Show CUShort 
Show CInt 

Methods

showsPrec :: Int -> CInt -> ShowS #

show :: CInt -> String #

showList :: [CInt] -> ShowS #

Show CUInt 

Methods

showsPrec :: Int -> CUInt -> ShowS #

show :: CUInt -> String #

showList :: [CUInt] -> ShowS #

Show CLong 

Methods

showsPrec :: Int -> CLong -> ShowS #

show :: CLong -> String #

showList :: [CLong] -> ShowS #

Show CULong 
Show CLLong 
Show CULLong 
Show CFloat 
Show CDouble 
Show CPtrdiff 
Show CSize 

Methods

showsPrec :: Int -> CSize -> ShowS #

show :: CSize -> String #

showList :: [CSize] -> ShowS #

Show CWchar 
Show CSigAtomic 
Show CClock 
Show CTime 

Methods

showsPrec :: Int -> CTime -> ShowS #

show :: CTime -> String #

showList :: [CTime] -> ShowS #

Show CUSeconds 
Show CSUSeconds 
Show CIntPtr 
Show CUIntPtr 
Show CIntMax 
Show CUIntMax 
Show SeekMode 
Show All 

Methods

showsPrec :: Int -> All -> ShowS #

show :: All -> String #

showList :: [All] -> ShowS #

Show Any 

Methods

showsPrec :: Int -> Any -> ShowS #

show :: Any -> String #

showList :: [Any] -> ShowS #

Show Fixity 
Show Associativity 
Show SourceUnpackedness 
Show SourceStrictness 
Show DecidedStrictness 
Show MaskingState 
Show IOException 
Show ErrorCall 
Show ArithException 
Show SomeNat 
Show SomeSymbol 
Show IOMode 
Show Lexeme 
Show Number 
Show GeneralCategory 
Show SomeException 
Show SrcLoc 
Show UTF32_Invalid 

Methods

showsPrec :: Int -> UTF32_Invalid -> ShowS #

show :: UTF32_Invalid -> String #

showList :: [UTF32_Invalid] -> ShowS #

Show UTF16_Invalid 

Methods

showsPrec :: Int -> UTF16_Invalid -> ShowS #

show :: UTF16_Invalid -> String #

showList :: [UTF16_Invalid] -> ShowS #

Show ISO_8859_1_Invalid 

Methods

showsPrec :: Int -> ISO_8859_1_Invalid -> ShowS #

show :: ISO_8859_1_Invalid -> String #

showList :: [ISO_8859_1_Invalid] -> ShowS #

Show ASCII7_Invalid 

Methods

showsPrec :: Int -> ASCII7_Invalid -> ShowS #

show :: ASCII7_Invalid -> String #

showList :: [ASCII7_Invalid] -> ShowS #

Show Encoding 
Show String 
Show AsciiString 
Show ValidationFailure 
Show OutOfBoundOperation 
Show OutOfBound 
Show RecastSourceSize 
Show RecastDestinationSize 
Show InvalidRecast 
Show NonEmptyCollectionIsEmpty 
Show FileSize 
Show Word256 
Show Word128 
Show Char7 

Methods

showsPrec :: Int -> Char7 -> ShowS #

show :: Char7 -> String #

showList :: [Char7] -> ShowS #

Show Endianness 
Show Arch # 

Methods

showsPrec :: Int -> Arch -> ShowS #

show :: Arch -> String #

showList :: [Arch] -> ShowS #

Show OS # 

Methods

showsPrec :: Int -> OS -> ShowS #

show :: OS -> String #

showList :: [OS] -> ShowS #

Show PartialError # 
Show Seconds # 
Show NanoSeconds # 
Show And # 

Methods

showsPrec :: Int -> And -> ShowS #

show :: And -> String #

showList :: [And] -> ShowS #

Show Condition # 
Show Bitmap # 
Show IPv4 # 

Methods

showsPrec :: Int -> IPv4 -> ShowS #

show :: IPv4 -> String #

showList :: [IPv4] -> ShowS #

Show IPv6 # 

Methods

showsPrec :: Int -> IPv6 -> ShowS #

show :: IPv6 -> String #

showList :: [IPv6] -> ShowS #

Show UUID # 

Methods

showsPrec :: Int -> UUID -> ShowS #

show :: UUID -> String #

showList :: [UUID] -> ShowS #

Show FileName # 
Show FilePath # 
Show Relativity # 
Show a => Show [a] 

Methods

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

show :: [a] -> String #

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

Show a => Show (Maybe a) 

Methods

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

show :: Maybe a -> String #

showList :: [Maybe a] -> ShowS #

Show a => Show (Ratio a) 

Methods

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

show :: Ratio a -> String #

showList :: [Ratio a] -> ShowS #

Show (Ptr a) 

Methods

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

show :: Ptr a -> String #

showList :: [Ptr a] -> ShowS #

Show (FunPtr a) 

Methods

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

show :: FunPtr a -> String #

showList :: [FunPtr a] -> ShowS #

Show (V1 p) 

Methods

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

show :: V1 p -> String #

showList :: [V1 p] -> ShowS #

Show (U1 p) 

Methods

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

show :: U1 p -> String #

showList :: [U1 p] -> ShowS #

Show p => Show (Par1 p) 

Methods

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

show :: Par1 p -> String #

showList :: [Par1 p] -> ShowS #

Show a => Show (Identity a)

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

Methods

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

show :: Identity a -> String #

showList :: [Identity a] -> ShowS #

Show a => Show (Min a) 

Methods

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

show :: Min a -> String #

showList :: [Min a] -> ShowS #

Show a => Show (Max a) 

Methods

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

show :: Max a -> String #

showList :: [Max a] -> ShowS #

Show a => Show (First a) 

Methods

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

show :: First a -> String #

showList :: [First a] -> ShowS #

Show a => Show (Last a) 

Methods

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

show :: Last a -> String #

showList :: [Last a] -> ShowS #

Show m => Show (WrappedMonoid m) 
Show a => Show (Option a) 

Methods

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

show :: Option a -> String #

showList :: [Option a] -> ShowS #

Show a => Show (NonEmpty a) 

Methods

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

show :: NonEmpty a -> String #

showList :: [NonEmpty a] -> ShowS #

Show a => Show (ZipList a) 

Methods

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

show :: ZipList a -> String #

showList :: [ZipList a] -> ShowS #

Show (ForeignPtr a) 
Show a => Show (Dual a) 

Methods

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

show :: Dual a -> String #

showList :: [Dual a] -> ShowS #

Show a => Show (Sum a) 

Methods

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

show :: Sum a -> String #

showList :: [Sum a] -> ShowS #

Show a => Show (Product a) 

Methods

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

show :: Product a -> String #

showList :: [Product a] -> ShowS #

Show a => Show (First a) 

Methods

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

show :: First a -> String #

showList :: [First a] -> ShowS #

Show a => Show (Last a) 

Methods

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

show :: Last a -> String #

showList :: [Last a] -> ShowS #

Show a => Show (Array a) 

Methods

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

show :: Array a -> String #

showList :: [Array a] -> ShowS #

(PrimType ty, Show ty) => Show (UArray ty) 

Methods

showsPrec :: Int -> UArray ty -> ShowS #

show :: UArray ty -> String #

showList :: [UArray ty] -> ShowS #

(PrimType ty, Show ty) => Show (Block ty) 

Methods

showsPrec :: Int -> Block ty -> ShowS #

show :: Block ty -> String #

showList :: [Block ty] -> ShowS #

Show (Zn64 n) 

Methods

showsPrec :: Int -> Zn64 n -> ShowS #

show :: Zn64 n -> String #

showList :: [Zn64 n] -> ShowS #

Show (Zn n) 

Methods

showsPrec :: Int -> Zn n -> ShowS #

show :: Zn n -> String #

showList :: [Zn n] -> ShowS #

Show a => Show (NonEmpty a) 

Methods

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

show :: NonEmpty a -> String #

showList :: [NonEmpty a] -> ShowS #

Show (Offset ty) 

Methods

showsPrec :: Int -> Offset ty -> ShowS #

show :: Offset ty -> String #

showList :: [Offset ty] -> ShowS #

Show (CountOf ty) 

Methods

showsPrec :: Int -> CountOf ty -> ShowS #

show :: CountOf ty -> String #

showList :: [CountOf ty] -> ShowS #

Show (FinalPtr a) 

Methods

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

show :: FinalPtr a -> String #

showList :: [FinalPtr a] -> ShowS #

Show a => Show (LE a) 

Methods

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

show :: LE a -> String #

showList :: [LE a] -> ShowS #

Show a => Show (BE a) 

Methods

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

show :: BE a -> String #

showList :: [BE a] -> ShowS #

Show a => Show (DList a) # 

Methods

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

show :: DList a -> String #

showList :: [DList a] -> ShowS #

Show (ParseError input) # 

Methods

showsPrec :: Int -> ParseError input -> ShowS #

show :: ParseError input -> String #

showList :: [ParseError input] -> ShowS #

(Show ty, PrimType ty) => Show (ChunkedUArray ty) # 
(Show b, Show a) => Show (Either a b) 

Methods

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

show :: Either a b -> String #

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

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

Methods

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

show :: Rec1 f p -> String #

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

Show (URec Char p) 

Methods

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

show :: URec Char p -> String #

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

Show (URec Double p) 

Methods

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

show :: URec Double p -> String #

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

Show (URec Float p) 

Methods

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

show :: URec Float p -> String #

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

Show (URec Int p) 

Methods

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

show :: URec Int p -> String #

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

Show (URec Word p) 

Methods

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

show :: URec Word p -> String #

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

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

Methods

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

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

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

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

Methods

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

show :: Array a b -> String #

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

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

Methods

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

show :: Arg a b -> String #

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

Show (Proxy k s) 

Methods

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

show :: Proxy k s -> String #

showList :: [Proxy k s] -> ShowS #

Show (ST s a) 

Methods

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

show :: ST s a -> String #

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

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

Methods

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

show :: These a b -> String #

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

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

Methods

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

show :: Tuple2 a b -> String #

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

Show k => Show (Result input k) # 

Methods

showsPrec :: Int -> Result input k -> ShowS #

show :: Result input k -> String #

showList :: [Result input k] -> ShowS #

Show c => Show (K1 i c p) 

Methods

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

show :: K1 i c p -> String #

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

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

Methods

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

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

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

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

Methods

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

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

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

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

Methods

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

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

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

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

Methods

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

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

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

Show a => Show (Const k a b)

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

Methods

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

show :: Const k a b -> String #

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

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

Methods

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

show :: Alt k f a -> String #

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

Show (Coercion k a b) 

Methods

showsPrec :: Int -> Coercion k a b -> ShowS #

show :: Coercion k a b -> String #

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

Show ((:~:) k a b) 

Methods

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

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

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

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

Methods

showsPrec :: Int -> Tuple3 a b c -> ShowS #

show :: Tuple3 a b c -> String #

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

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

Methods

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

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

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

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

Methods

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

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

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

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

Methods

showsPrec :: Int -> Tuple4 a b c d -> ShowS #

show :: Tuple4 a b c d -> String #

showList :: [Tuple4 a b c d] -> ShowS #

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

Methods

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

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

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

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

Methods

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

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

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

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

Methods

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

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

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

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

Methods

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

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

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

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

Methods

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

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

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

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

Methods

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

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

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

(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) 

Methods

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

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

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

(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) 

Methods

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

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

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

(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) 

Methods

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

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

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

(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) 

Methods

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

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

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

(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) 

Methods

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

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

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

show :: Show a => a -> String #

Use the Show class to create a String.

Note that this is not efficient, since an intermediate [Char] is going to be created before turning into a real String.

class Eq a => Ord a where #

The Ord class is used for totally ordered datatypes.

Instances of Ord can be derived for any user-defined datatype whose constituent types are in Ord. The declared order of the constructors in the data declaration determines the ordering in derived Ord instances. The Ordering datatype allows a single comparison to determine the precise ordering of two objects.

Minimal complete definition: either compare or <=. Using compare can be more efficient for complex types.

Minimal complete definition

compare | (<=)

Methods

compare :: a -> a -> Ordering #

(<) :: a -> a -> Bool infix 4 #

(<=) :: a -> a -> Bool infix 4 #

(>) :: a -> a -> Bool infix 4 #

(>=) :: a -> a -> Bool infix 4 #

max :: a -> a -> a #

min :: a -> a -> a #

Instances

Ord Bool 

Methods

compare :: Bool -> Bool -> Ordering #

(<) :: Bool -> Bool -> Bool #

(<=) :: Bool -> Bool -> Bool #

(>) :: Bool -> Bool -> Bool #

(>=) :: Bool -> Bool -> Bool #

max :: Bool -> Bool -> Bool #

min :: Bool -> Bool -> Bool #

Ord Char 

Methods

compare :: Char -> Char -> Ordering #

(<) :: Char -> Char -> Bool #

(<=) :: Char -> Char -> Bool #

(>) :: Char -> Char -> Bool #

(>=) :: Char -> Char -> Bool #

max :: Char -> Char -> Char #

min :: Char -> Char -> Char #

Ord Double 
Ord Float 

Methods

compare :: Float -> Float -> Ordering #

(<) :: Float -> Float -> Bool #

(<=) :: Float -> Float -> Bool #

(>) :: Float -> Float -> Bool #

(>=) :: Float -> Float -> Bool #

max :: Float -> Float -> Float #

min :: Float -> Float -> Float #

Ord Int 

Methods

compare :: Int -> Int -> Ordering #

(<) :: Int -> Int -> Bool #

(<=) :: Int -> Int -> Bool #

(>) :: Int -> Int -> Bool #

(>=) :: Int -> Int -> Bool #

max :: Int -> Int -> Int #

min :: Int -> Int -> Int #

Ord Int8 

Methods

compare :: Int8 -> Int8 -> Ordering #

(<) :: Int8 -> Int8 -> Bool #

(<=) :: Int8 -> Int8 -> Bool #

(>) :: Int8 -> Int8 -> Bool #

(>=) :: Int8 -> Int8 -> Bool #

max :: Int8 -> Int8 -> Int8 #

min :: Int8 -> Int8 -> Int8 #

Ord Int16 

Methods

compare :: Int16 -> Int16 -> Ordering #

(<) :: Int16 -> Int16 -> Bool #

(<=) :: Int16 -> Int16 -> Bool #

(>) :: Int16 -> Int16 -> Bool #

(>=) :: Int16 -> Int16 -> Bool #

max :: Int16 -> Int16 -> Int16 #

min :: Int16 -> Int16 -> Int16 #

Ord Int32 

Methods

compare :: Int32 -> Int32 -> Ordering #

(<) :: Int32 -> Int32 -> Bool #

(<=) :: Int32 -> Int32 -> Bool #

(>) :: Int32 -> Int32 -> Bool #

(>=) :: Int32 -> Int32 -> Bool #

max :: Int32 -> Int32 -> Int32 #

min :: Int32 -> Int32 -> Int32 #

Ord Int64 

Methods

compare :: Int64 -> Int64 -> Ordering #

(<) :: Int64 -> Int64 -> Bool #

(<=) :: Int64 -> Int64 -> Bool #

(>) :: Int64 -> Int64 -> Bool #

(>=) :: Int64 -> Int64 -> Bool #

max :: Int64 -> Int64 -> Int64 #

min :: Int64 -> Int64 -> Int64 #

Ord Integer 
Ord Ordering 
Ord Word 

Methods

compare :: Word -> Word -> Ordering #

(<) :: Word -> Word -> Bool #

(<=) :: Word -> Word -> Bool #

(>) :: Word -> Word -> Bool #

(>=) :: Word -> Word -> Bool #

max :: Word -> Word -> Word #

min :: Word -> Word -> Word #

Ord Word8 

Methods

compare :: Word8 -> Word8 -> Ordering #

(<) :: Word8 -> Word8 -> Bool #

(<=) :: Word8 -> Word8 -> Bool #

(>) :: Word8 -> Word8 -> Bool #

(>=) :: Word8 -> Word8 -> Bool #

max :: Word8 -> Word8 -> Word8 #

min :: Word8 -> Word8 -> Word8 #

Ord Word16 
Ord Word32 
Ord Word64 
Ord TypeRep 
Ord () 

Methods

compare :: () -> () -> Ordering #

(<) :: () -> () -> Bool #

(<=) :: () -> () -> Bool #

(>) :: () -> () -> Bool #

(>=) :: () -> () -> Bool #

max :: () -> () -> () #

min :: () -> () -> () #

Ord TyCon 

Methods

compare :: TyCon -> TyCon -> Ordering #

(<) :: TyCon -> TyCon -> Bool #

(<=) :: TyCon -> TyCon -> Bool #

(>) :: TyCon -> TyCon -> Bool #

(>=) :: TyCon -> TyCon -> Bool #

max :: TyCon -> TyCon -> TyCon #

min :: TyCon -> TyCon -> TyCon #

Ord BigNat 
Ord Natural 
Ord Void 

Methods

compare :: Void -> Void -> Ordering #

(<) :: Void -> Void -> Bool #

(<=) :: Void -> Void -> Bool #

(>) :: Void -> Void -> Bool #

(>=) :: Void -> Void -> Bool #

max :: Void -> Void -> Void #

min :: Void -> Void -> Void #

Ord Version 
Ord CDev 

Methods

compare :: CDev -> CDev -> Ordering #

(<) :: CDev -> CDev -> Bool #

(<=) :: CDev -> CDev -> Bool #

(>) :: CDev -> CDev -> Bool #

(>=) :: CDev -> CDev -> Bool #

max :: CDev -> CDev -> CDev #

min :: CDev -> CDev -> CDev #

Ord CIno 

Methods

compare :: CIno -> CIno -> Ordering #

(<) :: CIno -> CIno -> Bool #

(<=) :: CIno -> CIno -> Bool #

(>) :: CIno -> CIno -> Bool #

(>=) :: CIno -> CIno -> Bool #

max :: CIno -> CIno -> CIno #

min :: CIno -> CIno -> CIno #

Ord CMode 

Methods

compare :: CMode -> CMode -> Ordering #

(<) :: CMode -> CMode -> Bool #

(<=) :: CMode -> CMode -> Bool #

(>) :: CMode -> CMode -> Bool #

(>=) :: CMode -> CMode -> Bool #

max :: CMode -> CMode -> CMode #

min :: CMode -> CMode -> CMode #

Ord COff 

Methods

compare :: COff -> COff -> Ordering #

(<) :: COff -> COff -> Bool #

(<=) :: COff -> COff -> Bool #

(>) :: COff -> COff -> Bool #

(>=) :: COff -> COff -> Bool #

max :: COff -> COff -> COff #

min :: COff -> COff -> COff #

Ord CPid 

Methods

compare :: CPid -> CPid -> Ordering #

(<) :: CPid -> CPid -> Bool #

(<=) :: CPid -> CPid -> Bool #

(>) :: CPid -> CPid -> Bool #

(>=) :: CPid -> CPid -> Bool #

max :: CPid -> CPid -> CPid #

min :: CPid -> CPid -> CPid #

Ord CSsize 
Ord CGid 

Methods

compare :: CGid -> CGid -> Ordering #

(<) :: CGid -> CGid -> Bool #

(<=) :: CGid -> CGid -> Bool #

(>) :: CGid -> CGid -> Bool #

(>=) :: CGid -> CGid -> Bool #

max :: CGid -> CGid -> CGid #

min :: CGid -> CGid -> CGid #

Ord CNlink 
Ord CUid 

Methods

compare :: CUid -> CUid -> Ordering #

(<) :: CUid -> CUid -> Bool #

(<=) :: CUid -> CUid -> Bool #

(>) :: CUid -> CUid -> Bool #

(>=) :: CUid -> CUid -> Bool #

max :: CUid -> CUid -> CUid #

min :: CUid -> CUid -> CUid #

Ord CCc 

Methods

compare :: CCc -> CCc -> Ordering #

(<) :: CCc -> CCc -> Bool #

(<=) :: CCc -> CCc -> Bool #

(>) :: CCc -> CCc -> Bool #

(>=) :: CCc -> CCc -> Bool #

max :: CCc -> CCc -> CCc #

min :: CCc -> CCc -> CCc #

Ord CSpeed 
Ord CTcflag 
Ord CRLim 

Methods

compare :: CRLim -> CRLim -> Ordering #

(<) :: CRLim -> CRLim -> Bool #

(<=) :: CRLim -> CRLim -> Bool #

(>) :: CRLim -> CRLim -> Bool #

(>=) :: CRLim -> CRLim -> Bool #

max :: CRLim -> CRLim -> CRLim #

min :: CRLim -> CRLim -> CRLim #

Ord Fd 

Methods

compare :: Fd -> Fd -> Ordering #

(<) :: Fd -> Fd -> Bool #

(<=) :: Fd -> Fd -> Bool #

(>) :: Fd -> Fd -> Bool #

(>=) :: Fd -> Fd -> Bool #

max :: Fd -> Fd -> Fd #

min :: Fd -> Fd -> Fd #

Ord ThreadId 
Ord BlockReason 
Ord ThreadStatus 
Ord AsyncException 
Ord ArrayException 
Ord ExitCode 
Ord BufferMode 
Ord Newline