base-4.11.0.0: Basic libraries

Copyright(c) The University of Glasgow 2001
LicenseBSD-style (see the file libraries/base/LICENSE)
Maintainerlibraries@haskell.org
Stabilitystable
Portabilityportable
Safe HaskellTrustworthy
LanguageHaskell2010

Prelude

Contents

Description

The Prelude: a standard module. The Prelude is imported by default into all Haskell modules unless either there is an explicit import statement for it, or the NoImplicitPrelude extension is enabled.

Synopsis

Standard types, classes and related functions

Basic data types

data Bool #

Constructors

False 
True 
Instances
Bounded Bool Source #

Since: 2.1

Instance details
Enum Bool Source #

Since: 2.1

Instance details
Eq Bool 
Instance details

Methods

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

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

Data Bool Source #

Since: 4.0.0.0

Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bool -> c Bool Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bool Source #

toConstr :: Bool -> Constr Source #

dataTypeOf :: Bool -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bool) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bool) Source #

gmapT :: (forall b. Data b => b -> b) -> Bool -> Bool Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Bool -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Bool -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bool -> m Bool Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool Source #

Ord Bool 
Instance details

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 #

Read Bool Source #

Since: 2.1

Instance details
Show Bool Source # 
Instance details
Ix Bool Source #

Since: 2.1

Instance details
Generic Bool Source # 
Instance details

Associated Types

type Rep Bool :: * -> * Source #

Methods

from :: Bool -> Rep Bool x Source #

to :: Rep Bool x -> Bool Source #

FiniteBits Bool Source #

Since: 4.7.0.0

Instance details
Bits Bool Source #

Interpret Bool as 1-bit bit-field

Since: 4.7.0.0

Instance details
Storable Bool Source #

Since: 2.1

Instance details
type Rep Bool Source # 
Instance details
type Rep Bool = D1 (MetaData "Bool" "GHC.Types" "ghc-prim" False) (C1 (MetaCons "False" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "True" PrefixI False) (U1 :: * -> *))

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

Boolean "and"

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

Boolean "or"

not :: Bool -> Bool #

Boolean "not"

otherwise :: Bool Source #

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

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

data Maybe a Source #

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

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

Constructors

Nothing 
Just a 
Instances
Monad Maybe Source #

Since: 2.1

Instance details

Methods

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

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

return :: a -> Maybe a Source #

fail :: String -> Maybe a Source #

Functor Maybe Source #

Since: 2.1

Instance details

Methods

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

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

MonadFix Maybe Source #

Since: 2.1

Instance details

Methods

mfix :: (a -> Maybe a) -> Maybe a Source #

MonadFail Maybe Source #

Since: 4.9.0.0

Instance details

Methods

fail :: String -> Maybe a Source #

Applicative Maybe Source #

Since: 2.1

Instance details

Methods

pure :: a -> Maybe a Source #

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

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

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

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

Foldable Maybe Source #

Since: 2.1

Instance details

Methods

fold :: Monoid m => Maybe m -> m Source #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m Source #

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

foldr' :: (a -> b -> b) -> b -> Maybe a -> b Source #

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

foldl' :: (b -> a -> b) -> b -> Maybe a -> b Source #

foldr1 :: (a -> a -> a) -> Maybe a -> a Source #

foldl1 :: (a -> a -> a) -> Maybe a -> a Source #

toList :: Maybe a -> [a] Source #

null :: Maybe a -> Bool Source #

length :: Maybe a -> Int Source #

elem :: Eq a => a -> Maybe a -> Bool Source #

maximum :: Ord a => Maybe a -> a Source #

minimum :: Ord a => Maybe a -> a Source #

sum :: Num a => Maybe a -> a Source #

product :: Num a => Maybe a -> a Source #

Traversable Maybe Source #

Since: 2.1

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) Source #

sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) Source #

mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) Source #

sequence :: Monad m => Maybe (m a) -> m (Maybe a) Source #

MonadPlus Maybe Source #

Since: 2.1

Instance details

Methods

mzero :: Maybe a Source #

mplus :: Maybe a -> Maybe a -> Maybe a Source #

Alternative Maybe Source #

Since: 2.1

Instance details

Methods

empty :: Maybe a Source #

(<|>) :: Maybe a -> Maybe a -> Maybe a Source #

some :: Maybe a -> Maybe [a] Source #

many :: Maybe a -> Maybe [a] Source #

MonadZip Maybe Source #

Since: 4.8.0.0

Instance details

Methods

mzip :: Maybe a -> Maybe b -> Maybe (a, b) Source #

mzipWith :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c Source #

munzip :: Maybe (a, b) -> (Maybe a, Maybe b) Source #

Show1 Maybe Source #

Since: 4.9.0.0

Instance details

Methods

liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS Source #

liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS Source #

Read1 Maybe Source #

Since: 4.9.0.0

Instance details
Ord1 Maybe Source #

Since: 4.9.0.0

Instance details

Methods

liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering Source #

Eq1 Maybe Source #

Since: 4.9.0.0

Instance details

Methods

liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool Source #

Eq a => Eq (Maybe a) Source # 
Instance details

Methods

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

(/=) :: Maybe a -> Maybe a -> Bool #

Data a => Data (Maybe a) Source #

Since: 4.0.0.0

Instance details

Methods

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

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

toConstr :: Maybe a -> Constr Source #

dataTypeOf :: Maybe a -> DataType Source #

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

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

gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r Source #

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

gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) Source #

Ord a => Ord (Maybe a) Source # 
Instance details

Methods

compare :: Maybe a -> Maybe a -> Ordering #

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

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

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

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

max :: Maybe a -> Maybe a -> Maybe a #

min :: Maybe a -> Maybe a -> Maybe a #

Read a => Read (Maybe a) Source #

Since: 2.1

Instance details
Show a => Show (Maybe a) Source # 
Instance details
Generic (Maybe a) Source # 
Instance details

Associated Types

type Rep (Maybe a) :: * -> * Source #

Methods

from :: Maybe a -> Rep (Maybe a) x Source #

to :: Rep (Maybe a) x -> Maybe a Source #

Semigroup a => Semigroup (Maybe a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Maybe a -> Maybe a -> Maybe a Source #

sconcat :: NonEmpty (Maybe a) -> Maybe a Source #

stimes :: Integral b => b -> Maybe a -> Maybe a Source #

Semigroup a => Monoid (Maybe a) Source #

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."

Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.

Since: 2.1

Instance details

Methods

mempty :: Maybe a Source #

mappend :: Maybe a -> Maybe a -> Maybe a Source #

mconcat :: [Maybe a] -> Maybe a Source #

Generic1 Maybe Source # 
Instance details

Associated Types

type Rep1 Maybe :: k -> * Source #

Methods

from1 :: Maybe a -> Rep1 Maybe a Source #

to1 :: Rep1 Maybe a -> Maybe a Source #

type Rep (Maybe a) Source # 
Instance details
type Rep (Maybe a) = D1 (MetaData "Maybe" "GHC.Base" "base" False) (C1 (MetaCons "Nothing" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "Just" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)))
type Rep1 Maybe Source # 
Instance details

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

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

Examples

Expand

Basic usage:

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

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

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

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

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

data Either a b Source #

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

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

Examples

Expand

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

>>> let s = Left "foo" :: Either String Int
>>> s
Left "foo"
>>> let n = Right 3 :: Either String Int
>>> n
Right 3
>>> :type s
s :: Either String Int
>>> :type n
n :: Either String Int

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

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

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

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

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

>>> :{
    let parseMultiple :: Either String Int
        parseMultiple = do
          x <- parseEither '1'
          y <- parseEither '2'
          return (x + y)
>>> :}
>>> parseMultiple
Right 3

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

>>> :{
    let parseMultiple :: Either String Int
        parseMultiple = do
          x <- parseEither 'm'
          y <- parseEither '2'
          return (x + y)
>>> :}
>>> parseMultiple
Left "parse error"

Constructors

Left a 
Right b 
Instances
Show2 Either Source #

Since: 4.9.0.0

Instance details

Methods

liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Either a b -> ShowS Source #

liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Either a b] -> ShowS Source #

Read2 Either Source #

Since: 4.9.0.0

Instance details

Methods

liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Either a b) Source #

liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] Source #

liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) Source #

liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] Source #

Ord2 Either Source #

Since: 4.9.0.0

Instance details

Methods

liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Either a c -> Either b d -> Ordering Source #

Eq2 Either Source #

Since: 4.9.0.0

Instance details

Methods

liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Either a c -> Either b d -> Bool Source #

Bifunctor Either Source #

Since: 4.8.0.0

Instance details

Methods

bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d Source #

first :: (a -> b) -> Either a c -> Either b c Source #

second :: (b -> c) -> Either a b -> Either a c Source #

Bifoldable Either Source #

Since: 4.10.0.0

Instance details

Methods

bifold :: Monoid m => Either m m -> m Source #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Either a b -> m Source #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Either a b -> c Source #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Either a b -> c Source #

Bitraversable Either Source #

Since: 4.10.0.0

Instance details

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Either a b -> f (Either c d) Source #

Monad (Either e) Source #

Since: 4.4.0.0

Instance details

Methods

(>>=) :: Either e a -> (a -> Either e b) -> Either e b Source #

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

return :: a -> Either e a Source #

fail :: String -> Either e a Source #

Functor (Either a) Source #

Since: 3.0

Instance details

Methods

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

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

MonadFix (Either e) Source #

Since: 4.3.0.0

Instance details

Methods

mfix :: (a -> Either e a) -> Either e a Source #

Applicative (Either e) Source #

Since: 3.0

Instance details

Methods

pure :: a -> Either e a Source #

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

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

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

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

Foldable (Either a) Source #

Since: 4.7.0.0

Instance details

Methods

fold :: Monoid m => Either a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

toList :: Either a a0 -> [a0] Source #

null :: Either a a0 -> Bool Source #

length :: Either a a0 -> Int Source #

elem :: Eq a0 => a0 -> Either a a0 -> Bool Source #

maximum :: Ord a0 => Either a a0 -> a0 Source #

minimum :: Ord a0 => Either a a0 -> a0 Source #

sum :: Num a0 => Either a a0 -> a0 Source #

product :: Num a0 => Either a a0 -> a0 Source #

Traversable (Either a) Source #

Since: 4.7.0.0

Instance details

Methods

traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) Source #

sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) Source #

mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) Source #

sequence :: Monad m => Either a (m a0) -> m (Either a a0) Source #

Show a => Show1 (Either a) Source #

Since: 4.9.0.0

Instance details

Methods

liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Either a a0 -> ShowS Source #

liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Either a a0] -> ShowS Source #

Read a => Read1 (Either a) Source #

Since: 4.9.0.0

Instance details

Methods

liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Either a a0) Source #

liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] Source #

liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) Source #

liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] Source #

Ord a => Ord1 (Either a) Source #

Since: 4.9.0.0

Instance details

Methods

liftCompare :: (a0 -> b -> Ordering) -> Either a a0 -> Either a b -> Ordering Source #

Eq a => Eq1 (Either a) Source #

Since: 4.9.0.0

Instance details

Methods

liftEq :: (a0 -> b -> Bool) -> Either a a0 -> Either a b -> Bool Source #

Generic1 (Either a :: * -> *) Source # 
Instance details

Associated Types

type Rep1 (Either a) :: k -> * Source #

Methods

from1 :: Either a a0 -> Rep1 (Either a) a0 Source #

to1 :: Rep1 (Either a) a0 -> Either a a0 Source #

(Eq a, Eq b) => Eq (Either a b) Source # 
Instance details

Methods

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

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

(Data a, Data b) => Data (Either a b) Source #

Since: 4.0.0.0

Instance details

Methods

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

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

toConstr :: Either a b -> Constr Source #

dataTypeOf :: Either a b -> DataType Source #

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

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

gmapT :: (forall b0. Data b0 => b0 -> b0) -> Either a b -> Either a b Source #

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

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

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

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

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

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

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

(Ord a, Ord b) => Ord (Either a b) Source # 
Instance details

Methods

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

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

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

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

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

max :: Either a b -> Either a b -> Either a b #

min :: Either a b -> Either a b -> Either a b #

(Read a, Read b) => Read (Either a b) Source # 
Instance details
(Show a, Show b) => Show (Either a b) Source # 
Instance details

Methods

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

show :: Either a b -> String Source #

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

Generic (Either a b) Source # 
Instance details

Associated Types

type Rep (Either a b) :: * -> * Source #

Methods

from :: Either a b -> Rep (Either a b) x Source #

to :: Rep (Either a b) x -> Either a b Source #

Semigroup (Either a b) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Either a b -> Either a b -> Either a b Source #

sconcat :: NonEmpty (Either a b) -> Either a b Source #

stimes :: Integral b0 => b0 -> Either a b -> Either a b Source #

type Rep1 (Either a :: * -> *) Source # 
Instance details
type Rep (Either a b) Source # 
Instance details

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

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

Examples

Expand

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

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

data Ordering #

Constructors

LT 
EQ 
GT 
Instances
Bounded Ordering Source #

Since: 2.1

Instance details
Enum Ordering Source #

Since: 2.1

Instance details
Eq Ordering 
Instance details
Data Ordering Source #

Since: 4.0.0.0

Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ordering -> c Ordering Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ordering Source #

toConstr :: Ordering -> Constr Source #

dataTypeOf :: Ordering -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ordering) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ordering) Source #

gmapT :: (forall b. Data b => b -> b) -> Ordering -> Ordering Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Ordering -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Ordering -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering Source #

Ord Ordering 
Instance details
Read Ordering Source #

Since: 2.1

Instance details
Show Ordering Source # 
Instance details
Ix Ordering Source #

Since: 2.1

Instance details
Generic Ordering Source # 
Instance details

Associated Types

type Rep Ordering :: * -> * Source #

Semigroup Ordering Source #

Since: 4.9.0.0

Instance details
Monoid Ordering Source #

Since: 2.1

Instance details
type Rep Ordering Source # 
Instance details
type Rep Ordering = D1 (MetaData "Ordering" "GHC.Types" "ghc-prim" False) (C1 (MetaCons "LT" PrefixI False) (U1 :: * -> *) :+: (C1 (MetaCons "EQ" PrefixI False) (U1 :: * -> *) :+: C1 (MetaCons "GT" PrefixI False) (U1 :: * -> *)))

data Char #

The character type Char is an enumeration whose values represent Unicode (or equivalently ISO/IEC 10646) code points (i.e. characters, see http://www.unicode.org/ for details). This set extends the ISO 8859-1 (Latin-1) character set (the first 256 characters), which is itself an extension of the ASCII character set (the first 128 characters). A character literal in Haskell has type Char.

To convert a Char to or from the corresponding Int value defined by Unicode, use toEnum and fromEnum from the Enum class respectively (or equivalently ord and chr).

Instances
Bounded Char Source #

Since: 2.1

Instance details
Enum Char Source #

Since: 2.1

Instance details
Eq Char 
Instance details

Methods

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

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

Data Char Source #

Since: 4.0.0.0

Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Char -> c Char Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char Source #

toConstr :: Char -> Constr Source #

dataTypeOf :: Char -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Char) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) Source #

gmapT :: (forall b. Data b => b -> b) -> Char -> Char Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char Source #

Ord Char 
Instance details

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 #

Read Char Source #

Since: 2.1

Instance details
Show Char Source #

Since: 2.1

Instance details
Ix Char Source #

Since: 2.1

Instance details
Storable Char Source #

Since: 2.1

Instance details
IsChar Char Source #

Since: 2.1

Instance details
PrintfArg Char Source #

Since: 2.1

Instance details
Generic1 (URec Char :: k -> *) Source # 
Instance details

Associated Types

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

Methods

from1 :: URec Char a -> Rep1 (URec Char) a Source #

to1 :: Rep1 (URec Char) a -> URec Char a Source #

Functor (URec Char :: * -> *) Source # 
Instance details

Methods

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

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

Foldable (URec Char :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Char m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Char a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Char a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Char a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Char a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Char a -> b Source #

foldr1 :: (a -> a -> a) -> URec Char a -> a Source #

foldl1 :: (a -> a -> a) -> URec Char a -> a Source #

toList :: URec Char a -> [a] Source #

null :: URec Char a -> Bool Source #

length :: URec Char a -> Int Source #

elem :: Eq a => a -> URec Char a -> Bool Source #

maximum :: Ord a => URec Char a -> a Source #

minimum :: Ord a => URec Char a -> a Source #

sum :: Num a => URec Char a -> a Source #

product :: Num a => URec Char a -> a Source #

Traversable (URec Char :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) Source #

sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) Source #

mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) Source #

sequence :: Monad m => URec Char (m a) -> m (URec Char a) Source #

Eq (URec Char p) # 
Instance details

Methods

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

(/=) :: URec Char p -> URec Char p -> Bool #

Ord (URec Char p) # 
Instance details

Methods

compare :: URec Char p -> URec Char p -> Ordering #

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

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

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

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

max :: URec Char p -> URec Char p -> URec Char p #

min :: URec Char p -> URec Char p -> URec Char p #

Show (URec Char p) Source # 
Instance details
Generic (URec Char p) Source # 
Instance details

Associated Types

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

Methods

from :: URec Char p -> Rep (URec Char p) x Source #

to :: Rep (URec Char p) x -> URec Char p Source #

data URec Char (p :: k) Source #

Used for marking occurrences of Char#

Since: 4.9.0.0

Instance details
data URec Char (p :: k) = UChar {}
type Rep1 (URec Char :: k -> *) Source # 
Instance details
type Rep1 (URec Char :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UChar" PrefixI True) (S1 (MetaSel (Just "uChar#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UChar :: k -> *)))
type Rep (URec Char p) Source # 
Instance details
type Rep (URec Char p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UChar" PrefixI True) (S1 (MetaSel (Just "uChar#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UChar :: * -> *)))

type String = [Char] Source #

A String is a list of characters. String constants in Haskell are values of type String.

Tuples

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

Extract the first component of a pair.

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

Extract the second component of a pair.

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

curry converts an uncurried function to a curried function.

Examples

Expand
>>> curry fst 1 2
1

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

uncurry converts a curried function to a function on pairs.

Examples

Expand
>>> uncurry (+) (1,2)
3
>>> uncurry ($) (show, 1)
"1"
>>> map (uncurry max) [(1,2), (3,4), (6,8)]
[2,4,8]

Basic type classes

class Eq a where #

The Eq class defines equality (==) and inequality (/=). All the basic datatypes exported by the Prelude are instances of Eq, and Eq may be derived for any datatype whose constituents are also instances of Eq.

Minimal complete definition: either == or /=.

Minimal complete definition

(==) | (/=)

Methods

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

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

Instances
Eq Bool 
Instance details

Methods

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

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

Eq Char 
Instance details

Methods

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

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

Eq Double 
Instance details

Methods

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

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

Eq Float 
Instance details

Methods

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

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

Eq Int 
Instance details

Methods

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

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

Eq Int8 #

Since: 2.1

Instance details

Methods

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

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

Eq Int16 #

Since: 2.1

Instance details

Methods

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

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

Eq Int32 #

Since: 2.1

Instance details

Methods

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

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

Eq Int64 #

Since: 2.1

Instance details

Methods

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

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

Eq Integer 
Instance details

Methods

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

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

Eq Natural # 
Instance details

Methods

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

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

Eq Ordering 
Instance details
Eq Word 
Instance details

Methods

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

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

Eq Word8 #

Since: 2.1

Instance details

Methods

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

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

Eq Word16 #

Since: 2.1

Instance details

Methods

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

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

Eq Word32 #

Since: 2.1

Instance details

Methods

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

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

Eq Word64 #

Since: 2.1

Instance details

Methods

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

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

Eq SomeTypeRep # 
Instance details
Eq () 
Instance details

Methods

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

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

Eq TyCon 
Instance details

Methods

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

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

Eq Module 
Instance details

Methods

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

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

Eq TrName 
Instance details

Methods

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

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

Eq BigNat 
Instance details

Methods

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

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

Eq SrcLoc # 
Instance details

Methods

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

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

Eq GeneralCategory # 
Instance details
Eq Number # 
Instance details

Methods

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

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

Eq Lexeme # 
Instance details

Methods

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

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

Eq Fingerprint # 
Instance details
Eq IOMode # 
Instance details

Methods

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

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

Eq IntPtr # 
Instance details

Methods

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

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

Eq WordPtr # 
Instance details

Methods

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

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

Eq CUIntMax # 
Instance details
Eq CIntMax # 
Instance details

Methods

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

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

Eq CUIntPtr # 
Instance details
Eq CIntPtr # 
Instance details

Methods

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

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

Eq CSUSeconds # 
Instance details
Eq CUSeconds # 
Instance details
Eq CTime # 
Instance details

Methods

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

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

Eq CClock # 
Instance details

Methods

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

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

Eq CSigAtomic # 
Instance details
Eq CWchar # 
Instance details

Methods

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

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

Eq CSize # 
Instance details

Methods

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

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

Eq CPtrdiff # 
Instance details
Eq CDouble # 
Instance details

Methods

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

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

Eq CFloat # 
Instance details

Methods

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

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

Eq CBool # 
Instance details

Methods

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

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

Eq CULLong # 
Instance details

Methods

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

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

Eq CLLong # 
Instance details

Methods

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

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

Eq CULong # 
Instance details

Methods

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

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

Eq CLong # 
Instance details

Methods

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

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

Eq CUInt # 
Instance details

Methods

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

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

Eq CInt # 
Instance details

Methods

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

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

Eq CUShort # 
Instance details

Methods

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

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

Eq CShort # 
Instance details

Methods

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

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

Eq CUChar # 
Instance details

Methods

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

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

Eq CSChar # 
Instance details

Methods

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

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

Eq CChar # 
Instance details

Methods

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

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

Eq SomeNat #

Since: 4.7.0.0

Instance details

Methods

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

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

Eq SomeSymbol #

Since: 4.7.0.0

Instance details
Eq DecidedStrictness # 
Instance details
Eq SourceStrictness # 
Instance details
Eq SourceUnpackedness # 
Instance details
Eq Associativity # 
Instance details
Eq Fixity # 
Instance details

Methods

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

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

Eq Any # 
Instance details

Methods

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

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

Eq All # 
Instance details

Methods

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

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

Eq ArithException # 
Instance details
Eq ErrorCall # 
Instance details
Eq IOException #

Since: 4.1.0.0

Instance details
Eq MaskingState # 
Instance details
Eq BufferState # 
Instance details
Eq CodingProgress # 
Instance details
Eq SeekMode # 
Instance details
Eq IODeviceType # 
Instance details
Eq NewlineMode # 
Instance details
Eq Newline # 
Instance details

Methods

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

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

Eq BufferMode # 
Instance details
Eq Handle #

Since: 4.1.0.0

Instance details

Methods

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

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

Eq IOErrorType #

Since: 4.1.0.0

Instance details
Eq ExitCode # 
Instance details
Eq ArrayException # 
Instance details
Eq AsyncException # 
Instance details
Eq Errno #

Since: 2.1

Instance details

Methods

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

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

Eq Fd # 
Instance details

Methods

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

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

Eq CTimer # 
Instance details

Methods

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

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

Eq CKey # 
Instance details

Methods

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

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

Eq CId # 
Instance details

Methods

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

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

Eq CFsFilCnt # 
Instance details
Eq CFsBlkCnt # 
Instance details
Eq CClockId # 
Instance details
Eq CBlkCnt # 
Instance details

Methods

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

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

Eq CBlkSize # 
Instance details
Eq CRLim # 
Instance details

Methods

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

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

Eq CTcflag # 
Instance details

Methods

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

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

Eq CSpeed # 
Instance details

Methods

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

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

Eq CCc # 
Instance details

Methods

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

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

Eq CUid # 
Instance details

Methods

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

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

Eq CNlink # 
Instance details

Methods

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

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

Eq CGid # 
Instance details

Methods

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

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

Eq CSsize # 
Instance details

Methods

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

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

Eq CPid # 
Instance details

Methods

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

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

Eq COff # 
Instance details

Methods

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

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

Eq CMode # 
Instance details

Methods

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

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

Eq CIno # 
Instance details

Methods

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

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

Eq CDev # 
Instance details

Methods

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

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

Eq Lifetime # 
Instance details
Eq Event # 
Instance details

Methods

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

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

Eq ThreadStatus # 
Instance details
Eq BlockReason # 
Instance details
Eq ThreadId #

Since: 4.2.0.0

Instance details
Eq TimeoutKey # 
Instance details
Eq FdKey # 
Instance details

Methods

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

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

Eq HandlePosn #

Since: 4.1.0.0

Instance details
Eq Version #

Since: 2.1

Instance details

Methods

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

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

Eq ByteOrder # 
Instance details
Eq Unique # 
Instance details

Methods

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

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

Eq Fixity # 
Instance details

Methods

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

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

Eq ConstrRep # 
Instance details
Eq DataRep # 
Instance details

Methods

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

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

Eq Constr #

Equality of constructors

Since: 4.0.0.0

Instance details

Methods

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

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

Eq SpecConstrAnnotation # 
Instance details
Eq Void #

Since: 4.8.0.0

Instance details

Methods

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

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

Eq a => Eq [a] 
Instance details

Methods

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

(/=) :: [a] -> [a] -> Bool #

Eq a => Eq (Maybe a) # 
Instance details

Methods

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

(/=) :: Maybe a -> Maybe a -> Bool #

Eq a => Eq (Ratio a) # 
Instance details

Methods

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

(/=) :: Ratio a -> Ratio a -> Bool #

Eq (StablePtr a) #

Since: 2.1

Instance details

Methods

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

(/=) :: StablePtr a -> StablePtr a -> Bool #

Eq (Ptr a) # 
Instance details

Methods

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

(/=) :: Ptr a -> Ptr a -> Bool #

Eq (FunPtr a) # 
Instance details

Methods

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

(/=) :: FunPtr a -> FunPtr a -> Bool #

Eq p => Eq (Par1 p) # 
Instance details

Methods

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

(/=) :: Par1 p -> Par1 p -> Bool #

Eq a => Eq (NonEmpty a) # 
Instance details

Methods

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

(/=) :: NonEmpty a -> NonEmpty a -> Bool #

Eq (MVar a) #

Since: 4.1.0.0

Instance details

Methods

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

(/=) :: MVar a -> MVar a -> Bool #

Eq a => Eq (Down a) # 
Instance details

Methods

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

(/=) :: Down a -> Down a -> Bool #

Eq a => Eq (Product a) # 
Instance details

Methods

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

(/=) :: Product a -> Product a -> Bool #

Eq a => Eq (Sum a) # 
Instance details

Methods

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

(/=) :: Sum a -> Sum a -> Bool #

Eq a => Eq (Dual a) # 
Instance details

Methods

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

(/=) :: Dual a -> Dual a -> Bool #

Eq a => Eq (Last a) # 
Instance details

Methods

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

(/=) :: Last a -> Last a -> Bool #

Eq a => Eq (First a) # 
Instance details

Methods

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

(/=) :: First a -> First a -> Bool #

Eq (IORef a) #

Pointer equality.

Since: 4.1.0.0

Instance details

Methods

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

(/=) :: IORef a -> IORef a -> Bool #

Eq (ForeignPtr a) #

Since: 2.1

Instance details

Methods

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

(/=) :: ForeignPtr a -> ForeignPtr a -> Bool #

Eq (TVar a) #

Since: 4.8.0.0

Instance details

Methods

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

(/=) :: TVar a -> TVar a -> Bool #

Eq a => Eq (Identity a) # 
Instance details

Methods

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

(/=) :: Identity a -> Identity a -> Bool #

Eq a => Eq (ZipList a) # 
Instance details

Methods

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

(/=) :: ZipList a -> ZipList a -> Bool #

Eq (StableName a) #

Since: 2.1

Instance details

Methods

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

(/=) :: StableName a -> StableName a -> Bool #

Eq (Chan a) # 
Instance details

Methods

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

(/=) :: Chan a -> Chan a -> Bool #

Eq a => Eq (Option a) # 
Instance details

Methods

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

(/=) :: Option a -> Option a -> Bool #

Eq m => Eq (WrappedMonoid m) # 
Instance details
Eq a => Eq (Last a) # 
Instance details

Methods

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

(/=) :: Last a -> Last a -> Bool #

Eq a => Eq (First a) # 
Instance details

Methods

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

(/=) :: First a -> First a -> Bool #

Eq a => Eq (Max a) # 
Instance details

Methods

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

(/=) :: Max a -> Max a -> Bool #

Eq a => Eq (Min a) # 
Instance details

Methods

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

(/=) :: Min a -> Min a -> Bool #

Eq (Fixed a) # 
Instance details

Methods

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

(/=) :: Fixed a -> Fixed a -> Bool #

Eq a => Eq (Complex a) # 
Instance details

Methods

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

(/=) :: Complex a -> Complex a -> Bool #

(Eq a, Eq b) => Eq (Either a b) # 
Instance details

Methods

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

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

Eq (V1 p) #

Since: 4.9.0.0

Instance details

Methods

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

(/=) :: V1 p -> V1 p -> Bool #

Eq (U1 p) #

Since: 4.9.0.0

Instance details

Methods

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

(/=) :: U1 p -> U1 p -> Bool #

Eq (TypeRep a) #

Since: 2.1

Instance details

Methods

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

(/=) :: TypeRep a -> TypeRep a -> Bool #

(Eq a, Eq b) => Eq (a, b) 
Instance details

Methods

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

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

Eq (STRef s a) #

Pointer equality.

Since: 2.1

Instance details

Methods

(==) :: STRef s a -> STRef s a -> Bool #

(/=) :: STRef s a -> STRef s a -> Bool #

Eq (Proxy s) #

Since: 4.7.0.0

Instance details

Methods

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

(/=) :: Proxy s -> Proxy s -> Bool #

Eq a => Eq (Arg a b) #

Since: 4.9.0.0

Instance details

Methods

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

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

Eq (f p) => Eq (Rec1 f p) # 
Instance details

Methods

(==) :: Rec1 f p -> Rec1 f p -> Bool #

(/=) :: Rec1 f p -> Rec1 f p -> Bool #

Eq (URec Word p) # 
Instance details

Methods

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

(/=) :: URec Word p -> URec Word p -> Bool #

Eq (URec Int p) # 
Instance details

Methods

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

(/=) :: URec Int p -> URec Int p -> Bool #

Eq (URec Float p) # 
Instance details

Methods

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

(/=) :: URec Float p -> URec Float p -> Bool #

Eq (URec Double p) # 
Instance details

Methods

(==) :: URec Double p -> URec Double p -> Bool #

(/=) :: URec Double p -> URec Double p -> Bool #

Eq (URec Char p) # 
Instance details

Methods

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

(/=) :: URec Char p -> URec Char p -> Bool #

Eq (URec (Ptr ()) p) # 
Instance details

Methods

(==) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(/=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(Eq a, Eq b, Eq c) => Eq (a, b, c) 
Instance details

Methods

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

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

Eq (a :~: b) # 
Instance details

Methods

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

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

Eq (Coercion a b) # 
Instance details

Methods

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

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

Eq (f a) => Eq (Alt f a) # 
Instance details

Methods

(==) :: Alt f a -> Alt f a -> Bool #

(/=) :: Alt f a -> Alt f a -> Bool #

Eq a => Eq (Const a b) # 
Instance details

Methods

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

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

Eq c => Eq (K1 i c p) # 
Instance details

Methods

(==) :: K1 i c p -> K1 i c p -> Bool #

(/=) :: K1 i c p -> K1 i c p -> Bool #

(Eq (f p), Eq (g p)) => Eq ((f :+: g) p) # 
Instance details

Methods

(==) :: (f :+: g) p -> (f :+: g) p -> Bool #

(/=) :: (f :+: g) p -> (f :+: g) p -> Bool #

(Eq (f p), Eq (g p)) => Eq ((f :*: g) p) # 
Instance details

Methods

(==) :: (f :*: g) p -> (f :*: g) p -> Bool #

(/=) :: (f :*: g) p -> (f :*: g) p -> Bool #

(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) 
Instance details

Methods

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

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

Eq (a :~~: b) #

Since: 4.10.0.0

Instance details

Methods

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

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

(Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a) #

Since: 4.9.0.0

Instance details

Methods

(==) :: Sum f g a -> Sum f g a -> Bool #

(/=) :: Sum f g a -> Sum f g a -> Bool #

(Eq1 f, Eq1 g, Eq a) => Eq (Product f g a) #

Since: 4.9.0.0

Instance details

Methods

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

(/=) :: Product f g a -> Product f g a -> Bool #

Eq (f p) => Eq (M1 i c f p) # 
Instance details

Methods

(==) :: M1 i c f p -> M1 i c f p -> Bool #

(/=) :: M1 i c f p -> M1 i c f p -> Bool #

Eq (f (g p)) => Eq ((f :.: g) p) # 
Instance details

Methods

(==) :: (f :.: g) p -> (f :.: g) p -> Bool #

(/=) :: (f :.: g) p -> (f :.: g) p -> Bool #

(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) 
Instance details

Methods

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

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

(Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) #

Since: 4.9.0.0

Instance details

Methods

(==) :: Compose f g a -> Compose f g a -> Bool #

(/=) :: Compose f g a -> Compose f g a -> Bool #

(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) 
Instance details

Methods

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

(/=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) 
Instance details

Methods

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

(/=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) 
Instance details

Methods

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

(/=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) 
Instance details

Methods

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

(/=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) 
Instance details

Methods

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

(/=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

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

Methods

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

(/=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

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

Methods

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

(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

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

Methods

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

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

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

Methods

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

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

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

Methods

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

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

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

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

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 
Instance details
Ord Float 
Instance details

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

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 #

Since: 2.1

Instance details

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 #

Since: 2.1

Instance details

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 #

Since: 2.1

Instance details

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 #

Since: 2.1

Instance details

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 
Instance details
Ord Natural # 
Instance details
Ord Ordering 
Instance details
Ord Word 
Instance details

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 #

Since: 2.1

Instance details

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 #

Since: 2.1

Instance details
Ord Word32 #

Since: 2.1

Instance details
Ord Word64 #

Since: 2.1

Instance details
Ord SomeTypeRep # 
Instance details
Ord () 
Instance details

Methods

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

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

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

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

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

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

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

Ord TyCon 
Instance details

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 
Instance details
Ord GeneralCategory # 
Instance details
Ord Fingerprint # 
Instance details
Ord IOMode # 
Instance details
Ord IntPtr # 
Instance details
Ord WordPtr # 
Instance details
Ord CUIntMax # 
Instance details
Ord CIntMax # 
Instance details
Ord CUIntPtr # 
Instance details
Ord CIntPtr # 
Instance details
Ord CSUSeconds # 
Instance details
Ord CUSeconds # 
Instance details
Ord CTime # 
Instance details

Methods

compare :: CTime -> CTime -> Ordering #

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

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

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

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

max :: CTime -> CTime -> CTime #

min :: CTime -> CTime -> CTime #

Ord CClock # 
Instance details
Ord CSigAtomic # 
Instance details
Ord CWchar # 
Instance details
Ord CSize # 
Instance details

Methods

compare :: CSize -> CSize -> Ordering #

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

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

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

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

max :: CSize -> CSize -> CSize #

min :: CSize -> CSize -> CSize #

Ord CPtrdiff # 
Instance details
Ord CDouble # 
Instance details
Ord CFloat # 
Instance details
Ord CBool # 
Instance details

Methods

compare :: CBool -> CBool -> Ordering #

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

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

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

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

max :: CBool -> CBool -> CBool #

min :: CBool -> CBool -> CBool #

Ord CULLong # 
Instance details
Ord CLLong # 
Instance details
Ord CULong # 
Instance details
Ord CLong # 
Instance details

Methods

compare :: CLong -> CLong -> Ordering #

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

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

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

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

max :: CLong -> CLong -> CLong #

min :: CLong -> CLong -> CLong #

Ord CUInt # 
Instance details

Methods

compare :: CUInt -> CUInt -> Ordering #

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

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

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

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

max :: CUInt -> CUInt -> CUInt #

min :: CUInt -> CUInt -> CUInt #

Ord CInt # 
Instance details

Methods

compare :: CInt -> CInt -> Ordering #

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

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

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

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

max :: CInt -> CInt -> CInt #

min :: CInt -> CInt -> CInt #

Ord CUShort # 
Instance details
Ord CShort # 
Instance details
Ord CUChar # 
Instance details
Ord CSChar # 
Instance details
Ord CChar # 
Instance details

Methods

compare :: CChar -> CChar -> Ordering #

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

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

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

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

max :: CChar -> CChar -> CChar #

min :: CChar -> CChar -> CChar #

Ord SomeNat #

Since: 4.7.0.0

Instance details
Ord SomeSymbol #

Since: 4.7.0.0

Instance details
Ord DecidedStrictness # 
Instance details
Ord SourceStrictness # 
Instance details
Ord SourceUnpackedness # 
Instance details
Ord Associativity # 
Instance details
Ord Fixity # 
Instance details
Ord Any # 
Instance details

Methods

compare :: Any -> Any -> Ordering #

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

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

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

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

max :: Any -> Any -> Any #

min :: Any -> Any -> Any #

Ord All # 
Instance details

Methods

compare :: All -> All -> Ordering #

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

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

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

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

max :: All -> All -> All #

min :: All -> All -> All #

Ord ArithException # 
Instance details
Ord ErrorCall # 
Instance details
Ord SeekMode # 
Instance details
Ord NewlineMode # 
Instance details
Ord Newline # 
Instance details
Ord BufferMode # 
Instance details
Ord ExitCode # 
Instance details
Ord ArrayException # 
Instance details
Ord AsyncException # 
Instance details
Ord Fd # 
Instance details

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 CTimer # 
Instance details
Ord CKey # 
Instance details

Methods

compare :: CKey -> CKey -> Ordering #

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

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

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

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

max :: CKey -> CKey -> CKey #

min :: CKey -> CKey -> CKey #

Ord CId # 
Instance details

Methods

compare :: CId -> CId -> Ordering #

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

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

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

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

max :: CId -> CId -> CId #

min :: CId -> CId -> CId #

Ord CFsFilCnt # 
Instance details
Ord CFsBlkCnt # 
Instance details
Ord CClockId # 
Instance details
Ord CBlkCnt # 
Instance details
Ord CBlkSize # 
Instance details
Ord CRLim # 
Instance details

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 CTcflag # 
Instance details
Ord CSpeed # 
Instance details
Ord CCc # 
Instance details

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 CUid # 
Instance details

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 CNlink # 
Instance details
Ord CGid # 
Instance details

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 CSsize # 
Instance details
Ord CPid # 
Instance details

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 COff # 
Instance details

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 CMode # 
Instance details

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 CIno # 
Instance details

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

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 ThreadStatus # 
Instance details
Ord BlockReason # 
Instance details
Ord ThreadId #

Since: 4.2.0.0

Instance details
Ord Version #

Since: 2.1

Instance details
Ord ByteOrder # 
Instance details
Ord Unique # 
Instance details
Ord Void #

Since: 4.8.0.0

Instance details

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 a => Ord [a] 
Instance details

Methods

compare :: [a] -> [a] -> Ordering #

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

(<=) :: [a] -> [a] -> Bool #

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

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

max :: [a] -> [a] -> [a] #

min :: [a] -> [a] -> [a] #

Ord a => Ord (Maybe a) # 
Instance details

Methods

compare :: Maybe a -> Maybe a -> Ordering #

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

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

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

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

max :: Maybe a -> Maybe a -> Maybe a #

min :: Maybe a -> Maybe a -> Maybe a #

Integral a => Ord (Ratio a) #

Since: 2.0.1

Instance details

Methods

compare :: Ratio a -> Ratio a -> Ordering #

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

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

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

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

max :: Ratio a -> Ratio a -> Ratio a #

min :: Ratio a -> Ratio a -> Ratio a #

Ord (Ptr a) # 
Instance details

Methods

compare :: Ptr a -> Ptr a -> Ordering #

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

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

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

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

max :: Ptr a -> Ptr a -> Ptr a #

min :: Ptr a -> Ptr a -> Ptr a #

Ord (FunPtr a) # 
Instance details

Methods

compare :: FunPtr a -> FunPtr a -> Ordering #

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

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

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

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

max :: FunPtr a -> FunPtr a -> FunPtr a #

min :: FunPtr a -> FunPtr a -> FunPtr a #

Ord p => Ord (Par1 p) # 
Instance details

Methods

compare :: Par1 p -> Par1 p -> Ordering #

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

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

(>) :: Par1 p -> Par1 p -> Bool #

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

max :: Par1 p -> Par1 p -> Par1 p #

min :: Par1 p -> Par1 p -> Par1 p #

Ord a => Ord (NonEmpty a) # 
Instance details

Methods

compare :: NonEmpty a -> NonEmpty a -> Ordering #

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

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

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

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

max :: NonEmpty a -> NonEmpty a -> NonEmpty a #

min :: NonEmpty a -> NonEmpty a -> NonEmpty a #

Ord a => Ord (Down a) #

Since: 4.6.0.0

Instance details

Methods

compare :: Down a -> Down a -> Ordering #

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

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

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

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

max :: Down a -> Down a -> Down a #

min :: Down a -> Down a -> Down a #

Ord a => Ord (Product a) # 
Instance details

Methods

compare :: Product a -> Product a -> Ordering #

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

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

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

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

max :: Product a -> Product a -> Product a #

min :: Product a -> Product a -> Product a #

Ord a => Ord (Sum a) # 
Instance details

Methods

compare :: Sum a -> Sum a -> Ordering #

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

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

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

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

max :: Sum a -> Sum a -> Sum a #

min :: Sum a -> Sum a -> Sum a #

Ord a => Ord (Dual a) # 
Instance details

Methods

compare :: Dual a -> Dual a -> Ordering #

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

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

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

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

max :: Dual a -> Dual a -> Dual a #

min :: Dual a -> Dual a -> Dual a #

Ord a => Ord (Last a) # 
Instance details

Methods

compare :: Last a -> Last a -> Ordering #

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

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

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

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

max :: Last a -> Last a -> Last a #

min :: Last a -> Last a -> Last a #

Ord a => Ord (First a) # 
Instance details

Methods

compare :: First a -> First a -> Ordering #

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

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

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

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

max :: First a -> First a -> First a #

min :: First a -> First a -> First a #

Ord (ForeignPtr a) #

Since: 2.1

Instance details
Ord a => Ord (Identity a) # 
Instance details

Methods

compare :: Identity a -> Identity a -> Ordering #

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

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

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

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

max :: Identity a -> Identity a -> Identity a #

min :: Identity a -> Identity a -> Identity a #

Ord a => Ord (ZipList a) # 
Instance details

Methods

compare :: ZipList a -> ZipList a -> Ordering #

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

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

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

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

max :: ZipList a -> ZipList a -> ZipList a #

min :: ZipList a -> ZipList a -> ZipList a #

Ord a => Ord (Option a) # 
Instance details

Methods

compare :: Option a -> Option a -> Ordering #

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

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

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

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

max :: Option a -> Option a -> Option a #

min :: Option a -> Option a -> Option a #

Ord m => Ord (WrappedMonoid m) # 
Instance details
Ord a => Ord (Last a) # 
Instance details

Methods

compare :: Last a -> Last a -> Ordering #

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

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

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

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

max :: Last a -> Last a -> Last a #

min :: Last a -> Last a -> Last a #

Ord a => Ord (First a) # 
Instance details

Methods

compare :: First a -> First a -> Ordering #

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

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

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

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

max :: First a -> First a -> First a #

min :: First a -> First a -> First a #

Ord a => Ord (Max a) # 
Instance details

Methods

compare :: Max a -> Max a -> Ordering #

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

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

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

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

max :: Max a -> Max a -> Max a #

min :: Max a -> Max a -> Max a #

Ord a => Ord (Min a) # 
Instance details

Methods

compare :: Min a -> Min a -> Ordering #

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

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

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

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

max :: Min a -> Min a -> Min a #

min :: Min a -> Min a -> Min a #

Ord (Fixed a) # 
Instance details

Methods

compare :: Fixed a -> Fixed a -> Ordering #

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

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

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

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

max :: Fixed a -> Fixed a -> Fixed a #

min :: Fixed a -> Fixed a -> Fixed a #

(Ord a, Ord b) => Ord (Either a b) # 
Instance details

Methods

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

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

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

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

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

max :: Either a b -> Either a b -> Either a b #

min :: Either a b -> Either a b -> Either a b #

Ord (V1 p) #

Since: 4.9.0.0

Instance details

Methods

compare :: V1 p -> V1 p -> Ordering #

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

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

(>) :: V1 p -> V1 p -> Bool #

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

max :: V1 p -> V1 p -> V1 p #

min :: V1 p -> V1 p -> V1 p #

Ord (U1 p) #

Since: 4.9.0.0

Instance details

Methods

compare :: U1 p -> U1 p -> Ordering #

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

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

(>) :: U1 p -> U1 p -> Bool #

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

max :: U1 p -> U1 p -> U1 p #

min :: U1 p -> U1 p -> U1 p #

Ord (TypeRep a) #

Since: 4.4.0.0

Instance details

Methods

compare :: TypeRep a -> TypeRep a -> Ordering #

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

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

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

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

max :: TypeRep a -> TypeRep a -> TypeRep a #

min :: TypeRep a -> TypeRep a -> TypeRep a #

(Ord a, Ord b) => Ord (a, b) 
Instance details

Methods

compare :: (a, b) -> (a, b) -> Ordering #

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

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

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

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

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

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

Ord (Proxy s) #

Since: 4.7.0.0

Instance details

Methods

compare :: Proxy s -> Proxy s -> Ordering #

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

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

(>) :: Proxy s -> Proxy s -> Bool #

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

max :: Proxy s -> Proxy s -> Proxy s #

min :: Proxy s -> Proxy s -> Proxy s #

Ord a => Ord (Arg a b) #

Since: 4.9.0.0

Instance details

Methods

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

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

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

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

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

max :: Arg a b -> Arg a b -> Arg a b #

min :: Arg a b -> Arg a b -> Arg a b #

Ord (f p) => Ord (Rec1 f p) # 
Instance details

Methods

compare :: Rec1 f p -> Rec1 f p -> Ordering #

(<) :: Rec1 f p -> Rec1 f p -> Bool #

(<=) :: Rec1 f p -> Rec1 f p -> Bool #

(>) :: Rec1 f p -> Rec1 f p -> Bool #

(>=) :: Rec1 f p -> Rec1 f p -> Bool #

max :: Rec1 f p -> Rec1 f p -> Rec1 f p #

min :: Rec1 f p -> Rec1 f p -> Rec1 f p #

Ord (URec Word p) # 
Instance details

Methods

compare :: URec Word p -> URec Word p -> Ordering #

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

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

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

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

max :: URec Word p -> URec Word p -> URec Word p #

min :: URec Word p -> URec Word p -> URec Word p #

Ord (URec Int p) # 
Instance details

Methods

compare :: URec Int p -> URec Int p -> Ordering #

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

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

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

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

max :: URec Int p -> URec Int p -> URec Int p #

min :: URec Int p -> URec Int p -> URec Int p #

Ord (URec Float p) # 
Instance details

Methods

compare :: URec Float p -> URec Float p -> Ordering #

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

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

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

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

max :: URec Float p -> URec Float p -> URec Float p #

min :: URec Float p -> URec Float p -> URec Float p #

Ord (URec Double p) # 
Instance details

Methods

compare :: URec Double p -> URec Double p -> Ordering #

(<) :: URec Double p -> URec Double p -> Bool #

(<=) :: URec Double p -> URec Double p -> Bool #

(>) :: URec Double p -> URec Double p -> Bool #

(>=) :: URec Double p -> URec Double p -> Bool #

max :: URec Double p -> URec Double p -> URec Double p #

min :: URec Double p -> URec Double p -> URec Double p #

Ord (URec Char p) # 
Instance details

Methods

compare :: URec Char p -> URec Char p -> Ordering #

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

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

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

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

max :: URec Char p -> URec Char p -> URec Char p #

min :: URec Char p -> URec Char p -> URec Char p #

Ord (URec (Ptr ()) p) # 
Instance details

Methods

compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering #

(<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

(>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #

max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p #

min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p #

(Ord a, Ord b, Ord c) => Ord (a, b, c) 
Instance details

Methods

compare :: (a, b, c) -> (a, b, c) -> Ordering #

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

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

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

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

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

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

Ord (a :~: b) # 
Instance details

Methods

compare :: (a :~: b) -> (a :~: b) -> Ordering #

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

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

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

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

max :: (a :~: b) -> (a :~: b) -> a :~: b #

min :: (a :~: b) -> (a :~: b) -> a :~: b #

Ord (Coercion a b) # 
Instance details

Methods

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

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

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

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

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

max :: Coercion a b -> Coercion a b -> Coercion a b #

min :: Coercion a b -> Coercion a b -> Coercion a b #

Ord (f a) => Ord (Alt f a) # 
Instance details

Methods

compare :: Alt f a -> Alt f a -> Ordering #

(<) :: Alt f a -> Alt f a -> Bool #

(<=) :: Alt f a -> Alt f a -> Bool #

(>) :: Alt f a -> Alt f a -> Bool #

(>=) :: Alt f a -> Alt f a -> Bool #

max :: Alt f a -> Alt f a -> Alt f a #

min :: Alt f a -> Alt f a -> Alt f a #

Ord a => Ord (Const a b) # 
Instance details

Methods

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

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

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

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

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

max :: Const a b -> Const a b -> Const a b #

min :: Const a b -> Const a b -> Const a b #

Ord c => Ord (K1 i c p) # 
Instance details

Methods

compare :: K1 i c p -> K1 i c p -> Ordering #

(<) :: K1 i c p -> K1 i c p -> Bool #

(<=) :: K1 i c p -> K1 i c p -> Bool #

(>) :: K1 i c p -> K1 i c p -> Bool #

(>=) :: K1 i c p -> K1 i c p -> Bool #

max :: K1 i c p -> K1 i c p -> K1 i c p #

min :: K1 i c p -> K1 i c p -> K1 i c p #

(Ord (f p), Ord (g p)) => Ord ((f :+: g) p) # 
Instance details

Methods

compare :: (f :+: g) p -> (f :+: g) p -> Ordering #

(<) :: (f :+: g) p -> (f :+: g) p -> Bool #

(<=) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>) :: (f :+: g) p -> (f :+: g) p -> Bool #

(>=) :: (f :+: g) p -> (f :+: g) p -> Bool #

max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p #

(Ord (f p), Ord (g p)) => Ord ((f :*: g) p) # 
Instance details

Methods

compare :: (f :*: g) p -> (f :*: g) p -> Ordering #

(<) :: (f :*: g) p -> (f :*: g) p -> Bool #

(<=) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>) :: (f :*: g) p -> (f :*: g) p -> Bool #

(>=) :: (f :*: g) p -> (f :*: g) p -> Bool #

max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p #

(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) 
Instance details

Methods

compare :: (a, b, c, d) -> (a, b, c, d) -> Ordering #

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

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

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

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

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

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

Ord (a :~~: b) #

Since: 4.10.0.0

Instance details

Methods

compare :: (a :~~: b) -> (a :~~: b) -> Ordering #

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

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

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

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

max :: (a :~~: b) -> (a :~~: b) -> a :~~: b #

min :: (a :~~: b) -> (a :~~: b) -> a :~~: b #

(Ord1 f, Ord1 g, Ord a) => Ord (Sum f g a) #

Since: 4.9.0.0

Instance details

Methods

compare :: Sum f g a -> Sum f g a -> Ordering #

(<) :: Sum f g a -> Sum f g a -> Bool #

(<=) :: Sum f g a -> Sum f g a -> Bool #

(>) :: Sum f g a -> Sum f g a -> Bool #

(>=) :: Sum f g a -> Sum f g a -> Bool #

max :: Sum f g a -> Sum f g a -> Sum f g a #

min :: Sum f g a -> Sum f g a -> Sum f g a #

(Ord1 f, Ord1 g, Ord a) => Ord (Product f g a) #

Since: 4.9.0.0

Instance details

Methods

compare :: Product f g a -> Product f g a -> Ordering #

(<) :: Product f g a -> Product f g a -> Bool #

(<=) :: Product f g a -> Product f g a -> Bool #

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

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

max :: Product f g a -> Product f g a -> Product f g a #

min :: Product f g a -> Product f g a -> Product f g a #

Ord (f p) => Ord (M1 i c f p) # 
Instance details

Methods

compare :: M1 i c f p -> M1 i c f p -> Ordering #

(<) :: M1 i c f p -> M1 i c f p -> Bool #

(<=) :: M1 i c f p -> M1 i c f p -> Bool #

(>) :: M1 i c f p -> M1 i c f p -> Bool #

(>=) :: M1 i c f p -> M1 i c f p -> Bool #

max :: M1 i c f p -> M1 i c f p -> M1 i c f p #

min :: M1 i c f p -> M1 i c f p -> M1 i c f p #

Ord (f (g p)) => Ord ((f :.: g) p) # 
Instance details

Methods

compare :: (f :.: g) p -> (f :.: g) p -> Ordering #

(<) :: (f :.: g) p -> (f :.: g) p -> Bool #

(<=) :: (f :.: g) p -> (f :.: g) p -> Bool #

(>) :: (f :.: g) p -> (f :.: g) p -> Bool #

(>=) :: (f :.: g) p -> (f :.: g) p -> Bool #

max :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

min :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p #

(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) 
Instance details

Methods

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

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

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

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

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

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

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

(Ord1 f, Ord1 g, Ord a) => Ord (Compose f g a) #

Since: 4.9.0.0

Instance details

Methods

compare :: Compose f g a -> Compose f g a -> Ordering #

(<) :: Compose f g a -> Compose f g a -> Bool #

(<=) :: Compose f g a -> Compose f g a -> Bool #

(>) :: Compose f g a -> Compose f g a -> Bool #

(>=) :: Compose f g a -> Compose f g a -> Bool #

max :: Compose f g a -> Compose f g a -> Compose f g a #

min :: Compose f g a -> Compose f g a -> Compose f g a #

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) 
Instance details

Methods

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

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

(<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #

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

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

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

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

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) 
Instance details

Methods

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

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

(<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #

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

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

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

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

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) 
Instance details

Methods

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

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

(<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #

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

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

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

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

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) 
Instance details

Methods

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

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

(<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #

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

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

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

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

(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) 
Instance details

Methods

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

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

(<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #

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

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

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

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

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

Methods

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

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

(<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #

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

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

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

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

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

Methods

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

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

(<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #

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

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

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

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

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

Methods

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

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

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

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

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

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

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

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

Methods

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

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

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

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

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

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

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

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

Methods

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

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

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

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

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

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

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

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

enumFromThen :: a -> a -> [a] Source #

Used in Haskell's translation of [n,n'..].

enumFromTo :: a -> a -> [a] Source #

Used in Haskell's translation of [n..m].

enumFromThenTo :: a -> a -> a -> [a] Source #

Used in Haskell's translation of [n,n'..m].

Instances
Enum Bool Source #

Since: 2.1

Instance details
Enum Char Source #

Since: 2.1

Instance details
Enum Double Source #

Since: 2.1

Instance details
Enum Float Source #

Since: 2.1

Instance details
Enum Int Source #

Since: 2.1

Instance details
Enum Int8 Source #

Since: 2.1

Instance details
Enum Int16 Source #

Since: 2.1

Instance details
Enum Int32 Source #

Since: 2.1

Instance details
Enum Int64 Source #

Since: 2.1

Instance details
Enum Integer Source #

Since: 2.1

Instance details
Enum Natural Source #

Since: 4.8.0.0

Instance details
Enum Ordering Source #

Since: 2.1

Instance details
Enum Word Source #

Since: 2.1

Instance details
Enum Word8 Source #

Since: 2.1

Instance details
Enum Word16 Source #

Since: 2.1

Instance details
Enum Word32 Source #

Since: 2.1

Instance details
Enum Word64 Source #

Since: 2.1

Instance details
Enum VecCount Source #

Since: 4.10.0.0

Instance details
Enum VecElem Source #

Since: 4.10.0.0

Instance details
Enum () Source #

Since: 2.1

Instance details

Methods

succ :: () -> () Source #

pred :: () -> () Source #

toEnum :: Int -> () Source #

fromEnum :: () -> Int Source #

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

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

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

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

Enum GeneralCategory Source # 
Instance details
Enum IOMode Source # 
Instance details
Enum IntPtr Source # 
Instance details
Enum WordPtr Source # 
Instance details
Enum CUIntMax Source # 
Instance details
Enum CIntMax Source # 
Instance details
Enum CUIntPtr Source # 
Instance details
Enum CIntPtr Source # 
Instance details
Enum CSUSeconds Source # 
Instance details
Enum CUSeconds Source # 
Instance details
Enum CTime Source # 
Instance details
Enum CClock Source # 
Instance details
Enum CSigAtomic Source # 
Instance details
Enum CWchar Source # 
Instance details
Enum CSize Source # 
Instance details
Enum CPtrdiff Source # 
Instance details
Enum CDouble Source # 
Instance details
Enum CFloat Source # 
Instance details
Enum CBool Source # 
Instance details
Enum CULLong Source # 
Instance details
Enum CLLong Source # 
Instance details
Enum CULong Source # 
Instance details
Enum CLong Source # 
Instance details
Enum CUInt Source # 
Instance details
Enum CInt Source # 
Instance details
Enum CUShort Source # 
Instance details
Enum CShort Source # 
Instance details
Enum CUChar Source # 
Instance details
Enum CSChar Source # 
Instance details
Enum CChar Source # 
Instance details
Enum DecidedStrictness Source # 
Instance details
Enum SourceStrictness Source # 
Instance details
Enum SourceUnpackedness Source # 
Instance details
Enum Associativity Source # 
Instance details
Enum SeekMode Source # 
Instance details
Enum Fd Source # 
Instance details

Methods

succ :: Fd -> Fd Source #

pred :: Fd -> Fd Source #

toEnum :: Int -> Fd Source #

fromEnum :: Fd -> Int Source #

enumFrom :: Fd -> [Fd] Source #

enumFromThen :: Fd -> Fd -> [Fd] Source #

enumFromTo :: Fd -> Fd -> [Fd] Source #

enumFromThenTo :: Fd -> Fd -> Fd -> [Fd] Source #

Enum CKey Source # 
Instance details
Enum CId Source # 
Instance details
Enum CFsFilCnt Source # 
Instance details
Enum CFsBlkCnt Source # 
Instance details
Enum CClockId Source # 
Instance details
Enum CBlkCnt Source # 
Instance details
Enum CBlkSize Source # 
Instance details
Enum CRLim Source # 
Instance details
Enum CTcflag Source # 
Instance details
Enum CSpeed Source # 
Instance details
Enum CCc Source # 
Instance details
Enum CUid Source # 
Instance details
Enum CNlink Source # 
Instance details
Enum CGid Source # 
Instance details
Enum CSsize Source # 
Instance details
Enum CPid Source # 
Instance details
Enum COff Source # 
Instance details
Enum CMode Source # 
Instance details
Enum CIno Source # 
Instance details
Enum CDev Source # 
Instance details
Enum ByteOrder Source # 
Instance details
Enum DoTrace Source #

Since: 4.8.0.0

Instance details
Enum DoHeapProfile Source #

Since: 4.8.0.0

Instance details
Enum DoCostCentres Source #

Since: 4.8.0.0

Instance details
Enum GiveGCStats Source #

Since: 4.8.0.0

Instance details
Integral a => Enum (Ratio a) Source #

Since: 2.0.1

Instance details

Methods

succ :: Ratio a -> Ratio a Source #

pred :: Ratio a -> Ratio a Source #

toEnum :: Int -> Ratio a Source #

fromEnum :: Ratio a -> Int Source #

enumFrom :: Ratio a -> [Ratio a] Source #

enumFromThen :: Ratio a -> Ratio a -> [Ratio a] Source #

enumFromTo :: Ratio a -> Ratio a -> [Ratio a] Source #

enumFromThenTo :: Ratio a -> Ratio a -> Ratio a -> [Ratio a] Source #

Enum a => Enum (Identity a) Source # 
Instance details
Enum a => Enum (WrappedMonoid a) Source #

Since: 4.9.0.0

Instance details
Enum a => Enum (Last a) Source #

Since: 4.9.0.0

Instance details

Methods

succ :: Last a -> Last a Source #

pred :: Last a -> Last a Source #

toEnum :: Int -> Last a Source #

fromEnum :: Last a -> Int Source #

enumFrom :: Last a -> [Last a] Source #

enumFromThen :: Last a -> Last a -> [Last a] Source #

enumFromTo :: Last a -> Last a -> [Last a] Source #

enumFromThenTo :: Last a -> Last a -> Last a -> [Last a] Source #

Enum a => Enum (First a) Source #

Since: 4.9.0.0

Instance details

Methods

succ :: First a -> First a Source #

pred :: First a -> First a Source #

toEnum :: Int -> First a Source #

fromEnum :: First a -> Int Source #

enumFrom :: First a -> [First a] Source #

enumFromThen :: First a -> First a -> [First a] Source #

enumFromTo :: First a -> First a -> [First a] Source #

enumFromThenTo :: First a -> First a -> First a -> [First a] Source #

Enum a => Enum (Max a) Source #

Since: 4.9.0.0

Instance details

Methods

succ :: Max a -> Max a Source #

pred :: Max a -> Max a Source #

toEnum :: Int -> Max a Source #

fromEnum :: Max a -> Int Source #

enumFrom :: Max a -> [Max a] Source #

enumFromThen :: Max a -> Max a -> [Max a] Source #

enumFromTo :: Max a -> Max a -> [Max a] Source #

enumFromThenTo :: Max a -> Max a -> Max a -> [Max a] Source #

Enum a => Enum (Min a) Source #

Since: 4.9.0.0

Instance details

Methods

succ :: Min a -> Min a Source #

pred :: Min a -> Min a Source #

toEnum :: Int -> Min a Source #

fromEnum :: Min a -> Int Source #

enumFrom :: Min a -> [Min a] Source #

enumFromThen :: Min a -> Min a -> [Min a] Source #

enumFromTo :: Min a -> Min a -> [Min a] Source #

enumFromThenTo :: Min a -> Min a -> Min a -> [Min a] Source #

Enum (Fixed a) Source #

Since: 2.1

Instance details

Methods

succ :: Fixed a -> Fixed a Source #

pred :: Fixed a -> Fixed a Source #

toEnum :: Int -> Fixed a Source #

fromEnum :: Fixed a -> Int Source #

enumFrom :: Fixed a -> [Fixed a] Source #

enumFromThen :: Fixed a -> Fixed a -> [Fixed a] Source #

enumFromTo :: Fixed a -> Fixed a -> [Fixed a] Source #

enumFromThenTo :: Fixed a -> Fixed a -> Fixed a -> [Fixed a] Source #

Enum (Proxy s) Source #

Since: 4.7.0.0

Instance details

Methods

succ :: Proxy s -> Proxy s Source #

pred :: Proxy s -> Proxy s Source #

toEnum :: Int -> Proxy s Source #

fromEnum :: Proxy s -> Int Source #

enumFrom :: Proxy s -> [Proxy s] Source #

enumFromThen :: Proxy s -> Proxy s -> [Proxy s] Source #

enumFromTo :: Proxy s -> Proxy s -> [Proxy s] Source #

enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] Source #

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

Since: 4.7.0.0

Instance details

Methods

succ :: (a :~: b) -> a :~: b Source #

pred :: (a :~: b) -> a :~: b Source #

toEnum :: Int -> a :~: b Source #

fromEnum :: (a :~: b) -> Int Source #

enumFrom :: (a :~: b) -> [a :~: b] Source #

enumFromThen :: (a :~: b) -> (a :~: b) -> [a :~: b] Source #

enumFromTo :: (a :~: b) -> (a :~: b) -> [a :~: b] Source #

enumFromThenTo :: (a :~: b) -> (a :~: b) -> (a :~: b) -> [a :~: b] Source #

Coercible a b => Enum (Coercion a b) Source #

Since: 4.7.0.0

Instance details

Methods

succ :: Coercion a b -> Coercion a b Source #

pred :: Coercion a b -> Coercion a b Source #

toEnum :: Int -> Coercion a b Source #

fromEnum :: Coercion a b -> Int Source #

enumFrom :: Coercion a b -> [Coercion a b] Source #

enumFromThen :: Coercion a b -> Coercion a b -> [Coercion a b] Source #

enumFromTo :: Coercion a b -> Coercion a b -> [Coercion a b] Source #

enumFromThenTo :: Coercion a b -> Coercion a b -> Coercion a b -> [Coercion a b] Source #

Enum (f a) => Enum (Alt f a) Source # 
Instance details

Methods

succ :: Alt f a -> Alt f a Source #

pred :: Alt f a -> Alt f a Source #

toEnum :: Int -> Alt f a Source #

fromEnum :: Alt f a -> Int Source #

enumFrom :: Alt f a -> [Alt f a] Source #

enumFromThen :: Alt f a -> Alt f a -> [Alt f a] Source #

enumFromTo :: Alt f a -> Alt f a -> [Alt f a] Source #

enumFromThenTo :: Alt f a -> Alt f a -> Alt f a -> [Alt f a] Source #

Enum a => Enum (Const a b) Source # 
Instance details

Methods

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

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

toEnum :: Int -> Const a b Source #

fromEnum :: Const a b -> Int Source #

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

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

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

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

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

Since: 4.10.0.0

Instance details

Methods

succ :: (a :~~: b) -> a :~~: b Source #

pred :: (a :~~: b) -> a :~~: b Source #

toEnum :: Int -> a :~~: b Source #

fromEnum :: (a :~~: b) -> Int Source #

enumFrom :: (a :~~: b) -> [a :~~: b] Source #

enumFromThen :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] Source #

enumFromTo :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] Source #

enumFromThenTo :: (a :~~: b) -> (a :~~: b) -> (a :~~: b) -> [a :~~: b] Source #

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.

Minimal complete definition

minBound, maxBound

Methods

minBound :: a Source #

maxBound :: a Source #

Instances
Bounded Bool Source #

Since: 2.1

Instance details
Bounded Char Source #

Since: 2.1

Instance details
Bounded Int Source #

Since: 2.1

Instance details
Bounded Int8 Source #

Since: 2.1

Instance details
Bounded Int16 Source #

Since: 2.1

Instance details
Bounded Int32 Source #

Since: 2.1

Instance details
Bounded Int64 Source #

Since: 2.1

Instance details
Bounded Ordering Source #

Since: 2.1

Instance details
Bounded Word Source #

Since: 2.1

Instance details
Bounded Word8 Source #

Since: 2.1

Instance details
Bounded Word16 Source #

Since: 2.1

Instance details
Bounded Word32 Source #

Since: 2.1

Instance details
Bounded Word64 Source #

Since: 2.1

Instance details
Bounded VecCount Source #

Since: 4.10.0.0

Instance details
Bounded VecElem Source #

Since: 4.10.0.0

Instance details
Bounded () Source #

Since: 2.1

Instance details

Methods

minBound :: () Source #

maxBound :: () Source #

Bounded GeneralCategory Source # 
Instance details
Bounded IntPtr Source # 
Instance details
Bounded WordPtr Source # 
Instance details
Bounded CUIntMax Source # 
Instance details
Bounded CIntMax Source # 
Instance details
Bounded CUIntPtr Source # 
Instance details
Bounded CIntPtr Source # 
Instance details
Bounded CSigAtomic Source # 
Instance details
Bounded CWchar Source # 
Instance details
Bounded CSize Source # 
Instance details
Bounded CPtrdiff Source # 
Instance details
Bounded CBool Source # 
Instance details
Bounded CULLong Source # 
Instance details
Bounded CLLong Source # 
Instance details
Bounded CULong Source # 
Instance details
Bounded CLong Source # 
Instance details
Bounded CUInt Source # 
Instance details
Bounded CInt Source # 
Instance details
Bounded CUShort Source # 
Instance details
Bounded CShort Source # 
Instance details
Bounded CUChar Source # 
Instance details
Bounded CSChar Source # 
Instance details
Bounded CChar Source # 
Instance details
Bounded DecidedStrictness Source # 
Instance details
Bounded SourceStrictness Source # 
Instance details
Bounded SourceUnpackedness Source # 
Instance details
Bounded Associativity Source # 
Instance details
Bounded Any Source # 
Instance details
Bounded All Source # 
Instance details
Bounded Fd Source # 
Instance details
Bounded CKey Source # 
Instance details
Bounded CId Source # 
Instance details
Bounded CFsFilCnt Source # 
Instance details
Bounded CFsBlkCnt Source # 
Instance details
Bounded CClockId Source # 
Instance details
Bounded CBlkCnt Source # 
Instance details
Bounded CBlkSize Source # 
Instance details
Bounded CRLim Source # 
Instance details
Bounded CTcflag Source # 
Instance details
Bounded CUid Source # 
Instance details
Bounded CNlink Source # 
Instance details
Bounded CGid Source # 
Instance details
Bounded CSsize Source # 
Instance details
Bounded CPid Source # 
Instance details
Bounded COff Source # 
Instance details
Bounded CMode Source # 
Instance details
Bounded CIno Source # 
Instance details
Bounded CDev Source # 
Instance details
Bounded ByteOrder Source # 
Instance details
Bounded a => Bounded (Product a) Source # 
Instance details
Bounded a => Bounded (Sum a) Source # 
Instance details
Bounded a => Bounded (Dual a) Source # 
Instance details
Bounded a => Bounded (Identity a) Source # 
Instance details
Bounded m => Bounded (WrappedMonoid m) Source # 
Instance details
Bounded a => Bounded (Last a) Source # 
Instance details
Bounded a => Bounded (First a) Source # 
Instance details
Bounded a => Bounded (Max a) Source # 
Instance details
Bounded a => Bounded (Min a) Source # 
Instance details
(Bounded a, Bounded b) => Bounded (a, b) Source #

Since: 2.1

Instance details

Methods

minBound :: (a, b) Source #

maxBound :: (a, b) Source #

Bounded (Proxy t) Source # 
Instance details
(Bounded a, Bounded b, Bounded c) => Bounded (a, b, c) Source #

Since: 2.1

Instance details

Methods

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

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

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

Since: 4.7.0.0

Instance details

Methods

minBound :: a :~: b Source #

maxBound :: a :~: b Source #

Coercible a b => Bounded (Coercion a b) Source #

Since: 4.7.0.0

Instance details
Bounded a => Bounded (Const a b) Source # 
Instance details

Methods

minBound :: Const a b Source #

maxBound :: Const a b Source #

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

Since: 2.1

Instance details

Methods

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

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

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

Since: 4.10.0.0

Instance details

Methods

minBound :: a :~~: b Source #

maxBound :: a :~~: b Source #

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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

Since: 2.1

Instance details

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 #

Numbers

Numeric types

data Int #

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

Instances
Bounded Int Source #

Since: 2.1

Instance details
Enum Int Source #

Since: 2.1

Instance details
Eq Int 
Instance details

Methods

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

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

Integral Int Source #

Since: 2.0.1

Instance details

Methods

quot :: Int -> Int -> Int Source #

rem :: Int -> Int -> Int Source #

div :: Int -> Int -> Int Source #

mod :: Int -> Int -> Int Source #

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

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

toInteger :: Int -> Integer Source #

Data Int Source #

Since: 4.0.0.0

Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int -> c Int Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int Source #

toConstr :: Int -> Constr Source #

dataTypeOf :: Int -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int) Source #

gmapT :: (forall b. Data b => b -> b) -> Int -> Int Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Int -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Int -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int -> m Int Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int Source #

Num Int Source #

Since: 2.1

Instance details
Ord Int 
Instance details

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 #

Read Int Source #

Since: 2.1

Instance details
Real Int Source #

Since: 2.0.1

Instance details
Show Int Source #

Since: 2.1

Instance details
Ix Int Source #

Since: 2.1

Instance details

Methods

range :: (Int, Int) -> [Int] Source #

index :: (Int, Int) -> Int -> Int Source #

unsafeIndex :: (Int, Int) -> Int -> Int

inRange :: (Int, Int) -> Int -> Bool Source #

rangeSize :: (Int, Int) -> Int Source #

unsafeRangeSize :: (Int, Int) -> Int

FiniteBits Int Source #

Since: 4.6.0.0

Instance details
Bits Int Source #

Since: 2.1

Instance details
Storable Int Source #

Since: 2.1

Instance details
PrintfArg Int Source #

Since: 2.1

Instance details
Generic1 (URec Int :: k -> *) Source # 
Instance details

Associated Types

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

Methods

from1 :: URec Int a -> Rep1 (URec Int) a Source #

to1 :: Rep1 (URec Int) a -> URec Int a Source #

Functor (URec Int :: * -> *) Source # 
Instance details

Methods

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

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

Foldable (URec Int :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Int m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Int a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Int a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Int a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Int a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Int a -> b Source #

foldr1 :: (a -> a -> a) -> URec Int a -> a Source #

foldl1 :: (a -> a -> a) -> URec Int a -> a Source #

toList :: URec Int a -> [a] Source #

null :: URec Int a -> Bool Source #

length :: URec Int a -> Int Source #

elem :: Eq a => a -> URec Int a -> Bool Source #

maximum :: Ord a => URec Int a -> a Source #

minimum :: Ord a => URec Int a -> a Source #

sum :: Num a => URec Int a -> a Source #

product :: Num a => URec Int a -> a Source #

Traversable (URec Int :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Int a -> f (URec Int b) Source #

sequenceA :: Applicative f => URec Int (f a) -> f (URec Int a) Source #

mapM :: Monad m => (a -> m b) -> URec Int a -> m (URec Int b) Source #

sequence :: Monad m => URec Int (m a) -> m (URec Int a) Source #

Eq (URec Int p) # 
Instance details

Methods

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

(/=) :: URec Int p -> URec Int p -> Bool #

Ord (URec Int p) # 
Instance details

Methods

compare :: URec Int p -> URec Int p -> Ordering #

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

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

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

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

max :: URec Int p -> URec Int p -> URec Int p #

min :: URec Int p -> URec Int p -> URec Int p #

Show (URec Int p) Source # 
Instance details
Generic (URec Int p) Source # 
Instance details

Associated Types

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

Methods

from :: URec Int p -> Rep (URec Int p) x Source #

to :: Rep (URec Int p) x -> URec Int p Source #

data URec Int (p :: k) Source #

Used for marking occurrences of Int#

Since: 4.9.0.0

Instance details
data URec Int (p :: k) = UInt {}
type Rep1 (URec Int :: k -> *) Source # 
Instance details
type Rep1 (URec Int :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UInt" PrefixI True) (S1 (MetaSel (Just "uInt#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UInt :: k -> *)))
type Rep (URec Int p) Source # 
Instance details
type Rep (URec Int p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UInt" PrefixI True) (S1 (MetaSel (Just "uInt#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UInt :: * -> *)))

data Integer #

Invariant: Jn# and Jp# are used iff value doesn't fit in S#

Useful properties resulting from the invariants:

Instances
Enum Integer Source #

Since: 2.1

Instance details
Eq Integer 
Instance details

Methods

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

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

Integral Integer Source #

Since: 2.0.1

Instance details
Data Integer Source #

Since: 4.0.0.0

Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Integer -> c Integer Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer Source #

toConstr :: Integer -> Constr Source #

dataTypeOf :: Integer -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) Source #

gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer Source #

Num Integer Source #

Since: 2.1

Instance details
Ord Integer 
Instance details
Read Integer Source #

Since: 2.1

Instance details
Real Integer Source #

Since: 2.0.1

Instance details
Show Integer Source #

Since: 2.1

Instance details
Ix Integer Source #

Since: 2.1

Instance details
Bits Integer Source #

Since: 2.1

Instance details
PrintfArg Integer Source #

Since: 2.1

Instance details

data Float #

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

Instances
Enum Float Source #

Since: 2.1

Instance details
Eq Float 
Instance details

Methods

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

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

Floating Float Source #

Since: 2.1

Instance details
Fractional Float Source #

Since: 2.1

Instance details
Data Float Source #

Since: 4.0.0.0

Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Float -> c Float Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Float Source #

toConstr :: Float -> Constr Source #

dataTypeOf :: Float -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Float) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Float) Source #

gmapT :: (forall b. Data b => b -> b) -> Float -> Float Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Float -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Float -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Float -> m Float Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float Source #

Num Float Source #

Since: 2.1

Instance details
Ord Float 
Instance details

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 #

Read Float Source #

Since: 2.1

Instance details
Real Float Source #

Since: 2.1

Instance details
RealFloat Float Source #

Since: 2.1

Instance details
RealFrac Float Source #

Since: 2.1

Instance details

Methods

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

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

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

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

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

Show Float Source #

Since: 2.1

Instance details
Storable Float Source #

Since: 2.1

Instance details
PrintfArg Float Source #

Since: 2.1

Instance details
Generic1 (URec Float :: k -> *) Source # 
Instance details

Associated Types

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

Methods

from1 :: URec Float a -> Rep1 (URec Float) a Source #

to1 :: Rep1 (URec Float) a -> URec Float a Source #

Functor (URec Float :: * -> *) Source # 
Instance details

Methods

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

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

Foldable (URec Float :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Float m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Float a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Float a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Float a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Float a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Float a -> b Source #

foldr1 :: (a -> a -> a) -> URec Float a -> a Source #

foldl1 :: (a -> a -> a) -> URec Float a -> a Source #

toList :: URec Float a -> [a] Source #

null :: URec Float a -> Bool Source #

length :: URec Float a -> Int Source #

elem :: Eq a => a -> URec Float a -> Bool Source #

maximum :: Ord a => URec Float a -> a Source #

minimum :: Ord a => URec Float a -> a Source #

sum :: Num a => URec Float a -> a Source #

product :: Num a => URec Float a -> a Source #

Traversable (URec Float :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) Source #

sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) Source #

mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) Source #

sequence :: Monad m => URec Float (m a) -> m (URec Float a) Source #

Eq (URec Float p) # 
Instance details

Methods

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

(/=) :: URec Float p -> URec Float p -> Bool #

Ord (URec Float p) # 
Instance details

Methods

compare :: URec Float p -> URec Float p -> Ordering #

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

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

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

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

max :: URec Float p -> URec Float p -> URec Float p #

min :: URec Float p -> URec Float p -> URec Float p #

Show (URec Float p) Source # 
Instance details
Generic (URec Float p) Source # 
Instance details

Associated Types

type Rep (URec Float p) :: * -> * Source #

Methods

from :: URec Float p -> Rep (URec Float p) x Source #

to :: Rep (URec Float p) x -> URec Float p Source #

data URec Float (p :: k) Source #

Used for marking occurrences of Float#

Since: 4.9.0.0

Instance details
data URec Float (p :: k) = UFloat {}
type Rep1 (URec Float :: k -> *) Source # 
Instance details
type Rep1 (URec Float :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: k -> *)))
type Rep (URec Float p) Source # 
Instance details
type Rep (URec Float p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: * -> *)))

data Double #

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

Instances
Enum Double Source #

Since: 2.1

Instance details
Eq Double 
Instance details

Methods

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

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

Floating Double Source #

Since: 2.1

Instance details
Fractional Double Source #

Since: 2.1

Instance details
Data Double Source #

Since: 4.0.0.0

Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Double -> c Double Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Double Source #

toConstr :: Double -> Constr Source #

dataTypeOf :: Double -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Double) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Double) Source #

gmapT :: (forall b. Data b => b -> b) -> Double -> Double Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Double -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Double -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Double -> m Double Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double Source #

Num Double Source #

Since: 2.1

Instance details
Ord Double 
Instance details
Read Double Source #

Since: 2.1

Instance details
Real Double Source #

Since: 2.1

Instance details
RealFloat Double Source #

Since: 2.1

Instance details
RealFrac Double Source #

Since: 2.1

Instance details
Show Double Source #

Since: 2.1

Instance details
Storable Double Source #

Since: 2.1

Instance details
PrintfArg Double Source #

Since: 2.1

Instance details
Generic1 (URec Double :: k -> *) Source # 
Instance details

Associated Types

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

Functor (URec Double :: * -> *) Source # 
Instance details

Methods

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

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

Foldable (URec Double :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Double m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Double a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Double a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Double a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Double a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Double a -> b Source #

foldr1 :: (a -> a -> a) -> URec Double a -> a Source #

foldl1 :: (a -> a -> a) -> URec Double a -> a Source #

toList :: URec Double a -> [a] Source #

null :: URec Double a -> Bool Source #

length :: URec Double a -> Int Source #

elem :: Eq a => a -> URec Double a -> Bool Source #

maximum :: Ord a => URec Double a -> a Source #

minimum :: Ord a => URec Double a -> a Source #

sum :: Num a => URec Double a -> a Source #

product :: Num a => URec Double a -> a Source #

Traversable (URec Double :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) Source #

sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) Source #

mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) Source #

sequence :: Monad m => URec Double (m a) -> m (URec Double a) Source #

Eq (URec Double p) # 
Instance details

Methods

(==) :: URec Double p -> URec Double p -> Bool #

(/=) :: URec Double p -> URec Double p -> Bool #

Ord (URec Double p) # 
Instance details

Methods

compare :: URec Double p -> URec Double p -> Ordering #

(<) :: URec Double p -> URec Double p -> Bool #

(<=) :: URec Double p -> URec Double p -> Bool #

(>) :: URec Double p -> URec Double p -> Bool #

(>=) :: URec Double p -> URec Double p -> Bool #

max :: URec Double p -> URec Double p -> URec Double p #

min :: URec Double p -> URec Double p -> URec Double p #

Show (URec Double p) Source # 
Instance details
Generic (URec Double p) Source # 
Instance details

Associated Types

type Rep (URec Double p) :: * -> * Source #

Methods

from :: URec Double p -> Rep (URec Double p) x Source #

to :: Rep (URec Double p) x -> URec Double p Source #

data URec Double (p :: k) Source #

Used for marking occurrences of Double#

Since: 4.9.0.0

Instance details
data URec Double (p :: k) = UDouble {}
type Rep1 (URec Double :: k -> *) Source # 
Instance details
type Rep1 (URec Double :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: k -> *)))
type Rep (URec Double p) Source # 
Instance details
type Rep (URec Double p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: * -> *)))

type 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 Word #

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

Instances
Bounded Word Source #

Since: 2.1

Instance details
Enum Word Source #

Since: 2.1

Instance details
Eq Word 
Instance details

Methods

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

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

Integral Word Source #

Since: 2.1

Instance details
Data Word Source #

Since: 4.0.0.0

Instance details

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word -> c Word Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word Source #

toConstr :: Word -> Constr Source #

dataTypeOf :: Word -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word) Source #

gmapT :: (forall b. Data b => b -> b) -> Word -> Word Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Word -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Word -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word -> m Word Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word Source #

Num Word Source #

Since: 2.1

Instance details
Ord Word 
Instance details

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 #

Read Word Source #

Since: 4.5.0.0

Instance details
Real Word Source #

Since: 2.1

Instance details
Show Word Source #

Since: 2.1

Instance details
Ix Word Source #

Since: 4.6.0.0

Instance details
FiniteBits Word Source #

Since: 4.6.0.0

Instance details
Bits Word Source #

Since: 2.1

Instance details
Storable Word Source #

Since: 2.1

Instance details
PrintfArg Word Source #

Since: 2.1

Instance details
Generic1 (URec Word :: k -> *) Source # 
Instance details

Associated Types

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

Methods

from1 :: URec Word a -> Rep1 (URec Word) a Source #

to1 :: Rep1 (URec Word) a -> URec Word a Source #

Functor (URec Word :: * -> *) Source # 
Instance details

Methods

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

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

Foldable (URec Word :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Word m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Word a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Word a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Word a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Word a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Word a -> b Source #

foldr1 :: (a -> a -> a) -> URec Word a -> a Source #

foldl1 :: (a -> a -> a) -> URec Word a -> a Source #

toList :: URec Word a -> [a] Source #

null :: URec Word a -> Bool Source #

length :: URec Word a -> Int Source #

elem :: Eq a => a -> URec Word a -> Bool Source #

maximum :: Ord a => URec Word a -> a Source #

minimum :: Ord a => URec Word a -> a Source #

sum :: Num a => URec Word a -> a Source #

product :: Num a => URec Word a -> a Source #

Traversable (URec Word :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) Source #

sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) Source #

mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) Source #

sequence :: Monad m => URec Word (m a) -> m (URec Word a) Source #

Eq (URec Word p) # 
Instance details

Methods

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

(/=) :: URec Word p -> URec Word p -> Bool #

Ord (URec Word p) # 
Instance details

Methods

compare :: URec Word p -> URec Word p -> Ordering #

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

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

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

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

max :: URec Word p -> URec Word p -> URec Word p #

min :: URec Word p -> URec Word p -> URec Word p #

Show (URec Word p) Source # 
Instance details
Generic (URec Word p) Source # 
Instance details

Associated Types

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

Methods

from :: URec Word p -> Rep (URec Word p) x Source #

to :: Rep (URec Word p) x -> URec Word p Source #

data URec Word (p :: k) Source #

Used for marking occurrences of Word#

Since: 4.9.0.0

Instance details
data URec Word (p :: k) = UWord {}
type Rep1 (URec Word :: k -> *) Source # 
Instance details
type Rep1 (URec Word :: k -> *) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UWord" PrefixI True) (S1 (MetaSel (Just "uWord#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UWord :: k -> *)))
type Rep (URec Word p) Source # 
Instance details
type Rep (URec Word p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UWord" PrefixI True) (S1 (MetaSel (Just "uWord#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UWord :: * -> *)))

Numeric type classes

class Num a where Source #

Basic numeric class.

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

Since: 2.1

Instance details
Num Float Source #

Since: 2.1

Instance details
Num Int Source #

Since: 2.1

Instance details
Num Int8 Source #

Since: 2.1

Instance details
Num Int16 Source #

Since: 2.1

Instance details
Num Int32 Source #

Since: 2.1

Instance details
Num Int64 Source #

Since: 2.1

Instance details
Num Integer Source #

Since: 2.1

Instance details
Num Natural Source #

Since: 4.8.0.0

Instance details
Num Word Source #

Since: 2.1

Instance details
Num Word8 Source #

Since: 2.1

Instance details
Num Word16 Source #

Since: 2.1

Instance details
Num Word32 Source #

Since: 2.1

Instance details
Num Word64 Source #

Since: 2.1

Instance details
Num IntPtr Source # 
Instance details
Num WordPtr Source # 
Instance details
Num CUIntMax Source # 
Instance details
Num CIntMax Source # 
Instance details
Num CUIntPtr Source # 
Instance details
Num CIntPtr Source # 
Instance details
Num CSUSeconds Source # 
Instance details
Num CUSeconds Source # 
Instance details
Num CTime Source # 
Instance details
Num CClock Source # 
Instance details
Num CSigAtomic Source # 
Instance details
Num CWchar Source # 
Instance details
Num CSize Source # 
Instance details
Num CPtrdiff Source # 
Instance details
Num CDouble Source # 
Instance details
Num CFloat Source # 
Instance details
Num CBool Source # 
Instance details
Num CULLong Source # 
Instance details
Num CLLong Source # 
Instance details
Num CULong Source # 
Instance details
Num CLong Source # 
Instance details
Num CUInt Source # 
Instance details
Num CInt Source # 
Instance details
Num CUShort Source # 
Instance details
Num CShort Source # 
Instance details
Num CUChar Source # 
Instance details
Num CSChar Source # 
Instance details
Num CChar Source # 
Instance details
Num Fd Source # 
Instance details

Methods

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

(-) :: Fd -> Fd -> Fd Source #

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

negate :: Fd -> Fd Source #

abs :: Fd -> Fd Source #

signum :: Fd -> Fd Source #

fromInteger :: Integer -> Fd Source #

Num CKey Source # 
Instance details
Num CId Source # 
Instance details
Num CFsFilCnt Source # 
Instance details
Num CFsBlkCnt Source # 
Instance details
Num CClockId Source # 
Instance details
Num CBlkCnt Source # 
Instance details
Num CBlkSize Source # 
Instance details
Num CRLim Source # 
Instance details
Num CTcflag Source # 
Instance details
Num CSpeed Source # 
Instance details
Num CCc Source # 
Instance details
Num CUid Source # 
Instance details
Num CNlink Source # 
Instance details
Num CGid Source # 
Instance details
Num CSsize Source # 
Instance details
Num CPid Source # 
Instance details
Num COff Source # 
Instance details
Num CMode Source # 
Instance details
Num CIno Source # 
Instance details
Num CDev Source # 
Instance details
Integral a => Num (Ratio a) Source #

Since: 2.0.1

Instance details

Methods

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

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

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

negate :: Ratio a -> Ratio a Source #

abs :: Ratio a -> Ratio a Source #

signum :: Ratio a -> Ratio a Source #

fromInteger :: Integer -> Ratio a Source #

Num a => Num (Down a) Source #

Since: 4.11.0.0

Instance details

Methods

(+) :: Down a -> Down a -> Down a Source #

(-) :: Down a -> Down a -> Down a Source #

(*) :: Down a -> Down a -> Down a Source #

negate :: Down a -> Down a Source #

abs :: Down a -> Down a Source #

signum :: Down a -> Down a Source #

fromInteger :: Integer -> Down a Source #

Num a => Num (Product a) Source # 
Instance details
Num a => Num (Sum a) Source # 
Instance details

Methods

(+) :: Sum a -> Sum a -> Sum a Source #

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

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

negate :: Sum a -> Sum a Source #

abs :: Sum a -> Sum a Source #

signum :: Sum a -> Sum a Source #

fromInteger :: Integer -> Sum a Source #

Num a => Num (Identity a) Source # 
Instance details
Num a => Num (Max a) Source #

Since: 4.9.0.0

Instance details

Methods

(+) :: Max a -> Max a -> Max a Source #

(-) :: Max a -> Max a -> Max a Source #

(*) :: Max a -> Max a -> Max a Source #

negate :: Max a -> Max a Source #

abs :: Max a -> Max a Source #

signum :: Max a -> Max a Source #

fromInteger :: Integer -> Max a Source #

Num a => Num (Min a) Source #

Since: 4.9.0.0

Instance details

Methods

(+) :: Min a -> Min a -> Min a Source #

(-) :: Min a -> Min a -> Min a Source #

(*) :: Min a -> Min a -> Min a Source #

negate :: Min a -> Min a Source #

abs :: Min a -> Min a Source #

signum :: Min a -> Min a Source #

fromInteger :: Integer -> Min a Source #

HasResolution a => Num (Fixed a) Source #

Since: 2.1

Instance details

Methods

(+) :: Fixed a -> Fixed a -> Fixed a Source #

(-) :: Fixed a -> Fixed a -> Fixed a Source #

(*) :: Fixed a -> Fixed a -> Fixed a Source #

negate :: Fixed a -> Fixed a Source #

abs :: Fixed a -> Fixed a Source #

signum :: Fixed a -> Fixed a Source #

fromInteger :: Integer -> Fixed a Source #

RealFloat a => Num (Complex a) Source #

Since: 2.1

Instance details
Num (f a) => Num (Alt f a) Source # 
Instance details

Methods

(+) :: Alt f a -> Alt f a -> Alt f a Source #

(-) :: Alt f a -> Alt f a -> Alt f a Source #

(*) :: Alt f a -> Alt f a -> Alt f a Source #

negate :: Alt f a -> Alt f a Source #

abs :: Alt f a -> Alt f a Source #

signum :: Alt f a -> Alt f a Source #

fromInteger :: Integer -> Alt f a Source #

Num a => Num (Const a b) Source # 
Instance details

Methods

(+) :: Const a b -> Const a b -> Const a b Source #

(-) :: Const a b -> Const a b -> Const a b Source #

(*) :: Const a b -> Const a b -> Const a b Source #

negate :: Const a b -> Const a b Source #

abs :: Const a b -> Const a b Source #

signum :: Const a b -> Const a b Source #

fromInteger :: Integer -> Const a b Source #

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

Minimal complete definition

toRational

Methods

toRational :: a -> Rational Source #

the rational equivalent of its real argument with full precision

Instances
Real Double Source #

Since: 2.1

Instance details
Real Float Source #

Since: 2.1

Instance details
Real Int Source #

Since: 2.0.1

Instance details
Real Int8 Source #

Since: 2.1

Instance details
Real Int16 Source #

Since: 2.1

Instance details
Real Int32 Source #

Since: 2.1

Instance details
Real Int64 Source #

Since: 2.1

Instance details
Real Integer Source #

Since: 2.0.1

Instance details
Real Natural Source #

Since: 4.8.0.0

Instance details
Real Word Source #

Since: 2.1

Instance details
Real Word8 Source #

Since: 2.1

Instance details
Real Word16 Source #

Since: 2.1

Instance details
Real Word32 Source #

Since: 2.1

Instance details
Real Word64 Source #

Since: 2.1

Instance details
Real IntPtr Source # 
Instance details
Real WordPtr Source # 
Instance details
Real CUIntMax Source # 
Instance details
Real CIntMax Source # 
Instance details
Real CUIntPtr Source # 
Instance details
Real CIntPtr Source # 
Instance details
Real CSUSeconds Source # 
Instance details
Real CUSeconds Source # 
Instance details
Real CTime Source # 
Instance details
Real CClock Source # 
Instance details
Real CSigAtomic Source # 
Instance details
Real CWchar Source # 
Instance details
Real CSize Source # 
Instance details
Real CPtrdiff Source # 
Instance details
Real CDouble Source # 
Instance details
Real CFloat Source # 
Instance details
Real CBool Source # 
Instance details
Real CULLong Source # 
Instance details
Real CLLong Source # 
Instance details
Real CULong Source # 
Instance details
Real CLong Source # 
Instance details
Real CUInt Source # 
Instance details
Real CInt Source # 
Instance details
Real CUShort Source # 
Instance details
Real CShort Source # 
Instance details
Real CUChar Source # 
Instance details
Real CSChar Source # 
Instance details
Real CChar Source # 
Instance details
Real Fd Source # 
Instance details
Real CKey Source # 
Instance details
Real CId Source # 
Instance details
Real CFsFilCnt Source # 
Instance details
Real CFsBlkCnt Source # 
Instance details
Real CClockId Source # 
Instance details
Real CBlkCnt Source # 
Instance details
Real CBlkSize Source # 
Instance details
Real CRLim Source # 
Instance details
Real CTcflag Source # 
Instance details
Real CSpeed Source # 
Instance details
Real CCc Source # 
Instance details
Real CUid Source # 
Instance details
Real CNlink Source # 
Instance details
Real CGid Source # 
Instance details
Real CSsize Source # 
Instance details
Real CPid Source # 
Instance details
Real COff Source # 
Instance details
Real CMode Source # 
Instance details
Real CIno Source # 
Instance details
Real CDev Source # 
Instance details
Integral a => Real (Ratio a) Source #

Since: 2.0.1

Instance details
Real a => Real (Identity a) Source # 
Instance details
HasResolution a => Real (Fixed a) Source #

Since: 2.1

Instance details
Real a => Real (Const a b) Source # 
Instance details

Methods

toRational :: Const a b -> Rational Source #

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

Integral numbers, supporting integer division.

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

Since: 2.0.1

Instance details

Methods

quot :: Int -> Int -> Int Source #

rem :: Int -> Int -> Int Source #

div :: Int -> Int -> Int Source #

mod :: Int -> Int -> Int Source #

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

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

toInteger :: Int -> Integer Source #

Integral Int8 Source #

Since: 2.1

Instance details
Integral Int16 Source #

Since: 2.1

Instance details
Integral Int32 Source #

Since: 2.1

Instance details
Integral Int64 Source #

Since: 2.1

Instance details
Integral Integer Source #

Since: 2.0.1

Instance details
Integral Natural Source #

Since: 4.8.0.0

Instance details
Integral Word Source #

Since: 2.1

Instance details
Integral Word8 Source #

Since: 2.1

Instance details
Integral Word16 Source #

Since: 2.1

Instance details
Integral Word32 Source #

Since: 2.1

Instance details
Integral Word64 Source #

Since: 2.1

Instance details
Integral IntPtr Source # 
Instance details
Integral WordPtr Source # 
Instance details
Integral CUIntMax Source # 
Instance details
Integral CIntMax Source # 
Instance details
Integral CUIntPtr Source # 
Instance details
Integral CIntPtr Source # 
Instance details
Integral CSigAtomic Source # 
Instance details
Integral CWchar Source # 
Instance details
Integral CSize Source # 
Instance details
Integral CPtrdiff Source # 
Instance details
Integral CBool Source # 
Instance details
Integral CULLong Source # 
Instance details
Integral CLLong Source # 
Instance details
Integral CULong Source # 
Instance details
Integral CLong Source # 
Instance details
Integral CUInt Source # 
Instance details
Integral CInt Source # 
Instance details
Integral CUShort Source # 
Instance details
Integral CShort Source # 
Instance details
Integral CUChar Source # 
Instance details
Integral CSChar Source # 
Instance details
Integral CChar Source # 
Instance details
Integral Fd Source # 
Instance details

Methods

quot :: Fd -> Fd -> Fd Source #

rem :: Fd -> Fd -> Fd Source #

div :: Fd -> Fd -> Fd Source #

mod :: Fd -> Fd -> Fd Source #

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

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

toInteger :: Fd -> Integer Source #

Integral CKey Source # 
Instance details
Integral CId Source # 
Instance details

Methods

quot :: CId -> CId -> CId Source #

rem :: CId -> CId -> CId Source #

div :: CId -> CId -> CId Source #

mod :: CId -> CId -> CId Source #

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

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

toInteger :: CId -> Integer Source #

Integral CFsFilCnt Source # 
Instance details
Integral CFsBlkCnt Source # 
Instance details
Integral CClockId Source # 
Instance details
Integral CBlkCnt Source # 
Instance details
Integral CBlkSize Source # 
Instance details
Integral CRLim Source # 
Instance details
Integral CTcflag Source # 
Instance details
Integral CUid Source # 
Instance details
Integral CNlink Source # 
Instance details
Integral CGid Source # 
Instance details
Integral CSsize Source # 
Instance details
Integral CPid Source # 
Instance details
Integral COff Source # 
Instance details
Integral CMode Source # 
Instance details
Integral CIno Source # 
Instance details
Integral CDev Source # 
Instance details
Integral a => Integral (Identity a) Source # 
Instance details
Integral a => Integral (Const a b) Source # 
Instance details

Methods

quot :: Const a b -> Const a b -> Const a b Source #

rem :: Const a b -> Const a b -> Const a b Source #

div :: Const a b -> Const a b -> Const a b Source #

mod :: Const a b -> Const a b -> Const a b Source #

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

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

toInteger :: Const a b -> Integer Source #

class Num a => Fractional a where Source #

Fractional numbers, supporting real division.

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

Since: 2.1

Instance details
Fractional Float Source #

Since: 2.1

Instance details
Fractional CDouble Source # 
Instance details
Fractional CFloat Source # 
Instance details
Integral a => Fractional (Ratio a) Source #

Since: 2.0.1

Instance details

Methods

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

recip :: Ratio a -> Ratio a Source #

fromRational :: Rational -> Ratio a Source #

Fractional a => Fractional (Identity a) Source # 
Instance details
HasResolution a => Fractional (Fixed a) Source #

Since: 2.1

Instance details

Methods

(/) :: Fixed a -> Fixed a -> Fixed a Source #

recip :: Fixed a -> Fixed a Source #

fromRational :: Rational -> Fixed a Source #

RealFloat a => Fractional (Complex a) Source #

Since: 2.1

Instance details
Fractional a => Fractional (Const a b) Source # 
Instance details

Methods

(/) :: Const a b -> Const a b -> Const a b Source #

recip :: Const a b -> Const a b Source #

fromRational :: Rational -> Const a b Source #

class Fractional a => Floating a where Source #

Trigonometric and hyperbolic functions and related functions.

Minimal complete definition

pi, exp, log, sin, cos, asin, acos, atan, sinh, cosh, asinh, acosh, atanh

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 #

Instances
Floating Double Source #

Since: 2.1

Instance details
Floating Float Source #

Since: 2.1

Instance details
Floating CDouble Source # 
Instance details
Floating CFloat Source # 
Instance details
Floating a => Floating (Identity a) Source # 
Instance details
RealFloat a => Floating (Complex a) Source #

Since: 2.1

Instance details
Floating a => Floating (Const a b) Source # 
Instance details

Methods

pi :: Const a b Source #

exp :: Const a b -> Const a b Source #

log :: Const a b -> Const a b Source #

sqrt :: Const a b -> Const a b Source #

(**) :: Const a b -> Const a b -> Const a b Source #

logBase :: Const a b -> Const a b -> Const a b Source #

sin :: Const a b -> Const a b Source #

cos :: Const a b -> Const a b Source #

tan :: Const a b -> Const a b Source #

asin :: Const a b -> Const a b Source #

acos :: Const a b -> Const a b Source #

atan :: Const a b -> Const a b Source #

sinh :: Const a b -> Const a b Source #

cosh :: Const a b -> Const a b Source #

tanh :: Const a b -> Const a b Source #

asinh :: Const a b -> Const a b Source #

acosh :: Const a b -> Const a b Source #

atanh :: Const a b -> Const a b Source #

log1p :: Const a b -> Const a b Source #

expm1 :: Const a b -> Const a b Source #

log1pexp :: Const a b -> Const a b Source #

log1mexp :: Const a b -> Const a b Source #

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

Since: 2.1

Instance details
RealFrac Float Source #

Since: 2.1

Instance details

Methods

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

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

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

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

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

RealFrac CDouble Source # 
Instance details
RealFrac CFloat Source # 
Instance details
Integral a => RealFrac (Ratio a) Source #

Since: 2.0.1

Instance details

Methods

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

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

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

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

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

RealFrac a => RealFrac (Identity a) Source # 
Instance details

Methods

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

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

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

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

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

HasResolution a => RealFrac (Fixed a) Source #

Since: 2.1

Instance details

Methods

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

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

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

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

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

RealFrac a => RealFrac (Const a b) Source # 
Instance details

Methods

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

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

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

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

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

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

Since: 2.1

Instance details
RealFloat Float Source #

Since: 2.1

Instance details
RealFloat CDouble Source # 
Instance details
RealFloat CFloat Source # 
Instance details
RealFloat a => RealFloat (Identity a) Source # 
Instance details
RealFloat a => RealFloat (Const a b) Source # 
Instance details

Numeric functions

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.

even :: Integral a => a -> Bool Source #

odd :: Integral a => a -> Bool Source #

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.

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

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

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

raise a number to a non-negative integral power

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

raise a number to an integral power

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

Semigroups and Monoids

class Semigroup a where Source #

The class of semigroups (types with an associative binary operation).

Instances should satisfy the associativity law:

Since: 4.9.0.0

Minimal complete definition

(<>)

Methods

(<>) :: a -> a -> a infixr 6 Source #

An associative operation.

Instances
Semigroup Ordering Source #

Since: 4.9.0.0

Instance details
Semigroup () Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: () -> () -> () Source #

sconcat :: NonEmpty () -> () Source #

stimes :: Integral b => b -> () -> () Source #

Semigroup Any Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Any -> Any -> Any Source #

sconcat :: NonEmpty Any -> Any Source #

stimes :: Integral b => b -> Any -> Any Source #

Semigroup All Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: All -> All -> All Source #

sconcat :: NonEmpty All -> All Source #

stimes :: Integral b => b -> All -> All Source #

Semigroup Lifetime Source #

Since: 4.10.0.0

Instance details
Semigroup Event Source #

Since: 4.10.0.0

Instance details
Semigroup Void Source #

Since: 4.9.0.0

Instance details
Semigroup [a] Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: [a] -> [a] -> [a] Source #

sconcat :: NonEmpty [a] -> [a] Source #

stimes :: Integral b => b -> [a] -> [a] Source #

Semigroup a => Semigroup (Maybe a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Maybe a -> Maybe a -> Maybe a Source #

sconcat :: NonEmpty (Maybe a) -> Maybe a Source #

stimes :: Integral b => b -> Maybe a -> Maybe a Source #

Semigroup a => Semigroup (IO a) Source #

Since: 4.10.0.0

Instance details

Methods

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

sconcat :: NonEmpty (IO a) -> IO a Source #

stimes :: Integral b => b -> IO a -> IO a Source #

Semigroup (NonEmpty a) Source #

Since: 4.9.0.0

Instance details
Semigroup a => Semigroup (Down a) Source #

Since: 4.11.0.0

Instance details

Methods

(<>) :: Down a -> Down a -> Down a Source #

sconcat :: NonEmpty (Down a) -> Down a Source #

stimes :: Integral b => b -> Down a -> Down a Source #

Num a => Semigroup (Product a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Product a -> Product a -> Product a Source #

sconcat :: NonEmpty (Product a) -> Product a Source #

stimes :: Integral b => b -> Product a -> Product a Source #

Num a => Semigroup (Sum a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Sum a -> Sum a -> Sum a Source #

sconcat :: NonEmpty (Sum a) -> Sum a Source #

stimes :: Integral b => b -> Sum a -> Sum a Source #

Semigroup (Endo a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Endo a -> Endo a -> Endo a Source #

sconcat :: NonEmpty (Endo a) -> Endo a Source #

stimes :: Integral b => b -> Endo a -> Endo a Source #

Semigroup a => Semigroup (Dual a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Dual a -> Dual a -> Dual a Source #

sconcat :: NonEmpty (Dual a) -> Dual a Source #

stimes :: Integral b => b -> Dual a -> Dual a Source #

Semigroup (Last a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Last a -> Last a -> Last a Source #

sconcat :: NonEmpty (Last a) -> Last a Source #

stimes :: Integral b => b -> Last a -> Last a Source #

Semigroup (First a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: First a -> First a -> First a Source #

sconcat :: NonEmpty (First a) -> First a Source #

stimes :: Integral b => b -> First a -> First a Source #

Semigroup a => Semigroup (Identity a) Source # 
Instance details
Semigroup a => Semigroup (Option a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Option a -> Option a -> Option a Source #

sconcat :: NonEmpty (Option a) -> Option a Source #

stimes :: Integral b => b -> Option a -> Option a Source #

Monoid m => Semigroup (WrappedMonoid m) Source #

Since: 4.9.0.0

Instance details
Semigroup (Last a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Last a -> Last a -> Last a Source #

sconcat :: NonEmpty (Last a) -> Last a Source #

stimes :: Integral b => b -> Last a -> Last a Source #

Semigroup (First a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: First a -> First a -> First a Source #

sconcat :: NonEmpty (First a) -> First a Source #

stimes :: Integral b => b -> First a -> First a Source #

Ord a => Semigroup (Max a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Max a -> Max a -> Max a Source #

sconcat :: NonEmpty (Max a) -> Max a Source #

stimes :: Integral b => b -> Max a -> Max a Source #

Ord a => Semigroup (Min a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Min a -> Min a -> Min a Source #

sconcat :: NonEmpty (Min a) -> Min a Source #

stimes :: Integral b => b -> Min a -> Min a Source #

Semigroup b => Semigroup (a -> b) Source #

Since: 4.9.0.0

Instance details

Methods

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

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

stimes :: Integral b0 => b0 -> (a -> b) -> a -> b Source #

Semigroup (Either a b) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Either a b -> Either a b -> Either a b Source #

sconcat :: NonEmpty (Either a b) -> Either a b Source #

stimes :: Integral b0 => b0 -> Either a b -> Either a b Source #

(Semigroup a, Semigroup b) => Semigroup (a, b) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: (a, b) -> (a, b) -> (a, b) Source #

sconcat :: NonEmpty (a, b) -> (a, b) Source #

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

Semigroup a => Semigroup (ST s a) Source #

Since: 4.11.0.0

Instance details

Methods

(<>) :: ST s a -> ST s a -> ST s a Source #

sconcat :: NonEmpty (ST s a) -> ST s a Source #

stimes :: Integral b => b -> ST s a -> ST s a Source #

Semigroup (Proxy s) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Proxy s -> Proxy s -> Proxy s Source #

sconcat :: NonEmpty (Proxy s) -> Proxy s Source #

stimes :: Integral b => b -> Proxy s -> Proxy s Source #

(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #

sconcat :: NonEmpty (a, b, c) -> (a, b, c) Source #

stimes :: Integral b0 => b0 -> (a, b, c) -> (a, b, c) Source #

Alternative f => Semigroup (Alt f a) Source #

Since: 4.9.0.0

Instance details

Methods

(<>) :: Alt f a -> Alt f a -> Alt f a Source #

sconcat :: NonEmpty (Alt f a) -> Alt f a Source #

stimes :: Integral b => b -> Alt f a -> Alt f a Source #

Semigroup a => Semigroup (Const a b) Source # 
Instance details

Methods

(<>) :: Const a b -> Const a b -> Const a b Source #

sconcat :: NonEmpty (Const a b) -> Const a b Source #

stimes :: Integral b0 => b0 -> Const a b -> Const a b Source #

(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) Source #

Since: 4.9.0.0

Instance details

Methods

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

sconcat :: NonEmpty (a, b, c, d) -> (a, b, c, d) Source #

stimes :: Integral b0 => b0 -> (a, b, c, d) -> (a, b, c, d) Source #

(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) Source #

Since: 4.9.0.0

Instance details

Methods

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

sconcat :: NonEmpty (a, b, c, d, e) -> (a, b, c, d, e) Source #

stimes :: Integral b0 => b0 -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

class Semigroup a => Monoid a where Source #

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define newtypes and make those instances of Monoid, e.g. Sum and Product.

NOTE: Semigroup is a superclass of Monoid since base-4.11.0.0.

Minimal complete definition

mempty

Methods

mempty :: a Source #

Identity of mappend

mappend :: a -> a -> a Source #

An associative operation

NOTE: This method is redundant and has the default implementation mappend = '(<>)' since base-4.11.0.0.

mconcat :: [a] -> a Source #

Fold a list using the monoid.

For most types, the default definition for mconcat will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

Instances
Monoid Ordering Source #

Since: 2.1

Instance details
Monoid () Source #

Since: 2.1

Instance details

Methods

mempty :: () Source #

mappend :: () -> () -> () Source #

mconcat :: [()] -> () Source #

Monoid Any Source #

Since: 2.1

Instance details
Monoid All Source #

Since: 2.1

Instance details
Monoid Lifetime Source #

mappend takes the longer of two lifetimes.

Since: 4.8.0.0

Instance details
Monoid Event Source #

Since: 4.3.1.0

Instance details
Monoid [a] Source #

Since: 2.1

Instance details

Methods

mempty :: [a] Source #

mappend :: [a] -> [a] -> [a] Source #

mconcat :: [[a]] -> [a] Source #

Semigroup a => Monoid (Maybe a) Source #

Lift a semigroup into Maybe forming a Monoid according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup S may be turned into a monoid simply by adjoining an element e not in S and defining e*e = e and e*s = s = s*e for all s ∈ S."

Since 4.11.0: constraint on inner a value generalised from Monoid to Semigroup.

Since: 2.1

Instance details

Methods

mempty :: Maybe a Source #

mappend :: Maybe a -> Maybe a -> Maybe a Source #

mconcat :: [Maybe a] -> Maybe a Source #

Monoid a => Monoid (IO a) Source #

Since: 4.9.0.0

Instance details

Methods

mempty :: IO a Source #

mappend :: IO a -> IO a -> IO a Source #

mconcat :: [IO a] -> IO a Source #

Monoid a => Monoid (Down a) Source #

Since: 4.11.0.0

Instance details

Methods

mempty :: Down a Source #

mappend :: Down a -> Down a -> Down a Source #

mconcat :: [Down a] -> Down a Source #

Num a => Monoid (Product a) Source #

Since: 2.1

Instance details
Num a => Monoid (Sum a) Source #

Since: 2.1

Instance details

Methods

mempty :: Sum a Source #

mappend :: Sum a -> Sum a -> Sum a Source #

mconcat :: [Sum a] -> Sum a Source #

Monoid (Endo a) Source #

Since: 2.1

Instance details

Methods

mempty :: Endo a Source #

mappend :: Endo a -> Endo a -> Endo a Source #

mconcat :: [Endo a] -> Endo a Source #

Monoid a => Monoid (Dual a) Source #

Since: 2.1

Instance details

Methods

mempty :: Dual a Source #

mappend :: Dual a -> Dual a -> Dual a Source #

mconcat :: [Dual a] -> Dual a Source #

Monoid (Last a) Source #

Since: 2.1

Instance details

Methods

mempty :: Last a Source #

mappend :: Last a -> Last a -> Last a Source #

mconcat :: [Last a] -> Last a Source #

Monoid (First a) Source #

Since: 2.1

Instance details

Methods

mempty :: First a Source #

mappend :: First a -> First a -> First a Source #

mconcat :: [First a] -> First a Source #

Monoid a => Monoid (Identity a) Source # 
Instance details
Semigroup a => Monoid (Option a) Source #

Since: 4.9.0.0

Instance details
Monoid m => Monoid (WrappedMonoid m) Source #

Since: 4.9.0.0

Instance details
(Ord a, Bounded a) => Monoid (Max a) Source #

Since: 4.9.0.0

Instance details

Methods

mempty :: Max a Source #

mappend :: Max a -> Max a -> Max a Source #

mconcat :: [Max a] -> Max a Source #

(Ord a, Bounded a) => Monoid (Min a) Source #

Since: 4.9.0.0

Instance details

Methods

mempty :: Min a Source #

mappend :: Min a -> Min a -> Min a Source #

mconcat :: [Min a] -> Min a Source #

Monoid b => Monoid (a -> b) Source #

Since: 2.1

Instance details

Methods

mempty :: a -> b Source #

mappend :: (a -> b) -> (a -> b) -> a -> b Source #

mconcat :: [a -> b] -> a -> b Source #

(Monoid a, Monoid b) => Monoid (a, b) Source #

Since: 2.1

Instance details

Methods

mempty :: (a, b) Source #

mappend :: (a, b) -> (a, b) -> (a, b) Source #

mconcat :: [(a, b)] -> (a, b) Source #

Monoid a => Monoid (ST s a) Source #

Since: 4.11.0.0

Instance details

Methods

mempty :: ST s a Source #

mappend :: ST s a -> ST s a -> ST s a Source #

mconcat :: [ST s a] -> ST s a Source #

Monoid (Proxy s) Source #

Since: 4.7.0.0

Instance details

Methods

mempty :: Proxy s Source #

mappend :: Proxy s -> Proxy s -> Proxy s Source #

mconcat :: [Proxy s] -> Proxy s Source #

(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) Source #

Since: 2.1

Instance details

Methods

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

mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #

mconcat :: [(a, b, c)] -> (a, b, c) Source #

Alternative f => Monoid (Alt f a) Source #

Since: 4.8.0.0

Instance details

Methods

mempty :: Alt f a Source #

mappend :: Alt f a -> Alt f a -> Alt f a Source #

mconcat :: [Alt f a] -> Alt f a Source #

Monoid a => Monoid (Const a b) Source # 
Instance details

Methods

mempty :: Const a b Source #

mappend :: Const a b -> Const a b -> Const a b Source #

mconcat :: [Const a b] -> Const a b Source #

(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) Source #

Since: 2.1

Instance details

Methods

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

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

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

(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) Source #

Since: 2.1

Instance details

Methods

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

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

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

Monads and functors

class Functor f where Source #

The Functor class is used for types that can be mapped over. Instances of Functor should satisfy the following laws:

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

The instances of Functor for lists, Maybe and IO satisfy these laws.

Minimal complete definition

fmap

Methods

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

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

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

Instances
Functor [] Source #

Since: 2.1

Instance details

Methods

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

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

Functor Maybe Source #

Since: 2.1

Instance details

Methods

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

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

Functor IO Source #

Since: 2.1

Instance details

Methods

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

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

Functor Par1 Source # 
Instance details

Methods

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

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

Functor NonEmpty Source #

Since: 4.9.0.0

Instance details

Methods

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

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

Functor ReadP Source #

Since: 2.1

Instance details

Methods

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

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

Functor ReadPrec Source #

Since: 2.1

Instance details

Methods

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

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

Functor Down Source #

Since: 4.11.0.0

Instance details

Methods

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

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

Functor Product Source #

Since: 4.8.0.0

Instance details

Methods

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

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

Functor Sum Source #

Since: 4.8.0.0

Instance details

Methods

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

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

Functor Dual Source #

Since: 4.8.0.0

Instance details

Methods

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

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

Functor Last Source # 
Instance details

Methods

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

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

Functor First Source # 
Instance details

Methods

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

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

Functor STM Source #

Since: 4.3.0.0

Instance details

Methods

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

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

Functor Handler Source #

Since: 4.6.0.0

Instance details

Methods

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

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

Functor Identity Source #

Since: 4.8.0.0

Instance details

Methods

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

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

Functor ZipList Source # 
Instance details

Methods

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

(<$) :: a -> ZipList b -> ZipList a Source #

Functor ArgDescr Source #

Since: 4.6.0.0

Instance details

Methods

fmap :: (a -> b) -> ArgDescr a -> ArgDescr b Source #

(<$) :: a -> ArgDescr b -> ArgDescr a Source #

Functor OptDescr Source #

Since: 4.6.0.0

Instance details

Methods

fmap :: (a -> b) -> OptDescr a -> OptDescr b Source #

(<$) :: a -> OptDescr b -> OptDescr a Source #

Functor ArgOrder Source #

Since: 4.6.0.0

Instance details

Methods

fmap :: (a -> b) -> ArgOrder a -> ArgOrder b Source #

(<$) :: a -> ArgOrder b -> ArgOrder a Source #

Functor Option Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> Option a -> Option b Source #

(<$) :: a -> Option b -> Option a Source #

Functor Last Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> Last a -> Last b Source #

(<$) :: a -> Last b -> Last a Source #

Functor First Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> First a -> First b Source #

(<$) :: a -> First b -> First a Source #

Functor Max Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> Max a -> Max b Source #

(<$) :: a -> Max b -> Max a Source #

Functor Min Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> Min a -> Min b Source #

(<$) :: a -> Min b -> Min a Source #

Functor Complex Source # 
Instance details

Methods

fmap :: (a -> b) -> Complex a -> Complex b Source #

(<$) :: a -> Complex b -> Complex a Source #

Functor (Either a) Source #

Since: 3.0

Instance details

Methods

fmap :: (a0 -> b) -> Either a a0 -> Either a b Source #

(<$) :: a0 -> Either a b -> Either a a0 Source #

Functor (V1 :: * -> *) Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> V1 a -> V1 b Source #

(<$) :: a -> V1 b -> V1 a Source #

Functor (U1 :: * -> *) Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> U1 a -> U1 b Source #

(<$) :: a -> U1 b -> U1 a Source #

Functor ((,) a) Source #

Since: 2.1

Instance details

Methods

fmap :: (a0 -> b) -> (a, a0) -> (a, b) Source #

(<$) :: a0 -> (a, b) -> (a, a0) Source #

Functor (ST s) Source #

Since: 2.1

Instance details

Methods

fmap :: (a -> b) -> ST s a -> ST s b Source #

(<$) :: a -> ST s b -> ST s a Source #

Functor (Proxy :: * -> *) Source #

Since: 4.7.0.0

Instance details

Methods

fmap :: (a -> b) -> Proxy a -> Proxy b Source #

(<$) :: a -> Proxy b -> Proxy a Source #

Arrow a => Functor (ArrowMonad a) Source #

Since: 4.6.0.0

Instance details

Methods

fmap :: (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b Source #

(<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0 Source #

Monad m => Functor (WrappedMonad m) Source #

Since: 2.1

Instance details

Methods

fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source #

(<$) :: a -> WrappedMonad m b -> WrappedMonad m a Source #

Functor (ST s) Source #

Since: 2.1

Instance details

Methods

fmap :: (a -> b) -> ST s a -> ST s b Source #

(<$) :: a -> ST s b -> ST s a Source #

Functor (Arg a) Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a0 -> b) -> Arg a a0 -> Arg a b Source #

(<$) :: a0 -> Arg a b -> Arg a a0 Source #

Functor f => Functor (Rec1 f) Source # 
Instance details

Methods

fmap :: (a -> b) -> Rec1 f a -> Rec1 f b Source #

(<$) :: a -> Rec1 f b -> Rec1 f a Source #

Functor (URec Char :: * -> *) Source # 
Instance details

Methods

fmap :: (a -> b) -> URec Char a -> URec Char b Source #

(<$) :: a -> URec Char b -> URec Char a Source #

Functor (URec Double :: * -> *) Source # 
Instance details

Methods

fmap :: (a -> b) -> URec Double a -> URec Double b Source #

(<$) :: a -> URec Double b -> URec Double a Source #

Functor (URec Float :: * -> *) Source # 
Instance details

Methods

fmap :: (a -> b) -> URec Float a -> URec Float b Source #

(<$) :: a -> URec Float b -> URec Float a Source #

Functor (URec Int :: * -> *) Source # 
Instance details

Methods

fmap :: (a -> b) -> URec Int a -> URec Int b Source #

(<$) :: a -> URec Int b -> URec Int a Source #

Functor (URec Word :: * -> *) Source # 
Instance details

Methods

fmap :: (a -> b) -> URec Word a -> URec Word b Source #

(<$) :: a -> URec Word b -> URec Word a Source #

Functor (URec (Ptr ()) :: * -> *) Source # 
Instance details

Methods

fmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b Source #

(<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a Source #

Functor f => Functor (Alt f) Source # 
Instance details

Methods

fmap :: (a -> b) -> Alt f a -> Alt f b Source #

(<$) :: a -> Alt f b -> Alt f a Source #

Functor (Const m :: * -> *) Source #

Since: 2.1

Instance details

Methods

fmap :: (a -> b) -> Const m a -> Const m b Source #

(<$) :: a -> Const m b -> Const m a Source #

Arrow a => Functor (WrappedArrow a b) Source #

Since: 2.1

Instance details

Methods

fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #

(<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #

Functor ((->) r :: * -> *) Source #

Since: 2.1

Instance details

Methods

fmap :: (a -> b) -> (r -> a) -> r -> b Source #

(<$) :: a -> (r -> b) -> r -> a Source #

Functor (K1 i c :: * -> *) Source # 
Instance details

Methods

fmap :: (a -> b) -> K1 i c a -> K1 i c b Source #

(<$) :: a -> K1 i c b -> K1 i c a Source #

(Functor f, Functor g) => Functor (f :+: g) Source # 
Instance details

Methods

fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b Source #

(<$) :: a -> (f :+: g) b -> (f :+: g) a Source #

(Functor f, Functor g) => Functor (f :*: g) Source # 
Instance details

Methods

fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b Source #

(<$) :: a -> (f :*: g) b -> (f :*: g) a Source #

(Functor f, Functor g) => Functor (Sum f g) Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> Sum f g a -> Sum f g b Source #

(<$) :: a -> Sum f g b -> Sum f g a Source #

(Functor f, Functor g) => Functor (Product f g) Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> Product f g a -> Product f g b Source #

(<$) :: a -> Product f g b -> Product f g a Source #

Functor f => Functor (M1 i c f) Source # 
Instance details

Methods

fmap :: (a -> b) -> M1 i c f a -> M1 i c f b Source #

(<$) :: a -> M1 i c f b -> M1 i c f a Source #

(Functor f, Functor g) => Functor (f :.: g) Source # 
Instance details

Methods

fmap :: (a -> b) -> (f :.: g) a -> (f :.: g) b Source #

(<$) :: a -> (f :.: g) b -> (f :.: g) a Source #

(Functor f, Functor g) => Functor (Compose f g) Source #

Since: 4.9.0.0

Instance details

Methods

fmap :: (a -> b) -> Compose f g a -> Compose f g b Source #

(<$) :: a -> Compose f g b -> Compose f g a Source #

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 Source #

An infix synonym for fmap.

The name of this operator is an allusion to $. Note the similarities between their types:

 ($)  ::              (a -> b) ->   a ->   b
(<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas $ is function application, <$> is function application lifted over a Functor.

Examples

Expand

Convert from a Maybe Int to a Maybe String using show:

>>> show <$> Nothing
Nothing
>>> show <$> Just 3
Just "3"

Convert from an Either Int Int to an Either Int String using show:

>>> show <$> Left 17
Left 17
>>> show <$> Right 17
Right "17"

Double each element of a list:

>>> (*2) <$> [1,2,3]
[2,4,6]

Apply even to the second element of a pair:

>>> even <$> (2,2)
(2,True)

class Functor f => Applicative f where Source #

A functor with application, providing operations to

  • embed pure expressions (pure), and
  • sequence computations and combine their results (<*> and liftA2).

A minimal complete definition must include implementations of pure and of either <*> or liftA2. If it defines both, then they must behave the same as their default definitions:

(<*>) = liftA2 id
liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

identity
pure id <*> v = v
composition
pure (.) <*> u <*> v <*> w = u <*> (v <*> w)
homomorphism
pure f <*> pure x = pure (f x)
interchange
u <*> pure y = pure ($ y) <*> u

The other methods have the following default definitions, which may be overridden with equivalent specialized implementations:

As a consequence of these laws, the Functor instance for f will satisfy

It may be useful to note that supposing

forall x y. p (q x y) = f x . g y

it follows from the above that

liftA2 p (liftA2 q u v) = liftA2 f u . liftA2 g v

If f is also a Monad, it should satisfy

(which implies that pure and <*> satisfy the applicative functor laws).

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a Source #

Lift a value.

(<*>) :: f (a -> b) -> f a -> f b infixl 4 Source #

Sequential application.

A few functors support an implementation of <*> that is more efficient than the default one.

(*>) :: f a -> f b -> f b infixl 4 Source #

Sequence actions, discarding the value of the first argument.

(<*) :: f a -> f b -> f a infixl 4 Source #

Sequence actions, discarding the value of the second argument.

Instances
Applicative [] Source #

Since: 2.1

Instance details

Methods

pure :: a -> [a] Source #

(<*>) :: [a -> b] -> [a] -> [b] Source #

liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] Source #

(*>) :: [a] -> [b] -> [b] Source #

(<*) :: [a] -> [b] -> [a] Source #

Applicative Maybe Source #

Since: 2.1

Instance details

Methods

pure :: a -> Maybe a Source #

(<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b Source #

liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c Source #

(*>) :: Maybe a -> Maybe b -> Maybe b Source #

(<*) :: Maybe a -> Maybe b -> Maybe a Source #

Applicative IO Source #

Since: 2.1

Instance details

Methods

pure :: a -> IO a Source #

(<*>) :: IO (a -> b) -> IO a -> IO b Source #

liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c Source #

(*>) :: IO a -> IO b -> IO b Source #

(<*) :: IO a -> IO b -> IO a Source #

Applicative Par1 Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Par1 a Source #

(<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b Source #

liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c Source #

(*>) :: Par1 a -> Par1 b -> Par1 b Source #

(<*) :: Par1 a -> Par1 b -> Par1 a Source #

Applicative NonEmpty Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> NonEmpty a Source #

(<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b Source #

liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c Source #

(*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b Source #

(<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a Source #

Applicative ReadP Source #

Since: 4.6.0.0

Instance details

Methods

pure :: a -> ReadP a Source #

(<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b Source #

liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c Source #

(*>) :: ReadP a -> ReadP b -> ReadP b Source #

(<*) :: ReadP a -> ReadP b -> ReadP a Source #

Applicative ReadPrec Source #

Since: 4.6.0.0

Instance details

Methods

pure :: a -> ReadPrec a Source #

(<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b Source #

liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c Source #

(*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b Source #

(<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a Source #

Applicative Down Source #

Since: 4.11.0.0

Instance details

Methods

pure :: a -> Down a Source #

(<*>) :: Down (a -> b) -> Down a -> Down b Source #

liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c Source #

(*>) :: Down a -> Down b -> Down b Source #

(<*) :: Down a -> Down b -> Down a Source #

Applicative Product Source #

Since: 4.8.0.0

Instance details

Methods

pure :: a -> Product a Source #

(<*>) :: Product (a -> b) -> Product a -> Product b Source #

liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c Source #

(*>) :: Product a -> Product b -> Product b Source #

(<*) :: Product a -> Product b -> Product a Source #

Applicative Sum Source #

Since: 4.8.0.0

Instance details

Methods

pure :: a -> Sum a Source #

(<*>) :: Sum (a -> b) -> Sum a -> Sum b Source #

liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c Source #

(*>) :: Sum a -> Sum b -> Sum b Source #

(<*) :: Sum a -> Sum b -> Sum a Source #

Applicative Dual Source #

Since: 4.8.0.0

Instance details

Methods

pure :: a -> Dual a Source #

(<*>) :: Dual (a -> b) -> Dual a -> Dual b Source #

liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c Source #

(*>) :: Dual a -> Dual b -> Dual b Source #

(<*) :: Dual a -> Dual b -> Dual a Source #

Applicative Last Source # 
Instance details

Methods

pure :: a -> Last a Source #

(<*>) :: Last (a -> b) -> Last a -> Last b Source #

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source #

(*>) :: Last a -> Last b -> Last b Source #

(<*) :: Last a -> Last b -> Last a Source #

Applicative First Source # 
Instance details

Methods

pure :: a -> First a Source #

(<*>) :: First (a -> b) -> First a -> First b Source #

liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source #

(*>) :: First a -> First b -> First b Source #

(<*) :: First a -> First b -> First a Source #

Applicative STM Source #

Since: 4.8.0.0

Instance details

Methods

pure :: a -> STM a Source #

(<*>) :: STM (a -> b) -> STM a -> STM b Source #

liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c Source #

(*>) :: STM a -> STM b -> STM b Source #

(<*) :: STM a -> STM b -> STM a Source #

Applicative Identity Source #

Since: 4.8.0.0

Instance details

Methods

pure :: a -> Identity a Source #

(<*>) :: Identity (a -> b) -> Identity a -> Identity b Source #

liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c Source #

(*>) :: Identity a -> Identity b -> Identity b Source #

(<*) :: Identity a -> Identity b -> Identity a Source #

Applicative ZipList Source #
f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsN
    = 'ZipList' (zipWithN f xs1 ... xsN)

where zipWithN refers to the zipWith function of the appropriate arity (zipWith, zipWith3, zipWith4, ...). For example:

(\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
    = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
    = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}

Since: 2.1

Instance details

Methods

pure :: a -> ZipList a Source #

(<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b Source #

liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c Source #

(*>) :: ZipList a -> ZipList b -> ZipList b Source #

(<*) :: ZipList a -> ZipList b -> ZipList a Source #

Applicative Option Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Option a Source #

(<*>) :: Option (a -> b) -> Option a -> Option b Source #

liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c Source #

(*>) :: Option a -> Option b -> Option b Source #

(<*) :: Option a -> Option b -> Option a Source #

Applicative Last Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Last a Source #

(<*>) :: Last (a -> b) -> Last a -> Last b Source #

liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c Source #

(*>) :: Last a -> Last b -> Last b Source #

(<*) :: Last a -> Last b -> Last a Source #

Applicative First Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> First a Source #

(<*>) :: First (a -> b) -> First a -> First b Source #

liftA2 :: (a -> b -> c) -> First a -> First b -> First c Source #

(*>) :: First a -> First b -> First b Source #

(<*) :: First a -> First b -> First a Source #

Applicative Max Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Max a Source #

(<*>) :: Max (a -> b) -> Max a -> Max b Source #

liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c Source #

(*>) :: Max a -> Max b -> Max b Source #

(<*) :: Max a -> Max b -> Max a Source #

Applicative Min Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Min a Source #

(<*>) :: Min (a -> b) -> Min a -> Min b Source #

liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c Source #

(*>) :: Min a -> Min b -> Min b Source #

(<*) :: Min a -> Min b -> Min a Source #

Applicative Complex Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Complex a Source #

(<*>) :: Complex (a -> b) -> Complex a -> Complex b Source #

liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c Source #

(*>) :: Complex a -> Complex b -> Complex b Source #

(<*) :: Complex a -> Complex b -> Complex a Source #

Applicative (Either e) Source #

Since: 3.0

Instance details

Methods

pure :: a -> Either e a Source #

(<*>) :: Either e (a -> b) -> Either e a -> Either e b Source #

liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c Source #

(*>) :: Either e a -> Either e b -> Either e b Source #

(<*) :: Either e a -> Either e b -> Either e a Source #

Applicative (U1 :: * -> *) Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> U1 a Source #

(<*>) :: U1 (a -> b) -> U1 a -> U1 b Source #

liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c Source #

(*>) :: U1 a -> U1 b -> U1 b Source #

(<*) :: U1 a -> U1 b -> U1 a Source #

Monoid a => Applicative ((,) a) Source #

For tuples, the Monoid constraint on a determines how the first values merge. For example, Strings concatenate:

("hello ", (+15)) <*> ("world!", 2002)
("hello world!",2017)

Since: 2.1

Instance details

Methods

pure :: a0 -> (a, a0) Source #

(<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) Source #

liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) Source #

(*>) :: (a, a0) -> (a, b) -> (a, b) Source #

(<*) :: (a, a0) -> (a, b) -> (a, a0) Source #

Applicative (ST s) Source #

Since: 4.4.0.0

Instance details

Methods

pure :: a -> ST s a Source #

(<*>) :: ST s (a -> b) -> ST s a -> ST s b Source #

liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c Source #

(*>) :: ST s a -> ST s b -> ST s b Source #

(<*) :: ST s a -> ST s b -> ST s a Source #

Applicative (Proxy :: * -> *) Source #

Since: 4.7.0.0

Instance details

Methods

pure :: a -> Proxy a Source #

(<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b Source #

liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c Source #

(*>) :: Proxy a -> Proxy b -> Proxy b Source #

(<*) :: Proxy a -> Proxy b -> Proxy a Source #

Arrow a => Applicative (ArrowMonad a) Source #

Since: 4.6.0.0

Instance details

Methods

pure :: a0 -> ArrowMonad a a0 Source #

(<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b Source #

liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c Source #

(*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source #

(<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 Source #

Monad m => Applicative (WrappedMonad m) Source #

Since: 2.1

Instance details

Methods

pure :: a -> WrappedMonad m a Source #

(<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b Source #

liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c Source #

(*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b Source #

(<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a Source #

Applicative (ST s) Source #

Since: 2.1

Instance details

Methods

pure :: a -> ST s a Source #

(<*>) :: ST s (a -> b) -> ST s a -> ST s b Source #

liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c Source #

(*>) :: ST s a -> ST s b -> ST s b Source #

(<*) :: ST s a -> ST s b -> ST s a Source #

Applicative f => Applicative (Rec1 f) Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Rec1 f a Source #

(<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b Source #

liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c Source #

(*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b Source #

(<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a Source #

Applicative f => Applicative (Alt f) Source # 
Instance details

Methods

pure :: a -> Alt f a Source #

(<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b Source #

liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c Source #

(*>) :: Alt f a -> Alt f b -> Alt f b Source #

(<*) :: Alt f a -> Alt f b -> Alt f a Source #

Monoid m => Applicative (Const m :: * -> *) Source #

Since: 2.0.1

Instance details

Methods

pure :: a -> Const m a Source #

(<*>) :: Const m (a -> b) -> Const m a -> Const m b Source #

liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c Source #

(*>) :: Const m a -> Const m b -> Const m b Source #

(<*) :: Const m a -> Const m b -> Const m a Source #

Arrow a => Applicative (WrappedArrow a b) Source #

Since: 2.1

Instance details

Methods

pure :: a0 -> WrappedArrow a b a0 Source #

(<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 Source #

liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c Source #

(*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 Source #

(<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 Source #

Applicative ((->) a :: * -> *) Source #

Since: 2.1

Instance details

Methods

pure :: a0 -> a -> a0 Source #

(<*>) :: (a -> a0 -> b) -> (a -> a0) -> a -> b Source #

liftA2 :: (a0 -> b -> c) -> (a -> a0) -> (a -> b) -> a -> c Source #

(*>) :: (a -> a0) -> (a -> b) -> a -> b Source #

(<*) :: (a -> a0) -> (a -> b) -> a -> a0 Source #

(Applicative f, Applicative g) => Applicative (f :*: g) Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> (f :*: g) a Source #

(<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b Source #

liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c Source #

(*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b Source #

(<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a Source #

(Applicative f, Applicative g) => Applicative (Product f g) Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Product f g a Source #

(<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b Source #

liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c Source #

(*>) :: Product f g a -> Product f g b -> Product f g b Source #

(<*) :: Product f g a -> Product f g b -> Product f g a Source #

Applicative f => Applicative (M1 i c f) Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> M1 i c f a Source #

(<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b Source #

liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 Source #

(*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source #

(<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a Source #

(Applicative f, Applicative g) => Applicative (f :.: g) Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> (f :.: g) a Source #

(<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b Source #

liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c Source #

(*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b Source #

(<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a Source #

(Applicative f, Applicative g) => Applicative (Compose f g) Source #

Since: 4.9.0.0

Instance details

Methods

pure :: a -> Compose f g a Source #

(<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b Source #

liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c Source #

(*>) :: Compose f g a -> Compose f g b -> Compose f g b Source #

(<*) :: Compose f g a -> Compose f g b -> Compose f g a Source #

class Applicative m => Monad m where Source #

The Monad class defines the basic operations over a monad, a concept from a branch of mathematics known as category theory. From the perspective of a Haskell programmer, however, it is best to think of a monad as an abstract datatype of actions. Haskell's do expressions provide a convenient syntax for writing monadic expressions.

Instances of Monad should satisfy the following laws:

Furthermore, the Monad and Applicative operations should relate as follows:

The above laws imply:

and that pure and (<*>) satisfy the applicative functor laws.

The instances of Monad for lists, Maybe and IO defined in the Prelude satisfy these laws.

Minimal complete definition

(>>=)

Methods

(>>=) :: forall a b. m a -> (a -> m b) -> m b infixl 1 Source #

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

(>>) :: forall a b. m a -> m b -> m b infixl 1 Source #

Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.

return :: a -> m a Source #

Inject a value into the monadic type.

fail :: String -> m a Source #

Fail with a message. This operation is not part of the mathematical definition of a monad, but is invoked on pattern-match failure in a do expression.

As part of the MonadFail proposal (MFP), this function is moved to its own class MonadFail (see Control.Monad.Fail for more details). The definition here will be removed in a future release.

Instances
Monad [] Source #

Since: 2.1

Instance details

Methods

(>>=) :: [a] -> (a -> [b]) -> [b] Source #

(>>) :: [a] -> [b] -> [b] Source #

return :: a -> [a] Source #

fail :: String -> [a] Source #

Monad Maybe Source #

Since: 2.1

Instance details

Methods

(>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b Source #

(>>) :: Maybe a -> Maybe b -> Maybe b Source #

return :: a -> Maybe a Source #

fail :: String -> Maybe a Source #

Monad IO Source #

Since: 2.1

Instance details

Methods

(>>=) :: IO a -> (a -> IO b) -> IO b Source #

(>>) :: IO a -> IO b -> IO b Source #

return :: a -> IO a Source #

fail :: String -> IO a Source #

Monad Par1 Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b Source #

(>>) :: Par1 a -> Par1 b -> Par1 b Source #

return :: a -> Par1 a Source #

fail :: String -> Par1 a Source #

Monad NonEmpty Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b Source #

(>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b Source #

return :: a -> NonEmpty a Source #

fail :: String -> NonEmpty a Source #

Monad ReadP Source #

Since: 2.1

Instance details

Methods

(>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b Source #

(>>) :: ReadP a -> ReadP b -> ReadP b Source #

return :: a -> ReadP a Source #

fail :: String -> ReadP a Source #

Monad ReadPrec Source #

Since: 2.1

Instance details

Methods

(>>=) :: ReadPrec a -> (a -> ReadPrec b) -> ReadPrec b Source #

(>>) :: ReadPrec a -> ReadPrec b -> ReadPrec b Source #

return :: a -> ReadPrec a Source #

fail :: String -> ReadPrec a Source #

Monad Down Source #

Since: 4.11.0.0

Instance details

Methods

(>>=) :: Down a -> (a -> Down b) -> Down b Source #

(>>) :: Down a -> Down b -> Down b Source #

return :: a -> Down a Source #

fail :: String -> Down a Source #

Monad Product Source #

Since: 4.8.0.0

Instance details

Methods

(>>=) :: Product a -> (a -> Product b) -> Product b Source #

(>>) :: Product a -> Product b -> Product b Source #

return :: a -> Product a Source #

fail :: String -> Product a Source #

Monad Sum Source #

Since: 4.8.0.0

Instance details

Methods

(>>=) :: Sum a -> (a -> Sum b) -> Sum b Source #

(>>) :: Sum a -> Sum b -> Sum b Source #

return :: a -> Sum a Source #

fail :: String -> Sum a Source #

Monad Dual Source #

Since: 4.8.0.0

Instance details

Methods

(>>=) :: Dual a -> (a -> Dual b) -> Dual b Source #

(>>) :: Dual a -> Dual b -> Dual b Source #

return :: a -> Dual a Source #

fail :: String -> Dual a Source #

Monad Last Source # 
Instance details

Methods

(>>=) :: Last a -> (a -> Last b) -> Last b Source #

(>>) :: Last a -> Last b -> Last b Source #

return :: a -> Last a Source #

fail :: String -> Last a Source #

Monad First Source # 
Instance details

Methods

(>>=) :: First a -> (a -> First b) -> First b Source #

(>>) :: First a -> First b -> First b Source #

return :: a -> First a Source #

fail :: String -> First a Source #

Monad STM Source #

Since: 4.3.0.0

Instance details

Methods

(>>=) :: STM a -> (a -> STM b) -> STM b Source #

(>>) :: STM a -> STM b -> STM b Source #

return :: a -> STM a Source #

fail :: String -> STM a Source #

Monad Identity Source #

Since: 4.8.0.0

Instance details

Methods

(>>=) :: Identity a -> (a -> Identity b) -> Identity b Source #

(>>) :: Identity a -> Identity b -> Identity b Source #

return :: a -> Identity a Source #

fail :: String -> Identity a Source #

Monad Option Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: Option a -> (a -> Option b) -> Option b Source #

(>>) :: Option a -> Option b -> Option b Source #

return :: a -> Option a Source #

fail :: String -> Option a Source #

Monad Last Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: Last a -> (a -> Last b) -> Last b Source #

(>>) :: Last a -> Last b -> Last b Source #

return :: a -> Last a Source #

fail :: String -> Last a Source #

Monad First Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: First a -> (a -> First b) -> First b Source #

(>>) :: First a -> First b -> First b Source #

return :: a -> First a Source #

fail :: String -> First a Source #

Monad Max Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: Max a -> (a -> Max b) -> Max b Source #

(>>) :: Max a -> Max b -> Max b Source #

return :: a -> Max a Source #

fail :: String -> Max a Source #

Monad Min Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: Min a -> (a -> Min b) -> Min b Source #

(>>) :: Min a -> Min b -> Min b Source #

return :: a -> Min a Source #

fail :: String -> Min a Source #

Monad Complex Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: Complex a -> (a -> Complex b) -> Complex b Source #

(>>) :: Complex a -> Complex b -> Complex b Source #

return :: a -> Complex a Source #

fail :: String -> Complex a Source #

Monad (Either e) Source #

Since: 4.4.0.0

Instance details

Methods

(>>=) :: Either e a -> (a -> Either e b) -> Either e b Source #

(>>) :: Either e a -> Either e b -> Either e b Source #

return :: a -> Either e a Source #

fail :: String -> Either e a Source #

Monad (U1 :: * -> *) Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: U1 a -> (a -> U1 b) -> U1 b Source #

(>>) :: U1 a -> U1 b -> U1 b Source #

return :: a -> U1 a Source #

fail :: String -> U1 a Source #

Monoid a => Monad ((,) a) Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) Source #

(>>) :: (a, a0) -> (a, b) -> (a, b) Source #

return :: a0 -> (a, a0) Source #

fail :: String -> (a, a0) Source #

Monad (ST s) Source #

Since: 2.1

Instance details

Methods

(>>=) :: ST s a -> (a -> ST s b) -> ST s b Source #

(>>) :: ST s a -> ST s b -> ST s b Source #

return :: a -> ST s a Source #

fail :: String -> ST s a Source #

Monad (Proxy :: * -> *) Source #

Since: 4.7.0.0

Instance details

Methods

(>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b Source #

(>>) :: Proxy a -> Proxy b -> Proxy b Source #

return :: a -> Proxy a Source #

fail :: String -> Proxy a Source #

ArrowApply a => Monad (ArrowMonad a) Source #

Since: 2.1

Instance details

Methods

(>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b Source #

(>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b Source #

return :: a0 -> ArrowMonad a a0 Source #

fail :: String -> ArrowMonad a a0 Source #

Monad m => Monad (WrappedMonad m) Source # 
Instance details
Monad (ST s) Source #

Since: 2.1

Instance details

Methods

(>>=) :: ST s a -> (a -> ST s b) -> ST s b Source #

(>>) :: ST s a -> ST s b -> ST s b Source #

return :: a -> ST s a Source #

fail :: String -> ST s a Source #

Monad f => Monad (Rec1 f) Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: Rec1 f a -> (a -> Rec1 f b) -> Rec1 f b Source #

(>>) :: Rec1 f a -> Rec1 f b -> Rec1 f b Source #

return :: a -> Rec1 f a Source #

fail :: String -> Rec1 f a Source #

Monad f => Monad (Alt f) Source # 
Instance details

Methods

(>>=) :: Alt f a -> (a -> Alt f b) -> Alt f b Source #

(>>) :: Alt f a -> Alt f b -> Alt f b Source #

return :: a -> Alt f a Source #

fail :: String -> Alt f a Source #

Monad ((->) r :: * -> *) Source #

Since: 2.1

Instance details

Methods

(>>=) :: (r -> a) -> (a -> r -> b) -> r -> b Source #

(>>) :: (r -> a) -> (r -> b) -> r -> b Source #

return :: a -> r -> a Source #

fail :: String -> r -> a Source #

(Monad f, Monad g) => Monad (f :*: g) Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b Source #

(>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b Source #

return :: a -> (f :*: g) a Source #

fail :: String -> (f :*: g) a Source #

(Monad f, Monad g) => Monad (Product f g) Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: Product f g a -> (a -> Product f g b) -> Product f g b Source #

(>>) :: Product f g a -> Product f g b -> Product f g b Source #

return :: a -> Product f g a Source #

fail :: String -> Product f g a Source #

Monad f => Monad (M1 i c f) Source #

Since: 4.9.0.0

Instance details

Methods

(>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b Source #

(>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b Source #

return :: a -> M1 i c f a Source #

fail :: String -> M1 i c f a Source #

mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () Source #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see mapM.

As of base 4.8.0.0, mapM_ is just traverse_, specialized to Monad.

sequence_ :: (Foldable t, Monad m) => t (m a) -> m () Source #

Evaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see sequence.

As of base 4.8.0.0, sequence_ is just sequenceA_, specialized to Monad.

(=<<) :: Monad m => (a -> m b) -> m a -> m b infixr 1 Source #

Same as >>=, but with the arguments interchanged.

Folds and traversals

class Foldable t where Source #

Data structures that can be folded.

For example, given a data type

data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

instance Foldable Tree where
   foldMap f Empty = mempty
   foldMap f (Leaf x) = f x
   foldMap f (Node l k r) = foldMap f l `mappend` f k `mappend` foldMap f r

This is suitable even for abstract types, as the monoid is assumed to satisfy the monoid laws. Alternatively, one could define foldr:

instance Foldable Tree where
   foldr f z Empty = z
   foldr f z (Leaf x) = f x z
   foldr f z (Node l k r) = foldr f (f k (foldr f z r)) l

Foldable instances are expected to satisfy the following laws:

foldr f z t = appEndo (foldMap (Endo . f) t ) z
foldl f z t = appEndo (getDual (foldMap (Dual . Endo . flip f) t)) z
fold = foldMap id
length = getSum . foldMap (Sum . const  1)

sum, product, maximum, and minimum should all be essentially equivalent to foldMap forms, such as

sum = getSum . foldMap Sum

but may be less defined.

If the type is also a Functor instance, it should satisfy

foldMap f = fold . fmap f

which implies that

foldMap f . fmap g = foldMap (f . g)

Minimal complete definition

foldMap | foldr

Methods

foldMap :: Monoid m => (a -> m) -> t a -> m Source #

Map each element of the structure to a monoid, and combine the results.

foldr :: (a -> b -> b) -> b -> t a -> b Source #

Right-associative fold of a structure.

In the case of lists, foldr, when applied to a binary operator, a starting value (typically the right-identity of the operator), and a list, reduces the list using the binary operator, from right to left:

foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)

Note that, since the head of the resulting expression is produced by an application of the operator to the first element of the list, foldr can produce a terminating expression from an infinite list.

For a general Foldable structure this should be semantically identical to,

foldr f z = foldr f z . toList

foldl :: (b -> a -> b) -> b -> t a -> b Source #

Left-associative fold of a structure.

In the case of lists, foldl, when applied to a binary operator, a starting value (typically the left-identity of the operator), and a list, reduces the list using the binary operator, from left to right:

foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn

Note that to produce the outermost application of the operator the entire input list must be traversed. This means that foldl' will diverge if given an infinite list.

Also note that if you want an efficient left-fold, you probably want to use foldl' instead of foldl. The reason for this is that latter does not force the "inner" results (e.g. z f x1 in the above example) before applying them to the operator (e.g. to (f x2)). This results in a thunk chain O(n) elements long, which then must be evaluated from the outside-in.

For a general Foldable structure this should be semantically identical to,

foldl f z = foldl f z . toList

foldr1 :: (a -> a -> a) -> t a -> a Source #

A variant of foldr that has no base case, and thus may only be applied to non-empty structures.

foldr1 f = foldr1 f . toList

foldl1 :: (a -> a -> a) -> t a -> a Source #

A variant of foldl that has no base case, and thus may only be applied to non-empty structures.

foldl1 f = foldl1 f . toList

elem :: Eq a => a -> t a -> Bool infix 4 Source #

Does the element occur in the structure?

maximum :: forall a. Ord a => t a -> a Source #

The largest element of a non-empty structure.

minimum :: forall a. Ord a => t a -> a Source #

The least element of a non-empty structure.

sum :: Num a => t a -> a Source #

The sum function computes the sum of the numbers of a structure.

product :: Num a => t a -> a Source #

The product function computes the product of the numbers of a structure.

Instances
Foldable [] Source #

Since: 2.1

Instance details

Methods

fold :: Monoid m => [m] -> m Source #

foldMap :: Monoid m => (a -> m) -> [a] -> m Source #

foldr :: (a -> b -> b) -> b -> [a] -> b Source #

foldr' :: (a -> b -> b) -> b -> [a] -> b Source #

foldl :: (b -> a -> b) -> b -> [a] -> b Source #

foldl' :: (b -> a -> b) -> b -> [a] -> b Source #

foldr1 :: (a -> a -> a) -> [a] -> a Source #

foldl1 :: (a -> a -> a) -> [a] -> a Source #

toList :: [a] -> [a] Source #

null :: [a] -> Bool Source #

length :: [a] -> Int Source #

elem :: Eq a => a -> [a] -> Bool Source #

maximum :: Ord a => [a] -> a Source #

minimum :: Ord a => [a] -> a Source #

sum :: Num a => [a] -> a Source #

product :: Num a => [a] -> a Source #

Foldable Maybe Source #

Since: 2.1

Instance details

Methods

fold :: Monoid m => Maybe m -> m Source #

foldMap :: Monoid m => (a -> m) -> Maybe a -> m Source #

foldr :: (a -> b -> b) -> b -> Maybe a -> b Source #

foldr' :: (a -> b -> b) -> b -> Maybe a -> b Source #

foldl :: (b -> a -> b) -> b -> Maybe a -> b Source #

foldl' :: (b -> a -> b) -> b -> Maybe a -> b Source #

foldr1 :: (a -> a -> a) -> Maybe a -> a Source #

foldl1 :: (a -> a -> a) -> Maybe a -> a Source #

toList :: Maybe a -> [a] Source #

null :: Maybe a -> Bool Source #

length :: Maybe a -> Int Source #

elem :: Eq a => a -> Maybe a -> Bool Source #

maximum :: Ord a => Maybe a -> a Source #

minimum :: Ord a => Maybe a -> a Source #

sum :: Num a => Maybe a -> a Source #

product :: Num a => Maybe a -> a Source #

Foldable Par1 Source # 
Instance details

Methods

fold :: Monoid m => Par1 m -> m Source #

foldMap :: Monoid m => (a -> m) -> Par1 a -> m Source #

foldr :: (a -> b -> b) -> b -> Par1 a -> b Source #

foldr' :: (a -> b -> b) -> b -> Par1 a -> b Source #

foldl :: (b -> a -> b) -> b -> Par1 a -> b Source #

foldl' :: (b -> a -> b) -> b -> Par1 a -> b Source #

foldr1 :: (a -> a -> a) -> Par1 a -> a Source #

foldl1 :: (a -> a -> a) -> Par1 a -> a Source #

toList :: Par1 a -> [a] Source #

null :: Par1 a -> Bool Source #

length :: Par1 a -> Int Source #

elem :: Eq a => a -> Par1 a -> Bool Source #

maximum :: Ord a => Par1 a -> a Source #

minimum :: Ord a => Par1 a -> a Source #

sum :: Num a => Par1 a -> a Source #

product :: Num a => Par1 a -> a Source #

Foldable NonEmpty Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => NonEmpty m -> m Source #

foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m Source #

foldr :: (a -> b -> b) -> b -> NonEmpty a -> b Source #

foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b Source #

foldl :: (b -> a -> b) -> b -> NonEmpty a -> b Source #

foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b Source #

foldr1 :: (a -> a -> a) -> NonEmpty a -> a Source #

foldl1 :: (a -> a -> a) -> NonEmpty a -> a Source #

toList :: NonEmpty a -> [a] Source #

null :: NonEmpty a -> Bool Source #

length :: NonEmpty a -> Int Source #

elem :: Eq a => a -> NonEmpty a -> Bool Source #

maximum :: Ord a => NonEmpty a -> a Source #

minimum :: Ord a => NonEmpty a -> a Source #

sum :: Num a => NonEmpty a -> a Source #

product :: Num a => NonEmpty a -> a Source #

Foldable Product Source #

Since: 4.8.0.0

Instance details

Methods

fold :: Monoid m => Product m -> m Source #

foldMap :: Monoid m => (a -> m) -> Product a -> m Source #

foldr :: (a -> b -> b) -> b -> Product a -> b Source #

foldr' :: (a -> b -> b) -> b -> Product a -> b Source #

foldl :: (b -> a -> b) -> b -> Product a -> b Source #

foldl' :: (b -> a -> b) -> b -> Product a -> b Source #

foldr1 :: (a -> a -> a) -> Product a -> a Source #

foldl1 :: (a -> a -> a) -> Product a -> a Source #

toList :: Product a -> [a] Source #

null :: Product a -> Bool Source #

length :: Product a -> Int Source #

elem :: Eq a => a -> Product a -> Bool Source #

maximum :: Ord a => Product a -> a Source #

minimum :: Ord a => Product a -> a Source #

sum :: Num a => Product a -> a Source #

product :: Num a => Product a -> a Source #

Foldable Sum Source #

Since: 4.8.0.0

Instance details

Methods

fold :: Monoid m => Sum m -> m Source #

foldMap :: Monoid m => (a -> m) -> Sum a -> m Source #

foldr :: (a -> b -> b) -> b -> Sum a -> b Source #

foldr' :: (a -> b -> b) -> b -> Sum a -> b Source #

foldl :: (b -> a -> b) -> b -> Sum a -> b Source #

foldl' :: (b -> a -> b) -> b -> Sum a -> b Source #

foldr1 :: (a -> a -> a) -> Sum a -> a Source #

foldl1 :: (a -> a -> a) -> Sum a -> a Source #

toList :: Sum a -> [a] Source #

null :: Sum a -> Bool Source #

length :: Sum a -> Int Source #

elem :: Eq a => a -> Sum a -> Bool Source #

maximum :: Ord a => Sum a -> a Source #

minimum :: Ord a => Sum a -> a Source #

sum :: Num a => Sum a -> a Source #

product :: Num a => Sum a -> a Source #

Foldable Dual Source #

Since: 4.8.0.0

Instance details

Methods

fold :: Monoid m => Dual m -> m Source #

foldMap :: Monoid m => (a -> m) -> Dual a -> m Source #

foldr :: (a -> b -> b) -> b -> Dual a -> b Source #

foldr' :: (a -> b -> b) -> b -> Dual a -> b Source #

foldl :: (b -> a -> b) -> b -> Dual a -> b Source #

foldl' :: (b -> a -> b) -> b -> Dual a -> b Source #

foldr1 :: (a -> a -> a) -> Dual a -> a Source #

foldl1 :: (a -> a -> a) -> Dual a -> a Source #

toList :: Dual a -> [a] Source #

null :: Dual a -> Bool Source #

length :: Dual a -> Int Source #

elem :: Eq a => a -> Dual a -> Bool Source #

maximum :: Ord a => Dual a -> a Source #

minimum :: Ord a => Dual a -> a Source #

sum :: Num a => Dual a -> a Source #

product :: Num a => Dual a -> a Source #

Foldable Last Source #

Since: 4.8.0.0

Instance details

Methods

fold :: Monoid m => Last m -> m Source #

foldMap :: Monoid m => (a -> m) -> Last a -> m Source #

foldr :: (a -> b -> b) -> b -> Last a -> b Source #

foldr' :: (a -> b -> b) -> b -> Last a -> b Source #

foldl :: (b -> a -> b) -> b -> Last a -> b Source #

foldl' :: (b -> a -> b) -> b -> Last a -> b Source #

foldr1 :: (a -> a -> a) -> Last a -> a Source #

foldl1 :: (a -> a -> a) -> Last a -> a Source #

toList :: Last a -> [a] Source #

null :: Last a -> Bool Source #

length :: Last a -> Int Source #

elem :: Eq a => a -> Last a -> Bool Source #

maximum :: Ord a => Last a -> a Source #

minimum :: Ord a => Last a -> a Source #

sum :: Num a => Last a -> a Source #

product :: Num a => Last a -> a Source #

Foldable First Source #

Since: 4.8.0.0

Instance details

Methods

fold :: Monoid m => First m -> m Source #

foldMap :: Monoid m => (a -> m) -> First a -> m Source #

foldr :: (a -> b -> b) -> b -> First a -> b Source #

foldr' :: (a -> b -> b) -> b -> First a -> b Source #

foldl :: (b -> a -> b) -> b -> First a -> b Source #

foldl' :: (b -> a -> b) -> b -> First a -> b Source #

foldr1 :: (a -> a -> a) -> First a -> a Source #

foldl1 :: (a -> a -> a) -> First a -> a Source #

toList :: First a -> [a] Source #

null :: First a -> Bool Source #

length :: First a -> Int Source #

elem :: Eq a => a -> First a -> Bool Source #

maximum :: Ord a => First a -> a Source #

minimum :: Ord a => First a -> a Source #

sum :: Num a => First a -> a Source #

product :: Num a => First a -> a Source #

Foldable Identity Source #

Since: 4.8.0.0

Instance details

Methods

fold :: Monoid m => Identity m -> m Source #

foldMap :: Monoid m => (a -> m) -> Identity a -> m Source #

foldr :: (a -> b -> b) -> b -> Identity a -> b Source #

foldr' :: (a -> b -> b) -> b -> Identity a -> b Source #

foldl :: (b -> a -> b) -> b -> Identity a -> b Source #

foldl' :: (b -> a -> b) -> b -> Identity a -> b Source #

foldr1 :: (a -> a -> a) -> Identity a -> a Source #

foldl1 :: (a -> a -> a) -> Identity a -> a Source #

toList :: Identity a -> [a] Source #

null :: Identity a -> Bool Source #

length :: Identity a -> Int Source #

elem :: Eq a => a -> Identity a -> Bool Source #

maximum :: Ord a => Identity a -> a Source #

minimum :: Ord a => Identity a -> a Source #

sum :: Num a => Identity a -> a Source #

product :: Num a => Identity a -> a Source #

Foldable ZipList Source # 
Instance details

Methods

fold :: Monoid m => ZipList m -> m Source #

foldMap :: Monoid m => (a -> m) -> ZipList a -> m Source #

foldr :: (a -> b -> b) -> b -> ZipList a -> b Source #

foldr' :: (a -> b -> b) -> b -> ZipList a -> b Source #

foldl :: (b -> a -> b) -> b -> ZipList a -> b Source #

foldl' :: (b -> a -> b) -> b -> ZipList a -> b Source #

foldr1 :: (a -> a -> a) -> ZipList a -> a Source #

foldl1 :: (a -> a -> a) -> ZipList a -> a Source #

toList :: ZipList a -> [a] Source #

null :: ZipList a -> Bool Source #

length :: ZipList a -> Int Source #

elem :: Eq a => a -> ZipList a -> Bool Source #

maximum :: Ord a => ZipList a -> a Source #

minimum :: Ord a => ZipList a -> a Source #

sum :: Num a => ZipList a -> a Source #

product :: Num a => ZipList a -> a Source #

Foldable Option Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => Option m -> m Source #

foldMap :: Monoid m => (a -> m) -> Option a -> m Source #

foldr :: (a -> b -> b) -> b -> Option a -> b Source #

foldr' :: (a -> b -> b) -> b -> Option a -> b Source #

foldl :: (b -> a -> b) -> b -> Option a -> b Source #

foldl' :: (b -> a -> b) -> b -> Option a -> b Source #

foldr1 :: (a -> a -> a) -> Option a -> a Source #

foldl1 :: (a -> a -> a) -> Option a -> a Source #

toList :: Option a -> [a] Source #

null :: Option a -> Bool Source #

length :: Option a -> Int Source #

elem :: Eq a => a -> Option a -> Bool Source #

maximum :: Ord a => Option a -> a Source #

minimum :: Ord a => Option a -> a Source #

sum :: Num a => Option a -> a Source #

product :: Num a => Option a -> a Source #

Foldable Last Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => Last m -> m Source #

foldMap :: Monoid m => (a -> m) -> Last a -> m Source #

foldr :: (a -> b -> b) -> b -> Last a -> b Source #

foldr' :: (a -> b -> b) -> b -> Last a -> b Source #

foldl :: (b -> a -> b) -> b -> Last a -> b Source #

foldl' :: (b -> a -> b) -> b -> Last a -> b Source #

foldr1 :: (a -> a -> a) -> Last a -> a Source #

foldl1 :: (a -> a -> a) -> Last a -> a Source #

toList :: Last a -> [a] Source #

null :: Last a -> Bool Source #

length :: Last a -> Int Source #

elem :: Eq a => a -> Last a -> Bool Source #

maximum :: Ord a => Last a -> a Source #

minimum :: Ord a => Last a -> a Source #

sum :: Num a => Last a -> a Source #

product :: Num a => Last a -> a Source #

Foldable First Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => First m -> m Source #

foldMap :: Monoid m => (a -> m) -> First a -> m Source #

foldr :: (a -> b -> b) -> b -> First a -> b Source #

foldr' :: (a -> b -> b) -> b -> First a -> b Source #

foldl :: (b -> a -> b) -> b -> First a -> b Source #

foldl' :: (b -> a -> b) -> b -> First a -> b Source #

foldr1 :: (a -> a -> a) -> First a -> a Source #

foldl1 :: (a -> a -> a) -> First a -> a Source #

toList :: First a -> [a] Source #

null :: First a -> Bool Source #

length :: First a -> Int Source #

elem :: Eq a => a -> First a -> Bool Source #

maximum :: Ord a => First a -> a Source #

minimum :: Ord a => First a -> a Source #

sum :: Num a => First a -> a Source #

product :: Num a => First a -> a Source #

Foldable Max Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => Max m -> m Source #

foldMap :: Monoid m => (a -> m) -> Max a -> m Source #

foldr :: (a -> b -> b) -> b -> Max a -> b Source #

foldr' :: (a -> b -> b) -> b -> Max a -> b Source #

foldl :: (b -> a -> b) -> b -> Max a -> b Source #

foldl' :: (b -> a -> b) -> b -> Max a -> b Source #

foldr1 :: (a -> a -> a) -> Max a -> a Source #

foldl1 :: (a -> a -> a) -> Max a -> a Source #

toList :: Max a -> [a] Source #

null :: Max a -> Bool Source #

length :: Max a -> Int Source #

elem :: Eq a => a -> Max a -> Bool Source #

maximum :: Ord a => Max a -> a Source #

minimum :: Ord a => Max a -> a Source #

sum :: Num a => Max a -> a Source #

product :: Num a => Max a -> a Source #

Foldable Min Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => Min m -> m Source #

foldMap :: Monoid m => (a -> m) -> Min a -> m Source #

foldr :: (a -> b -> b) -> b -> Min a -> b Source #

foldr' :: (a -> b -> b) -> b -> Min a -> b Source #

foldl :: (b -> a -> b) -> b -> Min a -> b Source #

foldl' :: (b -> a -> b) -> b -> Min a -> b Source #

foldr1 :: (a -> a -> a) -> Min a -> a Source #

foldl1 :: (a -> a -> a) -> Min a -> a Source #

toList :: Min a -> [a] Source #

null :: Min a -> Bool Source #

length :: Min a -> Int Source #

elem :: Eq a => a -> Min a -> Bool Source #

maximum :: Ord a => Min a -> a Source #

minimum :: Ord a => Min a -> a Source #

sum :: Num a => Min a -> a Source #

product :: Num a => Min a -> a Source #

Foldable Complex Source # 
Instance details

Methods

fold :: Monoid m => Complex m -> m Source #

foldMap :: Monoid m => (a -> m) -> Complex a -> m Source #

foldr :: (a -> b -> b) -> b -> Complex a -> b Source #

foldr' :: (a -> b -> b) -> b -> Complex a -> b Source #

foldl :: (b -> a -> b) -> b -> Complex a -> b Source #

foldl' :: (b -> a -> b) -> b -> Complex a -> b Source #

foldr1 :: (a -> a -> a) -> Complex a -> a Source #

foldl1 :: (a -> a -> a) -> Complex a -> a Source #

toList :: Complex a -> [a] Source #

null :: Complex a -> Bool Source #

length :: Complex a -> Int Source #

elem :: Eq a => a -> Complex a -> Bool Source #

maximum :: Ord a => Complex a -> a Source #

minimum :: Ord a => Complex a -> a Source #

sum :: Num a => Complex a -> a Source #

product :: Num a => Complex a -> a Source #

Foldable (Either a) Source #

Since: 4.7.0.0

Instance details

Methods

fold :: Monoid m => Either a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 Source #

toList :: Either a a0 -> [a0] Source #

null :: Either a a0 -> Bool Source #

length :: Either a a0 -> Int Source #

elem :: Eq a0 => a0 -> Either a a0 -> Bool Source #

maximum :: Ord a0 => Either a a0 -> a0 Source #

minimum :: Ord a0 => Either a a0 -> a0 Source #

sum :: Num a0 => Either a a0 -> a0 Source #

product :: Num a0 => Either a a0 -> a0 Source #

Foldable (V1 :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => V1 m -> m Source #

foldMap :: Monoid m => (a -> m) -> V1 a -> m Source #

foldr :: (a -> b -> b) -> b -> V1 a -> b Source #

foldr' :: (a -> b -> b) -> b -> V1 a -> b Source #

foldl :: (b -> a -> b) -> b -> V1 a -> b Source #

foldl' :: (b -> a -> b) -> b -> V1 a -> b Source #

foldr1 :: (a -> a -> a) -> V1 a -> a Source #

foldl1 :: (a -> a -> a) -> V1 a -> a Source #

toList :: V1 a -> [a] Source #

null :: V1 a -> Bool Source #

length :: V1 a -> Int Source #

elem :: Eq a => a -> V1 a -> Bool Source #

maximum :: Ord a => V1 a -> a Source #

minimum :: Ord a => V1 a -> a Source #

sum :: Num a => V1 a -> a Source #

product :: Num a => V1 a -> a Source #

Foldable (U1 :: * -> *) Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => U1 m -> m Source #

foldMap :: Monoid m => (a -> m) -> U1 a -> m Source #

foldr :: (a -> b -> b) -> b -> U1 a -> b Source #

foldr' :: (a -> b -> b) -> b -> U1 a -> b Source #

foldl :: (b -> a -> b) -> b -> U1 a -> b Source #

foldl' :: (b -> a -> b) -> b -> U1 a -> b Source #

foldr1 :: (a -> a -> a) -> U1 a -> a Source #

foldl1 :: (a -> a -> a) -> U1 a -> a Source #

toList :: U1 a -> [a] Source #

null :: U1 a -> Bool Source #

length :: U1 a -> Int Source #

elem :: Eq a => a -> U1 a -> Bool Source #

maximum :: Ord a => U1 a -> a Source #

minimum :: Ord a => U1 a -> a Source #

sum :: Num a => U1 a -> a Source #

product :: Num a => U1 a -> a Source #

Foldable ((,) a) Source #

Since: 4.7.0.0

Instance details

Methods

fold :: Monoid m => (a, m) -> m Source #

foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m Source #

foldr :: (a0 -> b -> b) -> b -> (a, a0) -> b Source #

foldr' :: (a0 -> b -> b) -> b -> (a, a0) -> b Source #

foldl :: (b -> a0 -> b) -> b -> (a, a0) -> b Source #

foldl' :: (b -> a0 -> b) -> b -> (a, a0) -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 Source #

toList :: (a, a0) -> [a0] Source #

null :: (a, a0) -> Bool Source #

length :: (a, a0) -> Int Source #

elem :: Eq a0 => a0 -> (a, a0) -> Bool Source #

maximum :: Ord a0 => (a, a0) -> a0 Source #

minimum :: Ord a0 => (a, a0) -> a0 Source #

sum :: Num a0 => (a, a0) -> a0 Source #

product :: Num a0 => (a, a0) -> a0 Source #

Foldable (Proxy :: * -> *) Source #

Since: 4.7.0.0

Instance details

Methods

fold :: Monoid m => Proxy m -> m Source #

foldMap :: Monoid m => (a -> m) -> Proxy a -> m Source #

foldr :: (a -> b -> b) -> b -> Proxy a -> b Source #

foldr' :: (a -> b -> b) -> b -> Proxy a -> b Source #

foldl :: (b -> a -> b) -> b -> Proxy a -> b Source #

foldl' :: (b -> a -> b) -> b -> Proxy a -> b Source #

foldr1 :: (a -> a -> a) -> Proxy a -> a Source #

foldl1 :: (a -> a -> a) -> Proxy a -> a Source #

toList :: Proxy a -> [a] Source #

null :: Proxy a -> Bool Source #

length :: Proxy a -> Int Source #

elem :: Eq a => a -> Proxy a -> Bool Source #

maximum :: Ord a => Proxy a -> a Source #

minimum :: Ord a => Proxy a -> a Source #

sum :: Num a => Proxy a -> a Source #

product :: Num a => Proxy a -> a Source #

Foldable (Arg a) Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => Arg a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Arg a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Arg a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Arg a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Arg a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Arg a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 Source #

toList :: Arg a a0 -> [a0] Source #

null :: Arg a a0 -> Bool Source #

length :: Arg a a0 -> Int Source #

elem :: Eq a0 => a0 -> Arg a a0 -> Bool Source #

maximum :: Ord a0 => Arg a a0 -> a0 Source #

minimum :: Ord a0 => Arg a a0 -> a0 Source #

sum :: Num a0 => Arg a a0 -> a0 Source #

product :: Num a0 => Arg a a0 -> a0 Source #

Foldable f => Foldable (Rec1 f) Source # 
Instance details

Methods

fold :: Monoid m => Rec1 f m -> m Source #

foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m Source #

foldr :: (a -> b -> b) -> b -> Rec1 f a -> b Source #

foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b Source #

foldl :: (b -> a -> b) -> b -> Rec1 f a -> b Source #

foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b Source #

foldr1 :: (a -> a -> a) -> Rec1 f a -> a Source #

foldl1 :: (a -> a -> a) -> Rec1 f a -> a Source #

toList :: Rec1 f a -> [a] Source #

null :: Rec1 f a -> Bool Source #

length :: Rec1 f a -> Int Source #

elem :: Eq a => a -> Rec1 f a -> Bool Source #

maximum :: Ord a => Rec1 f a -> a Source #

minimum :: Ord a => Rec1 f a -> a Source #

sum :: Num a => Rec1 f a -> a Source #

product :: Num a => Rec1 f a -> a Source #

Foldable (URec Char :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Char m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Char a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Char a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Char a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Char a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Char a -> b Source #

foldr1 :: (a -> a -> a) -> URec Char a -> a Source #

foldl1 :: (a -> a -> a) -> URec Char a -> a Source #

toList :: URec Char a -> [a] Source #

null :: URec Char a -> Bool Source #

length :: URec Char a -> Int Source #

elem :: Eq a => a -> URec Char a -> Bool Source #

maximum :: Ord a => URec Char a -> a Source #

minimum :: Ord a => URec Char a -> a Source #

sum :: Num a => URec Char a -> a Source #

product :: Num a => URec Char a -> a Source #

Foldable (URec Double :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Double m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Double a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Double a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Double a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Double a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Double a -> b Source #

foldr1 :: (a -> a -> a) -> URec Double a -> a Source #

foldl1 :: (a -> a -> a) -> URec Double a -> a Source #

toList :: URec Double a -> [a] Source #

null :: URec Double a -> Bool Source #

length :: URec Double a -> Int Source #

elem :: Eq a => a -> URec Double a -> Bool Source #

maximum :: Ord a => URec Double a -> a Source #

minimum :: Ord a => URec Double a -> a Source #

sum :: Num a => URec Double a -> a Source #

product :: Num a => URec Double a -> a Source #

Foldable (URec Float :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Float m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Float a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Float a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Float a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Float a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Float a -> b Source #

foldr1 :: (a -> a -> a) -> URec Float a -> a Source #

foldl1 :: (a -> a -> a) -> URec Float a -> a Source #

toList :: URec Float a -> [a] Source #

null :: URec Float a -> Bool Source #

length :: URec Float a -> Int Source #

elem :: Eq a => a -> URec Float a -> Bool Source #

maximum :: Ord a => URec Float a -> a Source #

minimum :: Ord a => URec Float a -> a Source #

sum :: Num a => URec Float a -> a Source #

product :: Num a => URec Float a -> a Source #

Foldable (URec Int :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Int m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Int a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Int a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Int a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Int a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Int a -> b Source #

foldr1 :: (a -> a -> a) -> URec Int a -> a Source #

foldl1 :: (a -> a -> a) -> URec Int a -> a Source #

toList :: URec Int a -> [a] Source #

null :: URec Int a -> Bool Source #

length :: URec Int a -> Int Source #

elem :: Eq a => a -> URec Int a -> Bool Source #

maximum :: Ord a => URec Int a -> a Source #

minimum :: Ord a => URec Int a -> a Source #

sum :: Num a => URec Int a -> a Source #

product :: Num a => URec Int a -> a Source #

Foldable (URec Word :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec Word m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec Word a -> m Source #

foldr :: (a -> b -> b) -> b -> URec Word a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec Word a -> b Source #

foldl :: (b -> a -> b) -> b -> URec Word a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec Word a -> b Source #

foldr1 :: (a -> a -> a) -> URec Word a -> a Source #

foldl1 :: (a -> a -> a) -> URec Word a -> a Source #

toList :: URec Word a -> [a] Source #

null :: URec Word a -> Bool Source #

length :: URec Word a -> Int Source #

elem :: Eq a => a -> URec Word a -> Bool Source #

maximum :: Ord a => URec Word a -> a Source #

minimum :: Ord a => URec Word a -> a Source #

sum :: Num a => URec Word a -> a Source #

product :: Num a => URec Word a -> a Source #

Foldable (URec (Ptr ()) :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => URec (Ptr ()) m -> m Source #

foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m Source #

foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b Source #

foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b Source #

foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b Source #

foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b Source #

foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a Source #

foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a Source #

toList :: URec (Ptr ()) a -> [a] Source #

null :: URec (Ptr ()) a -> Bool Source #

length :: URec (Ptr ()) a -> Int Source #

elem :: Eq a => a -> URec (Ptr ()) a -> Bool Source #

maximum :: Ord a => URec (Ptr ()) a -> a Source #

minimum :: Ord a => URec (Ptr ()) a -> a Source #

sum :: Num a => URec (Ptr ()) a -> a Source #

product :: Num a => URec (Ptr ()) a -> a Source #

Foldable (Const m :: * -> *) Source #

Since: 4.7.0.0

Instance details

Methods

fold :: Monoid m0 => Const m m0 -> m0 Source #

foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 Source #

foldr :: (a -> b -> b) -> b -> Const m a -> b Source #

foldr' :: (a -> b -> b) -> b -> Const m a -> b Source #

foldl :: (b -> a -> b) -> b -> Const m a -> b Source #

foldl' :: (b -> a -> b) -> b -> Const m a -> b Source #

foldr1 :: (a -> a -> a) -> Const m a -> a Source #

foldl1 :: (a -> a -> a) -> Const m a -> a Source #

toList :: Const m a -> [a] Source #

null :: Const m a -> Bool Source #

length :: Const m a -> Int Source #

elem :: Eq a => a -> Const m a -> Bool Source #

maximum :: Ord a => Const m a -> a Source #

minimum :: Ord a => Const m a -> a Source #

sum :: Num a => Const m a -> a Source #

product :: Num a => Const m a -> a Source #

Foldable (K1 i c :: * -> *) Source # 
Instance details

Methods

fold :: Monoid m => K1 i c m -> m Source #

foldMap :: Monoid m => (a -> m) -> K1 i c a -> m Source #

foldr :: (a -> b -> b) -> b -> K1 i c a -> b Source #

foldr' :: (a -> b -> b) -> b -> K1 i c a -> b Source #

foldl :: (b -> a -> b) -> b -> K1 i c a -> b Source #

foldl' :: (b -> a -> b) -> b -> K1 i c a -> b Source #

foldr1 :: (a -> a -> a) -> K1 i c a -> a Source #

foldl1 :: (a -> a -> a) -> K1 i c a -> a Source #

toList :: K1 i c a -> [a] Source #

null :: K1 i c a -> Bool Source #

length :: K1 i c a -> Int Source #

elem :: Eq a => a -> K1 i c a -> Bool Source #

maximum :: Ord a => K1 i c a -> a Source #

minimum :: Ord a => K1 i c a -> a Source #

sum :: Num a => K1 i c a -> a Source #

product :: Num a => K1 i c a -> a Source #

(Foldable f, Foldable g) => Foldable (f :+: g) Source # 
Instance details

Methods

fold :: Monoid m => (f :+: g) m -> m Source #

foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m Source #

foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b Source #

foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b Source #

foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b Source #

foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b Source #

foldr1 :: (a -> a -> a) -> (f :+: g) a -> a Source #

foldl1 :: (a -> a -> a) -> (f :+: g) a -> a Source #

toList :: (f :+: g) a -> [a] Source #

null :: (f :+: g) a -> Bool Source #

length :: (f :+: g) a -> Int Source #

elem :: Eq a => a -> (f :+: g) a -> Bool Source #

maximum :: Ord a => (f :+: g) a -> a Source #

minimum :: Ord a => (f :+: g) a -> a Source #

sum :: Num a => (f :+: g) a -> a Source #

product :: Num a => (f :+: g) a -> a Source #

(Foldable f, Foldable g) => Foldable (f :*: g) Source # 
Instance details

Methods

fold :: Monoid m => (f :*: g) m -> m Source #

foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m Source #

foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b Source #

foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b Source #

foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b Source #

foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b Source #

foldr1 :: (a -> a -> a) -> (f :*: g) a -> a Source #

foldl1 :: (a -> a -> a) -> (f :*: g) a -> a Source #

toList :: (f :*: g) a -> [a] Source #

null :: (f :*: g) a -> Bool Source #

length :: (f :*: g) a -> Int Source #

elem :: Eq a => a -> (f :*: g) a -> Bool Source #

maximum :: Ord a => (f :*: g) a -> a Source #

minimum :: Ord a => (f :*: g) a -> a Source #

sum :: Num a => (f :*: g) a -> a Source #

product :: Num a => (f :*: g) a -> a Source #

(Foldable f, Foldable g) => Foldable (Sum f g) Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => Sum f g m -> m Source #

foldMap :: Monoid m => (a -> m) -> Sum f g a -> m Source #

foldr :: (a -> b -> b) -> b -> Sum f g a -> b Source #

foldr' :: (a -> b -> b) -> b -> Sum f g a -> b Source #

foldl :: (b -> a -> b) -> b -> Sum f g a -> b Source #

foldl' :: (b -> a -> b) -> b -> Sum f g a -> b Source #

foldr1 :: (a -> a -> a) -> Sum f g a -> a Source #

foldl1 :: (a -> a -> a) -> Sum f g a -> a Source #

toList :: Sum f g a -> [a] Source #

null :: Sum f g a -> Bool Source #

length :: Sum f g a -> Int Source #

elem :: Eq a => a -> Sum f g a -> Bool Source #

maximum :: Ord a => Sum f g a -> a Source #

minimum :: Ord a => Sum f g a -> a Source #

sum :: Num a => Sum f g a -> a Source #

product :: Num a => Sum f g a -> a Source #

(Foldable f, Foldable g) => Foldable (Product f g) Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => Product f g m -> m Source #

foldMap :: Monoid m => (a -> m) -> Product f g a -> m Source #

foldr :: (a -> b -> b) -> b -> Product f g a -> b Source #

foldr' :: (a -> b -> b) -> b -> Product f g a -> b Source #

foldl :: (b -> a -> b) -> b -> Product f g a -> b Source #

foldl' :: (b -> a -> b) -> b -> Product f g a -> b Source #

foldr1 :: (a -> a -> a) -> Product f g a -> a Source #

foldl1 :: (a -> a -> a) -> Product f g a -> a Source #

toList :: Product f g a -> [a] Source #

null :: Product f g a -> Bool Source #

length :: Product f g a -> Int Source #

elem :: Eq a => a -> Product f g a -> Bool Source #

maximum :: Ord a => Product f g a -> a Source #

minimum :: Ord a => Product f g a -> a Source #

sum :: Num a => Product f g a -> a Source #

product :: Num a => Product f g a -> a Source #

Foldable f => Foldable (M1 i c f) Source # 
Instance details

Methods

fold :: Monoid m => M1 i c f m -> m Source #

foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m Source #

foldr :: (a -> b -> b) -> b -> M1 i c f a -> b Source #

foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b Source #

foldl :: (b -> a -> b) -> b -> M1 i c f a -> b Source #

foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b Source #

foldr1 :: (a -> a -> a) -> M1 i c f a -> a Source #

foldl1 :: (a -> a -> a) -> M1 i c f a -> a Source #

toList :: M1 i c f a -> [a] Source #

null :: M1 i c f a -> Bool Source #

length :: M1 i c f a -> Int Source #

elem :: Eq a => a -> M1 i c f a -> Bool Source #

maximum :: Ord a => M1 i c f a -> a Source #

minimum :: Ord a => M1 i c f a -> a Source #

sum :: Num a => M1 i c f a -> a Source #

product :: Num a => M1 i c f a -> a Source #

(Foldable f, Foldable g) => Foldable (f :.: g) Source # 
Instance details

Methods

fold :: Monoid m => (f :.: g) m -> m Source #

foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m Source #

foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b Source #

foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b Source #

foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b Source #

foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b Source #

foldr1 :: (a -> a -> a) -> (f :.: g) a -> a Source #

foldl1 :: (a -> a -> a) -> (f :.: g) a -> a Source #

toList :: (f :.: g) a -> [a] Source #

null :: (f :.: g) a -> Bool Source #

length :: (f :.: g) a -> Int Source #

elem :: Eq a => a -> (f :.: g) a -> Bool Source #

maximum :: Ord a => (f :.: g) a -> a Source #

minimum :: Ord a => (f :.: g) a -> a Source #

sum :: Num a => (f :.: g) a -> a Source #

product :: Num a => (f :.: g) a -> a Source #

(Foldable f, Foldable g) => Foldable (Compose f g) Source #

Since: 4.9.0.0

Instance details

Methods

fold :: Monoid m => Compose f g m -> m Source #

foldMap :: Monoid m => (a -> m) -> Compose f g a -> m Source #

foldr :: (a -> b -> b) -> b -> Compose f g a -> b Source #

foldr' :: (a -> b -> b) -> b -> Compose f g a -> b Source #

foldl :: (b -> a -> b) -> b -> Compose f g a -> b Source #

foldl' :: (b -> a -> b) -> b -> Compose f g a -> b Source #

foldr1 :: (a -> a -> a) -> Compose f g a -> a Source #

foldl1 :: (a -> a -> a) -> Compose f g a -> a Source #

toList :: Compose f g a -> [a] Source #

null :: Compose f g a -> Bool Source #

length :: Compose f g a -> Int Source #

elem :: Eq a => a -> Compose f g a -> Bool Source #

maximum :: Ord a => Compose f g a -> a Source #

minimum :: Ord a => Compose f g a -> a Source #

sum :: Num a => Compose f g a -> a Source #

product :: Num a => Compose f g a -> a Source #

class (Functor t, Foldable t) => Traversable t where Source #

Functors representing data structures that can be traversed from left to right.

A definition of traverse must satisfy the following laws:

naturality
t . traverse f = traverse (t . f) for every applicative transformation t
identity
traverse Identity = Identity
composition
traverse (Compose . fmap g . f) = Compose . fmap (traverse g) . traverse f

A definition of sequenceA must satisfy the following laws:

naturality
t . sequenceA = sequenceA . fmap t for every applicative transformation t
identity
sequenceA . fmap Identity = Identity
composition
sequenceA . fmap Compose = Compose . fmap sequenceA . sequenceA

where an applicative transformation is a function

t :: (Applicative f, Applicative g) => f a -> g a

preserving the Applicative operations, i.e.

and the identity functor Identity and composition of functors Compose are defined as

  newtype Identity a = Identity a

  instance Functor Identity where
    fmap f (Identity x) = Identity (f x)

  instance Applicative Identity where
    pure x = Identity x
    Identity f <*> Identity x = Identity (f x)

  newtype Compose f g a = Compose (f (g a))

  instance (Functor f, Functor g) => Functor (Compose f g) where
    fmap f (Compose x) = Compose (fmap (fmap f) x)

  instance (Applicative f, Applicative g) => Applicative (Compose f g) where
    pure x = Compose (pure (pure x))
    Compose f <*> Compose x = Compose ((<*>) <$> f <*> x)

(The naturality law is implied by parametricity.)

Instances are similar to Functor, e.g. given a data type

data Tree a = Empty | Leaf a | Node (Tree a) a (Tree a)

a suitable instance would be

instance Traversable Tree where
   traverse f Empty = pure Empty
   traverse f (Leaf x) = Leaf <$> f x
   traverse f (Node l k r) = Node <$> traverse f l <*> f k <*> traverse f r

This is suitable even for abstract types, as the laws for <*> imply a form of associativity.

The superclass instances should satisfy the following:

Minimal complete definition

traverse | sequenceA

Methods

traverse :: Applicative f => (a -> f b) -> t a -> f (t b) Source #

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see traverse_.

sequenceA :: Applicative f => t (f a) -> f (t a) Source #

Evaluate each action in the structure from left to right, and and collect the results. For a version that ignores the results see sequenceA_.

mapM :: Monad m => (a -> m b) -> t a -> m (t b) Source #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see mapM_.

sequence :: Monad m => t (m a) -> m (t a) Source #

Evaluate each monadic action in the structure from left to right, and collect the results. For a version that ignores the results see sequence_.

Instances
Traversable [] Source #

Since: 2.1

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> [a] -> f [b] Source #

sequenceA :: Applicative f => [f a] -> f [a] Source #

mapM :: Monad m => (a -> m b) -> [a] -> m [b] Source #

sequence :: Monad m => [m a] -> m [a] Source #

Traversable Maybe Source #

Since: 2.1

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) Source #

sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) Source #

mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) Source #

sequence :: Monad m => Maybe (m a) -> m (Maybe a) Source #

Traversable Par1 Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Par1 a -> f (Par1 b) Source #

sequenceA :: Applicative f => Par1 (f a) -> f (Par1 a) Source #

mapM :: Monad m => (a -> m b) -> Par1 a -> m (Par1 b) Source #

sequence :: Monad m => Par1 (m a) -> m (Par1 a) Source #

Traversable NonEmpty Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) Source #

sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) Source #

mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) Source #

sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) Source #

Traversable Product Source #

Since: 4.8.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) Source #

sequenceA :: Applicative f => Product (f a) -> f (Product a) Source #

mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) Source #

sequence :: Monad m => Product (m a) -> m (Product a) Source #

Traversable Sum Source #

Since: 4.8.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) Source #

sequenceA :: Applicative f => Sum (f a) -> f (Sum a) Source #

mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) Source #

sequence :: Monad m => Sum (m a) -> m (Sum a) Source #

Traversable Dual Source #

Since: 4.8.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) Source #

sequenceA :: Applicative f => Dual (f a) -> f (Dual a) Source #

mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) Source #

sequence :: Monad m => Dual (m a) -> m (Dual a) Source #

Traversable Last Source #

Since: 4.8.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) Source #

sequenceA :: Applicative f => Last (f a) -> f (Last a) Source #

mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) Source #

sequence :: Monad m => Last (m a) -> m (Last a) Source #

Traversable First Source #

Since: 4.8.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> First a -> f (First b) Source #

sequenceA :: Applicative f => First (f a) -> f (First a) Source #

mapM :: Monad m => (a -> m b) -> First a -> m (First b) Source #

sequence :: Monad m => First (m a) -> m (First a) Source #

Traversable Identity Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) Source #

sequenceA :: Applicative f => Identity (f a) -> f (Identity a) Source #

mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) Source #

sequence :: Monad m => Identity (m a) -> m (Identity a) Source #

Traversable ZipList Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) Source #

sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) Source #

mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) Source #

sequence :: Monad m => ZipList (m a) -> m (ZipList a) Source #

Traversable Option Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Option a -> f (Option b) Source #

sequenceA :: Applicative f => Option (f a) -> f (Option a) Source #

mapM :: Monad m => (a -> m b) -> Option a -> m (Option b) Source #

sequence :: Monad m => Option (m a) -> m (Option a) Source #

Traversable Last Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) Source #

sequenceA :: Applicative f => Last (f a) -> f (Last a) Source #

mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) Source #

sequence :: Monad m => Last (m a) -> m (Last a) Source #

Traversable First Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> First a -> f (First b) Source #

sequenceA :: Applicative f => First (f a) -> f (First a) Source #

mapM :: Monad m => (a -> m b) -> First a -> m (First b) Source #

sequence :: Monad m => First (m a) -> m (First a) Source #

Traversable Max Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) Source #

sequenceA :: Applicative f => Max (f a) -> f (Max a) Source #

mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) Source #

sequence :: Monad m => Max (m a) -> m (Max a) Source #

Traversable Min Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) Source #

sequenceA :: Applicative f => Min (f a) -> f (Min a) Source #

mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) Source #

sequence :: Monad m => Min (m a) -> m (Min a) Source #

Traversable Complex Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) Source #

sequenceA :: Applicative f => Complex (f a) -> f (Complex a) Source #

mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) Source #

sequence :: Monad m => Complex (m a) -> m (Complex a) Source #

Traversable (Either a) Source #

Since: 4.7.0.0

Instance details

Methods

traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) Source #

sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) Source #

mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) Source #

sequence :: Monad m => Either a (m a0) -> m (Either a a0) Source #

Traversable (V1 :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) Source #

sequenceA :: Applicative f => V1 (f a) -> f (V1 a) Source #

mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) Source #

sequence :: Monad m => V1 (m a) -> m (V1 a) Source #

Traversable (U1 :: * -> *) Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> U1 a -> f (U1 b) Source #

sequenceA :: Applicative f => U1 (f a) -> f (U1 a) Source #

mapM :: Monad m => (a -> m b) -> U1 a -> m (U1 b) Source #

sequence :: Monad m => U1 (m a) -> m (U1 a) Source #

Traversable ((,) a) Source #

Since: 4.7.0.0

Instance details

Methods

traverse :: Applicative f => (a0 -> f b) -> (a, a0) -> f (a, b) Source #

sequenceA :: Applicative f => (a, f a0) -> f (a, a0) Source #

mapM :: Monad m => (a0 -> m b) -> (a, a0) -> m (a, b) Source #

sequence :: Monad m => (a, m a0) -> m (a, a0) Source #

Traversable (Proxy :: * -> *) Source #

Since: 4.7.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) Source #

sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) Source #

mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) Source #

sequence :: Monad m => Proxy (m a) -> m (Proxy a) Source #

Traversable (Arg a) Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f => (a0 -> f b) -> Arg a a0 -> f (Arg a b) Source #

sequenceA :: Applicative f => Arg a (f a0) -> f (Arg a a0) Source #

mapM :: Monad m => (a0 -> m b) -> Arg a a0 -> m (Arg a b) Source #

sequence :: Monad m => Arg a (m a0) -> m (Arg a a0) Source #

Traversable f => Traversable (Rec1 f) Source # 
Instance details

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) Source #

sequenceA :: Applicative f0 => Rec1 f (f0 a) -> f0 (Rec1 f a) Source #

mapM :: Monad m => (a -> m b) -> Rec1 f a -> m (Rec1 f b) Source #

sequence :: Monad m => Rec1 f (m a) -> m (Rec1 f a) Source #

Traversable (URec Char :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) Source #

sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) Source #

mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) Source #

sequence :: Monad m => URec Char (m a) -> m (URec Char a) Source #

Traversable (URec Double :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) Source #

sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) Source #

mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) Source #

sequence :: Monad m => URec Double (m a) -> m (URec Double a) Source #

Traversable (URec Float :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) Source #

sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) Source #

mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) Source #

sequence :: Monad m => URec Float (m a) -> m (URec Float a) Source #

Traversable (URec Int :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Int a -> f (URec Int b) Source #

sequenceA :: Applicative f => URec Int (f a) -> f (URec Int a) Source #

mapM :: Monad m => (a -> m b) -> URec Int a -> m (URec Int b) Source #

sequence :: Monad m => URec Int (m a) -> m (URec Int a) Source #

Traversable (URec Word :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) Source #

sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) Source #

mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) Source #

sequence :: Monad m => URec Word (m a) -> m (URec Word a) Source #

Traversable (URec (Ptr ()) :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> URec (Ptr ()) a -> f (URec (Ptr ()) b) Source #

sequenceA :: Applicative f => URec (Ptr ()) (f a) -> f (URec (Ptr ()) a) Source #

mapM :: Monad m => (a -> m b) -> URec (Ptr ()) a -> m (URec (Ptr ()) b) Source #

sequence :: Monad m => URec (Ptr ()) (m a) -> m (URec (Ptr ()) a) Source #

Traversable (Const m :: * -> *) Source #

Since: 4.7.0.0

Instance details

Methods

traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) Source #

sequenceA :: Applicative f => Const m (f a) -> f (Const m a) Source #

mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) Source #

sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) Source #

Traversable (K1 i c :: * -> *) Source # 
Instance details

Methods

traverse :: Applicative f => (a -> f b) -> K1 i c a -> f (K1 i c b) Source #

sequenceA :: Applicative f => K1 i c (f a) -> f (K1 i c a) Source #

mapM :: Monad m => (a -> m b) -> K1 i c a -> m (K1 i c b) Source #

sequence :: Monad m => K1 i c (m a) -> m (K1 i c a) Source #

(Traversable f, Traversable g) => Traversable (f :+: g) Source # 
Instance details

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) Source #

sequenceA :: Applicative f0 => (f :+: g) (f0 a) -> f0 ((f :+: g) a) Source #

mapM :: Monad m => (a -> m b) -> (f :+: g) a -> m ((f :+: g) b) Source #

sequence :: Monad m => (f :+: g) (m a) -> m ((f :+: g) a) Source #

(Traversable f, Traversable g) => Traversable (f :*: g) Source # 
Instance details

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) Source #

sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((f :*: g) a) Source #

mapM :: Monad m => (a -> m b) -> (f :*: g) a -> m ((f :*: g) b) Source #

sequence :: Monad m => (f :*: g) (m a) -> m ((f :*: g) a) Source #

(Traversable f, Traversable g) => Traversable (Sum f g) Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Sum f g a -> f0 (Sum f g b) Source #

sequenceA :: Applicative f0 => Sum f g (f0 a) -> f0 (Sum f g a) Source #

mapM :: Monad m => (a -> m b) -> Sum f g a -> m (Sum f g b) Source #

sequence :: Monad m => Sum f g (m a) -> m (Sum f g a) Source #

(Traversable f, Traversable g) => Traversable (Product f g) Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) Source #

sequenceA :: Applicative f0 => Product f g (f0 a) -> f0 (Product f g a) Source #

mapM :: Monad m => (a -> m b) -> Product f g a -> m (Product f g b) Source #

sequence :: Monad m => Product f g (m a) -> m (Product f g a) Source #

Traversable f => Traversable (M1 i c f) Source # 
Instance details

Methods

traverse :: Applicative f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) Source #

sequenceA :: Applicative f0 => M1 i c f (f0 a) -> f0 (M1 i c f a) Source #

mapM :: Monad m => (a -> m b) -> M1 i c f a -> m (M1 i c f b) Source #

sequence :: Monad m => M1 i c f (m a) -> m (M1 i c f a) Source #

(Traversable f, Traversable g) => Traversable (f :.: g) Source # 
Instance details

Methods

traverse :: Applicative f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) Source #

sequenceA :: Applicative f0 => (f :.: g) (f0 a) -> f0 ((f :.: g) a) Source #

mapM :: Monad m => (a -> m b) -> (f :.: g) a -> m ((f :.: g) b) Source #

sequence :: Monad m => (f :.: g) (m a) -> m ((f :.: g) a) Source #

(Traversable f, Traversable g) => Traversable (Compose f g) Source #

Since: 4.9.0.0

Instance details

Methods

traverse :: Applicative f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) Source #

sequenceA :: Applicative f0 => Compose f g (f0 a) -> f0 (Compose f g a) Source #

mapM :: Monad m => (a -> m b) -> Compose f g a -> m (Compose f g b) Source #

sequence :: Monad m => Compose f g (m a) -> m (Compose f g a) Source #

Miscellaneous functions

id :: a -> a Source #

Identity function.

id x = x

const :: a -> b -> a Source #

const x is a unary function which evaluates to x for all inputs.

>>> const 42 "hello"
42
>>> map (const 42) [0..3]
[42,42,42,42]

(.) :: (b -> c) -> (a -> b) -> a -> c infixr 9 Source #

Function composition.

flip :: (a -> b -> c) -> b -> a -> c Source #

flip f takes its (first) two arguments in the reverse order of f.

>>> flip (++) "hello" "world"
"worldhello"

($) :: (a -> b) -> a -> b infixr 0 Source #

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.

until :: (a -> Bool) -> (a -> a) -> a -> a Source #

until p f yields the result of applying f until p holds.

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.

error :: forall (r :: RuntimeRep). forall (a :: TYPE r). HasCallStack => [Char] -> a Source #

error stops execution and displays an error message.

errorWithoutStackTrace :: forall (r :: RuntimeRep). forall (a :: TYPE r). [Char] -> a Source #

A variant of error that does not produce a stack trace.

Since: 4.9.0.0

undefined :: forall (r :: RuntimeRep). forall (a :: TYPE r). HasCallStack => a Source #

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. 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.

($!) :: (a -> b) -> a -> b infixr 0 Source #

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.

List operations

map :: (a -> b) -> [a] -> [b] Source #

map f xs is the list obtained by applying f to each element of xs, i.e.,

map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]
map f [x1, x2, ...] == [f x1, f x2, ...]

(++) :: [a] -> [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.

filter :: (a -> Bool) -> [a] -> [a] Source #

filter, applied to a predicate and a list, returns the list of those elements that satisfy the predicate; i.e.,

filter p xs = [ x | x <- xs, p x]

head :: [a] -> a Source #

Extract the first element of a list, which must be non-empty.

last :: [a] -> a Source #

Extract the last element of a list, which must be finite and non-empty.

tail :: [a] -> [a] Source #

Extract the elements after the head of a list, which must be non-empty.

init :: [a] -> [a] Source #

Return all the elements of a list except the last one. The list must be non-empty.

null :: Foldable t => t a -> Bool Source #

Test whether the structure is empty. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

length :: Foldable t => t a -> Int Source #

Returns the size/length of a finite structure as an Int. The default implementation is optimized for structures that are similar to cons-lists, because there is no general way to do better.

(!!) :: [a] -> Int -> a infixl 9 Source #

List index (subscript) operator, starting from 0. It is an instance of the more general genericIndex, which takes an index of any integral type.

reverse :: [a] -> [a] Source #

reverse xs returns the elements of xs in reverse order. xs must be finite.

Special folds

and :: Foldable t => t Bool -> Bool Source #

and returns the conjunction of a container of Bools. For the result to be True, the container must be finite; False, however, results from a False value finitely far from the left end.

or :: Foldable t => t Bool -> Bool Source #

or returns the disjunction of a container of Bools. For the result to be False, the container must be finite; True, however, results from a True value finitely far from the left end.

any :: Foldable t => (a -> Bool) -> t a -> Bool Source #

Determines whether any element of the structure satisfies the predicate.

all :: Foldable t => (a -> Bool) -> t a -> Bool Source #

Determines whether all elements of the structure satisfy the predicate.

concat :: Foldable t => t [a] -> [a] Source #

The concatenation of all the elements of a container of lists.

concatMap :: Foldable t => (a -> [b]) -> t a -> [b] Source #

Map a function over all the elements of a container and concatenate the resulting lists.

Building lists

Scans

scanl :: (b -> a -> b) -> b -> [a] -> [b] Source #

scanl is similar to foldl, but returns a list of successive reduced values from the left:

scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]

Note that

last (scanl f z xs) == foldl f z xs.

scanl1 :: (a -> a -> a) -> [a] -> [a] Source #

scanl1 is a variant of scanl that has no starting value argument:

scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]

scanr :: (a -> b -> b) -> b -> [a] -> [b] Source #

scanr is the right-to-left dual of scanl. Note that

head (scanr f z xs) == foldr f z xs.

scanr1 :: (a -> a -> a) -> [a] -> [a] Source #

scanr1 is a variant of scanr that has no starting value argument.

Infinite lists

iterate :: (a -> a) -> a -> [a] Source #

iterate f x returns an infinite list of repeated applications of f to x:

iterate f x == [x, f x, f (f x), ...]

Note that iterate is lazy, potentially leading to thunk build-up if the consumer doesn't force each iterate. See 'iterate\'' for a strict variant of this function.

repeat :: a -> [a] Source #

repeat x is an infinite list, with x the value of every element.

replicate :: Int -> a -> [a] Source #

replicate n x is a list of length n with x the value of every element. It is an instance of the more general genericReplicate, in which n may be of any integral type.

cycle :: [a] -> [a] Source #

cycle ties a finite list into a circular one, or equivalently, the infinite repetition of the original list. It is the identity on infinite lists.

Sublists

take :: Int -> [a] -> [a] Source #

take n, applied to a list xs, returns the prefix of xs of length n, or xs itself if n > length xs:

take 5 "Hello World!" == "Hello"
take 3 [1,2,3,4,5] == [1,2,3]
take 3 [1,2] == [1,2]
take 3 [] == []
take (-1) [1,2] == []
take 0 [1,2] == []

It is an instance of the more general genericTake, in which n may be of any integral type.

drop :: Int -> [a] -> [a] Source #

drop n xs returns the suffix of xs after the first n elements, or [] if n > length xs:

drop 6 "Hello World!" == "World!"
drop 3 [1,2,3,4,5] == [4,5]
drop 3 [1,2] == []
drop 3 [] == []
drop (-1) [1,2] == [1,2]
drop 0 [1,2] == [1,2]

It is an instance of the more general genericDrop, in which n may be of any integral type.

splitAt :: Int -> [a] -> ([a], [a]) Source #

splitAt n xs returns a tuple where first element is xs prefix of length n and second element is the remainder of the list:

splitAt 6 "Hello World!" == ("Hello ","World!")
splitAt 3 [1,2,3,4,5] == ([1,2,3],[4,5])
splitAt 1 [1,2,3] == ([1],[2,3])
splitAt 3 [1,2,3] == ([1,2,3],[])
splitAt 4 [1,2,3] == ([1,2,3],[])
splitAt 0 [1,2,3] == ([],[1,2,3])
splitAt (-1) [1,2,3] == ([],[1,2,3])

It is equivalent to (take n xs, drop n xs) when n is not _|_ (splitAt _|_ xs = _|_). splitAt is an instance of the more general genericSplitAt, in which n may be of any integral type.

takeWhile :: (a -> Bool) -> [a] -> [a] Source #

takeWhile, applied to a predicate p and a list xs, returns the longest prefix (possibly empty) of xs of elements that satisfy p:

takeWhile (< 3) [1,2,3,4,1,2,3,4] == [1,2]
takeWhile (< 9) [1,2,3] == [1,2,3]
takeWhile (< 0) [1,2,3] == []

dropWhile :: (a -> Bool) -> [a] -> [a] Source #

dropWhile p xs returns the suffix remaining after takeWhile p xs:

dropWhile (< 3) [1,2,3,4,5,1,2,3] == [3,4,5,1,2,3]
dropWhile (< 9) [1,2,3] == []
dropWhile (< 0) [1,2,3] == [1,2,3]

span :: (a -> Bool) -> [a] -> ([a], [a]) Source #

span, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that satisfy p and second element is the remainder of the list:

span (< 3) [1,2,3,4,1,2,3,4] == ([1,2],[3,4,1,2,3,4])
span (< 9) [1,2,3] == ([1,2,3],[])
span (< 0) [1,2,3] == ([],[1,2,3])

span p xs is equivalent to (takeWhile p xs, dropWhile p xs)

break :: (a -> Bool) -> [a] -> ([a], [a]) Source #

break, applied to a predicate p and a list xs, returns a tuple where first element is longest prefix (possibly empty) of xs of elements that do not satisfy p and second element is the remainder of the list:

break (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])
break (< 9) [1,2,3] == ([],[1,2,3])
break (> 9) [1,2,3] == ([1,2,3],[])

break p is equivalent to span (not . p).

Searching lists

notElem :: (Foldable t, Eq a) => a -> t a -> Bool infix 4 Source #

notElem is the negation of elem.

lookup :: Eq a => a -> [(a, b)] -> Maybe b Source #

lookup key assocs looks up a key in an association list.

Zipping and unzipping lists

zip :: [a] -> [b] -> [(a, b)] Source #

zip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded.

zip is right-lazy:

zip [] _|_ = []

zip3 :: [a] -> [b] -> [c] -> [(a, b, c)] Source #

zip3 takes three lists and returns a list of triples, analogous to zip.

zipWith :: (a -> b -> c) -> [a] -> [b] -> [c] Source #

zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function. For example, zipWith (+) is applied to two lists to produce the list of corresponding sums.

zipWith is right-lazy:

zipWith f [] _|_ = []

zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] Source #

The zipWith3 function takes a function which combines three elements, as well as three lists and returns a list of their point-wise combination, analogous to zipWith.

unzip :: [(a, b)] -> ([a], [b]) Source #

unzip transforms a list of pairs into a list of first components and a list of second components.

unzip3 :: [(a, b, c)] -> ([a], [b], [c]) Source #

The unzip3 function takes a list of triples and returns three lists, analogous to unzip.

Functions on strings

lines :: String -> [String] Source #

lines breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines.

Note that after splitting the string at newline characters, the last part of the string is considered a line even if it doesn't end with a newline. For example,

>>> lines ""
[]
>>> lines "\n"
[""]
>>> lines "one"
["one"]
>>> lines "one\n"
["one"]
>>> lines "one\n\n"
["one",""]
>>> lines "one\ntwo"
["one","two"]
>>> lines "one\ntwo\n"
["one","two"]

Thus lines s contains at least as many elements as newlines in s.

words :: String -> [String] Source #

words breaks a string up into a list of words, which were delimited by white space.

>>> words "Lorem ipsum\ndolor"
["Lorem","ipsum","dolor"]

unlines :: [String] -> String Source #

unlines is an inverse operation to lines. It joins lines, after appending a terminating newline to each.

>>> unlines ["Hello", "World", "!"]
"Hello\nWorld\n!\n"

unwords :: [String] -> String Source #

unwords is an inverse operation to words. It joins words with separating spaces.

>>> unwords ["Lorem", "ipsum", "dolor"]
"Lorem ipsum dolor"

Converting to and from String

Converting to String

type ShowS = String -> String Source #

The shows functions return a function that prepends the output String to an existing String. This allows constant-time concatenation of results using function composition.

class Show a where Source #

Conversion of values to readable Strings.

Derived instances of Show have the following properties, which are compatible with derived instances of Read:

  • The result of show is a syntactically correct Haskell expression containing only constants, given the fixity declarations in force at the point where the type is declared. It contains only the constructor names defined in the data type, parentheses, and spaces. When labelled constructor fields are used, braces, commas, field names, and equal signs are also used.
  • If the constructor is defined to be an infix operator, then showsPrec will produce infix applications of the constructor.
  • the representation will be enclosed in parentheses if the precedence of the top-level constructor in x is less than d (associativity is ignored). Thus, if d is 0 then the result is never surrounded in parentheses; if d is 11 it is always surrounded in parentheses, unless it is an atomic expression.
  • If the constructor is defined using record syntax, then show will produce the record-syntax form, with the fields given in the same order as the original declaration.

For example, given the declarations

infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of Show is equivalent to

instance (Show a) => Show (Tree a) where

       showsPrec d (Leaf m) = showParen (d > app_prec) $
            showString "Leaf " . showsPrec (app_prec+1) m
         where app_prec = 10

       showsPrec d (u :^: v) = showParen (d > up_prec) $
            showsPrec (up_prec+1) u .
            showString " :^: "      .
            showsPrec (up_prec+1) v
         where up_prec = 5

Note that right-associativity of :^: is ignored. For example,

  • show (Leaf 1 :^: Leaf 2 :^: Leaf 3) produces the string "Leaf 1 :^: (Leaf 2 :^: Leaf 3)".

Minimal complete definition

showsPrec | show

Methods

showsPrec 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
Show Bool Source # 
Instance details
Show Char Source #

Since: 2.1

Instance details
Show Double Source #

Since: 2.1

Instance details
Show Float Source #

Since: 2.1

Instance details
Show Int Source #

Since: 2.1

Instance details
Show Int8 Source #

Since: 2.1

Instance details
Show Int16 Source #

Since: 2.1

Instance details
Show Int32 Source #

Since: 2.1

Instance details
Show Int64 Source #

Since: 2.1

Instance details
Show Integer Source #

Since: 2.1

Instance details
Show Natural Source #

Since: 4.8.0.0

Instance details
Show Ordering Source # 
Instance details
Show Word Source #

Since: 2.1

Instance details
Show Word8 Source #

Since: 2.1

Instance details
Show Word16 Source #

Since: 2.1

Instance details
Show Word32 Source #

Since: 2.1

Instance details
Show Word64 Source #

Since: 2.1

Instance details
Show RuntimeRep Source # 
Instance details
Show VecCount Source # 
Instance details
Show VecElem Source # 
Instance details
Show CallStack Source #

Since: 4.9.0.0

Instance details
Show SomeTypeRep Source #

Since: 4.10.0.0

Instance details
Show () Source # 
Instance details

Methods

showsPrec :: Int -> () -> ShowS Source #

show :: () -> String Source #

showList :: [()] -> ShowS Source #

Show TyCon Source #

Since: 2.1

Instance details
Show Module Source #

Since: 4.9.0.0

Instance details
Show TrName Source #

Since: 4.9.0.0

Instance details
Show KindRep Source # 
Instance details
Show TypeLitSort Source # 
Instance details
Show SrcLoc Source # 
Instance details
Show SomeException Source #

Since: 3.0

Instance details
Show GeneralCategory Source # 
Instance details
Show Number Source # 
Instance details
Show Lexeme Source # 
Instance details
Show Fingerprint Source #

Since: 4.7.0.0

Instance details
Show IOMode Source # 
Instance details
Show IntPtr Source # 
Instance details
Show WordPtr Source # 
Instance details
Show CUIntMax Source # 
Instance details
Show CIntMax Source # 
Instance details
Show CUIntPtr Source # 
Instance details
Show CIntPtr Source # 
Instance details
Show CSUSeconds Source # 
Instance details
Show CUSeconds Source # 
Instance details
Show CTime Source # 
Instance details
Show CClock Source # 
Instance details
Show CSigAtomic Source # 
Instance details
Show CWchar Source # 
Instance details
Show CSize Source # 
Instance details
Show CPtrdiff Source # 
Instance details
Show CDouble Source # 
Instance details
Show CFloat Source # 
Instance details
Show CBool Source # 
Instance details
Show CULLong Source # 
Instance details
Show CLLong Source # 
Instance details
Show CULong Source # 
Instance details
Show CLong Source # 
Instance details
Show CUInt Source # 
Instance details
Show CInt Source # 
Instance details
Show CUShort Source # 
Instance details
Show CShort Source # 
Instance details
Show CUChar Source # 
Instance details
Show CSChar Source # 
Instance details
Show CChar Source # 
Instance details
Show SomeNat Source #

Since: 4.7.0.0

Instance details
Show SomeSymbol Source #

Since: 4.7.0.0

Instance details
Show DecidedStrictness Source # 
Instance details
Show SourceStrictness Source # 
Instance details
Show SourceUnpackedness Source # 
Instance details
Show Associativity Source # 
Instance details
Show Fixity Source # 
Instance details
Show Any Source # 
Instance details
Show All Source # 
Instance details
Show ArithException Source #

Since: 4.0.0.0

Instance details
Show ErrorCall Source #

Since: 4.0.0.0

Instance details
Show IOException Source #

Since: 4.1.0.0

Instance details
Show MaskingState Source # 
Instance details
Show CodingProgress Source # 
Instance details
Show TextEncoding Source #

Since: 4.3.0.0

Instance details
Show SeekMode Source # 
Instance details
Show NewlineMode Source # 
Instance details
Show Newline Source # 
Instance details
Show BufferMode Source # 
Instance details
Show Handle Source #

Since: 4.1.0.0

Instance details
Show IOErrorType Source #

Since: 4.1.0.0

Instance details
Show ExitCode Source # 
Instance details
Show FixIOException Source # 
Instance details
Show ArrayException Source #

Since: 4.1.0.0

Instance details
Show AsyncException Source #

Since: 4.1.0.0

Instance details
Show SomeAsyncException Source #

Since: 4.7.0.0

Instance details
Show AssertionFailed Source #

Since: 4.1.0.0

Instance details
Show CompactionFailed Source #

Since: 4.10.0.0

Instance details
Show AllocationLimitExceeded Source #

Since: 4.7.1.0

Instance details
Show Deadlock Source #

Since: 4.1.0.0

Instance details
Show BlockedIndefinitelyOnSTM Source #

Since: 4.1.0.0

Instance details
Show BlockedIndefinitelyOnMVar Source #

Since: 4.1.0.0

Instance details
Show CodingFailureMode Source # 
Instance details
Show Fd Source # 
Instance details
Show CTimer Source # 
Instance details
Show CKey Source # 
Instance details
Show CId Source # 
Instance details
Show CFsFilCnt Source # 
Instance details
Show CFsBlkCnt Source # 
Instance details
Show CClockId Source # 
Instance details
Show CBlkCnt Source # 
Instance details
Show CBlkSize Source # 
Instance details
Show CRLim Source # 
Instance details
Show CTcflag Source # 
Instance details
Show CSpeed Source # 
Instance details
Show CCc Source # 
Instance details
Show CUid Source # 
Instance details
Show CNlink Source # 
Instance details
Show CGid Source # 
Instance details
Show CSsize Source # 
Instance details
Show CPid Source # 
Instance details
Show COff Source # 
Instance details
Show CMode Source # 
Instance details
Show CIno Source # 
Instance details
Show CDev Source # 
Instance details
Show Lifetime Source # 
Instance details
Show Event Source #

Since: 4.3.1.0

Instance details
Show Dynamic Source #

Since: 2.1

Instance details
Show ThreadStatus Source # 
Instance details
Show BlockReason Source # 
Instance details
Show ThreadId Source #

Since: 4.2.0.0

Instance details
Show NestedAtomically Source #

Since: 4.0

Instance details
Show NonTermination Source #

Since: 4.0

Instance details
Show TypeError Source #

Since: 4.9.0.0

Instance details
Show NoMethodError Source #

Since: 4.0

Instance details
Show RecUpdError Source #

Since: 4.0

Instance details
Show RecConError Source #

Since: 4.0

Instance details
Show RecSelError Source #

Since: 4.0

Instance details
Show PatternMatchFail Source #

Since: 4.0

Instance details
Show FdKey Source # 
Instance details
Show FileLockingNotSupported Source # 
Instance details
Show HandlePosn Source #

Since: 4.1.0.0

Instance details
Show Version Source # 
Instance details
Show ByteOrder Source # 
Instance details
Show GCDetails Source # 
Instance details
Show RTSStats Source # 
Instance details
Show RTSFlags Source # 
Instance details
Show ParFlags Source # 
Instance details
Show TickyFlags Source # 
Instance details
Show TraceFlags Source # 
Instance details
Show DoTrace Source # 
Instance details
Show ProfFlags Source # 
Instance details
Show DoHeapProfile Source # 
Instance details
Show CCFlags Source # 
Instance details
Show DoCostCentres Source # 
Instance details
Show DebugFlags Source # 
Instance details
Show MiscFlags Source # 
Instance details
Show ConcFlags Source # 
Instance details
Show GCFlags Source # 
Instance details
Show GiveGCStats Source # 
Instance details
Show Fixity Source # 
Instance details
Show ConstrRep Source # 
Instance details
Show DataRep Source # 
Instance details
Show Constr Source #

Since: 4.0.0.0

Instance details
Show DataType Source # 
Instance details
Show StaticPtrInfo Source # 
Instance details
Show Void Source #

Since: 4.8.0.0

Instance details
Show a => Show [a] Source #

Since: 2.1

Instance details

Methods

showsPrec :: Int -> [a] -> ShowS Source #

show :: [a] -> String Source #

showList :: [[a]] -> ShowS Source #

Show a => Show (Maybe a) Source # 
Instance details
Show a => Show (Ratio a) Source #

Since: 2.0.1

Instance details
Show (Ptr a) Source #

Since: 2.1

Instance details

Methods

showsPrec :: Int -> Ptr a -> ShowS Source #

show :: Ptr a -> String Source #

showList :: [Ptr a] -> ShowS Source #

Show (FunPtr a) Source #

Since: 2.1

Instance details
Show p => Show (Par1 p) Source # 
Instance details

Methods

showsPrec :: Int -> Par1 p -> ShowS Source #

show :: Par1 p -> String Source #

showList :: [Par1 p] -> ShowS Source #

Show a => Show (NonEmpty a) Source # 
Instance details
Show a => Show (Down a) Source #

Since: 4.7.0.0

Instance details

Methods

showsPrec :: Int -> Down a -> ShowS Source #

show :: Down a -> String Source #

showList :: [Down a] -> ShowS Source #

Show a => Show (Product a) Source # 
Instance details
Show a => Show (Sum a) Source # 
Instance details

Methods

showsPrec :: Int -> Sum a -> ShowS Source #

show :: Sum a -> String Source #

showList :: [Sum a] -> ShowS Source #

Show a => Show (Dual a) Source # 
Instance details

Methods

showsPrec :: Int -> Dual a -> ShowS Source #

show :: Dual a -> String Source #

showList :: [Dual a] -> ShowS Source #

Show a => Show (Last a) Source # 
Instance details

Methods

showsPrec :: Int -> Last a -> ShowS Source #

show :: Last a -> String Source #

showList :: [Last a] -> ShowS Source #

Show a => Show (First a) Source # 
Instance details
Show (ForeignPtr a) Source #

Since: 2.1

Instance details
Show a => Show (Identity a) Source #

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Since: 4.8.0.0

Instance details
Show a => Show (ZipList a) Source # 
Instance details
Show a => Show (Option a) Source # 
Instance details
Show m => Show (WrappedMonoid m) Source # 
Instance details
Show a => Show (Last a) Source # 
Instance details

Methods

showsPrec :: Int -> Last a -> ShowS Source #

show :: Last a -> String Source #

showList :: [Last a] -> ShowS Source #

Show a => Show (First a) Source # 
Instance details
Show a => Show (Max a) Source # 
Instance details

Methods

showsPrec :: Int -> Max a -> ShowS Source #

show :: Max a -> String Source #

showList :: [Max a] -> ShowS Source #

Show a => Show (Min a) Source # 
Instance details

Methods

showsPrec :: Int -> Min a -> ShowS Source #

show :: Min a -> String Source #

showList :: [Min a] -> ShowS Source #

HasResolution a => Show (Fixed a) Source #

Since: 2.1

Instance details
Show a => Show (Complex a) Source # 
Instance details
Show (a -> b) Source #

Since: 2.1

Instance details

Methods

showsPrec :: Int -> (a -> b) -> ShowS Source #

show :: (a -> b) -> String Source #

showList :: [a -> b] -> ShowS Source #

(Show a, Show b) => Show (Either a b) Source # 
Instance details

Methods

showsPrec :: Int -> Either a b -> ShowS Source #

show :: Either a b -> String Source #

showList :: [Either a b] -> ShowS Source #

Show (V1 p) Source #

Since: 4.9.0.0

Instance details

Methods

showsPrec :: Int -> V1 p -> ShowS Source #

show :: V1 p -> String Source #

showList :: [V1 p] -> ShowS Source #

Show (U1 p) Source #

Since: 4.9.0.0

Instance details

Methods

showsPrec :: Int -> U1 p -> ShowS Source #

show :: U1 p -> String Source #

showList :: [U1 p] -> ShowS Source #

Show (TypeRep a) Source # 
Instance details
(Show a, Show b) => Show (a, b) Source #

Since: 2.1

Instance details

Methods

showsPrec :: Int -> (a, b) -> ShowS Source #

show :: (a, b) -> String Source #

showList :: [(a, b)] -> ShowS Source #

Show (ST s a) Source #

Since: 2.1

Instance details

Methods

showsPrec :: Int -> ST s a -> ShowS Source #

show :: ST s a -> String Source #

showList :: [ST s a] -> ShowS Source #

Show (Proxy s) Source #

Since: 4.7.0.0

Instance details
(Show a, Show b) => Show (Arg a b) Source # 
Instance details

Methods

showsPrec :: Int -> Arg a b -> ShowS Source #

show :: Arg a b -> String Source #

showList :: [Arg a b] -> ShowS Source #

Show (f p) => Show (Rec1 f p) Source # 
Instance details

Methods

showsPrec :: Int -> Rec1 f p -> ShowS Source #

show :: Rec1 f p -> String Source #

showList :: [Rec1 f p] -> ShowS Source #

Show (URec Word p) Source # 
Instance details
Show (URec Int p) Source # 
Instance details
Show (URec Float p) Source # 
Instance details
Show (URec Double p) Source # 
Instance details
Show (URec Char p) Source # 
Instance details
(Show a, Show b, Show c) => Show (a, b, c) Source #

Since: 2.1

Instance details

Methods

showsPrec :: Int -> (a, b, c) -> ShowS Source #

show :: (a, b, c) -> String Source #

showList :: [(a, b, c)] -> ShowS Source #

Show (a :~: b) Source # 
Instance details

Methods

showsPrec :: Int -> (a :~: b) -> ShowS Source #

show :: (a :~: b) -> String Source #

showList :: [a :~: b] -> ShowS Source #

Show (Coercion a b) Source # 
Instance details
Show (f a) => Show (Alt f a) Source # 
Instance details

Methods

showsPrec :: Int -> Alt f a -> ShowS Source #

show :: Alt f a -> String Source #

showList :: [Alt f a] -> ShowS Source #

Show a => Show (Const a b) Source #

This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed

Since: 4.8.0.0

Instance details

Methods

showsPrec :: Int -> Const a b -> ShowS Source #

show :: Const a b -> String Source #

showList :: [Const a b] -> ShowS Source #

Show c => Show (K1 i c p) Source # 
Instance details

Methods

showsPrec :: Int -> K1 i c p -> ShowS Source #

show :: K1 i c p -> String Source #

showList :: [K1 i c p] -> ShowS Source #

(Show (f p), Show (g p)) => Show ((f :+: g) p) Source # 
Instance details

Methods

showsPrec :: Int -> (f :+: g) p -> ShowS Source #

show :: (f :+: g) p -> String Source #

showList :: [(f :+: g) p] -> ShowS Source #

(Show (f p), Show (g p)) => Show ((f :*: g) p) Source # 
Instance details

Methods

showsPrec :: Int -> (f :*: g) p -> ShowS Source #

show :: (f :*: g) p -> String Source #

showList :: [(f :*: g) p] -> ShowS Source #

(Show a, Show b, Show c, Show d) => Show (a, b, c, d) Source #

Since: 2.1

Instance details

Methods

showsPrec :: Int -> (a, b, c, d) -> ShowS Source #

show :: (a, b, c, d) -> String Source #

showList :: [(a, b, c, d)] -> ShowS Source #

Show (a :~~: b) Source #

Since: 4.10.0.0

Instance details

Methods

showsPrec :: Int -> (a :~~: b) -> ShowS Source #

show :: (a :~~: b) -> String Source #

showList :: [a :~~: b] -> ShowS Source #

(Show1 f, Show1 g, Show a) => Show (Sum f g a) Source #

Since: 4.9.0.0

Instance details

Methods

showsPrec :: Int -> Sum f g a -> ShowS Source #

show :: Sum f g a -> String Source #

showList :: [Sum f g a] -> ShowS Source #

(Show1 f, Show1 g, Show a) => Show (Product f g a) Source #

Since: 4.9.0.0

Instance details

Methods

showsPrec :: Int -> Product f g a -> ShowS Source #

show :: Product f g a -> String Source #

showList :: [Product f g a] -> ShowS Source #

Show (f p) => Show (M1 i c f p) Source # 
Instance details

Methods

showsPrec :: Int -> M1 i c f p -> ShowS Source #

show :: M1 i c f p -> String Source #

showList :: [M1 i c f p] -> ShowS Source #

Show (f (g p)) => Show ((f :.: g) p) Source # 
Instance details

Methods

showsPrec :: Int -> (f :.: g) p -> ShowS Source #

show :: (f :.: g) p -> String Source #

showList :: [(f :.: g) p] -> ShowS Source #

(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) Source #

Since: 2.1

Instance details

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) Source #

Since: 4.9.0.0

Instance details

Methods

showsPrec :: Int -> Compose f g a -> ShowS Source #

show :: Compose f g a -> String Source #

showList :: [Compose f g a] -> ShowS Source #

(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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) Source #

Since: 2.1

Instance details

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 #

shows :: Show a => a -> ShowS Source #

equivalent to showsPrec with a precedence of 0.

showChar :: Char -> ShowS Source #

utility function converting a Char to a show function that simply prepends the character unchanged.

showString :: String -> ShowS Source #

utility function converting a String to a show function that simply prepends the string unchanged.

showParen :: Bool -> ShowS -> ShowS Source #

utility function that surrounds the inner show function with parentheses when the Bool parameter is True.

Converting from String

type ReadS a = String -> [(a, String)] Source #

A parser for a type a, represented as a function that takes a String and returns a list of possible parses as (a,String) pairs.

Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf ReadP).

class Read a where Source #

Parsing of Strings, producing values.

Derived instances of Read make the following assumptions, which derived instances of Show obey:

  • If the constructor is defined to be an infix operator, then the derived Read instance will parse only infix applications of the constructor (not the prefix form).
  • Associativity is not used to reduce the occurrence of parentheses, although precedence may be.
  • If the constructor is defined using record syntax, the derived Read will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.
  • The derived Read instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.

For example, given the declarations

infixr 5 :^:
data Tree a =  Leaf a  |  Tree a :^: Tree a

the derived instance of Read in Haskell 2010 is equivalent to

instance (Read a) => Read (Tree a) where

        readsPrec d r =  readParen (d > app_prec)
                         (\r -> [(Leaf m,t) |
                                 ("Leaf",s) <- lex r,
                                 (m,t) <- readsPrec (app_prec+1) s]) r

                      ++ readParen (d > up_prec)
                         (\r -> [(u:^:v,w) |
                                 (u,s) <- readsPrec (up_prec+1) r,
                                 (":^:",t) <- lex s,
                                 (v,w) <- readsPrec (up_prec+1) t]) r

          where app_prec = 10
                up_prec = 5

Note that right-associativity of :^: is unused.

The derived instance in GHC is equivalent to

instance (Read a) => Read (Tree a) where

        readPrec = parens $ (prec app_prec $ do
                                 Ident "Leaf" <- lexP
                                 m <- step readPrec
                                 return (Leaf m))

                     +++ (prec up_prec $ do
                                 u <- step readPrec
                                 Symbol ":^:" <- lexP
                                 v <- step readPrec
                                 return (u :^: v))

          where app_prec = 10
                up_prec = 5

        readListPrec = readListPrecDefault

Why do both readsPrec and readPrec exist, and why does GHC opt to implement readPrec in derived Read instances instead of readsPrec? The reason is that readsPrec is based on the ReadS type, and although ReadS is mentioned in the Haskell 2010 Report, it is not a very efficient parser data structure.

readPrec, on the other hand, is based on a much more efficient ReadPrec datatype (a.k.a "new-style parsers"), but its definition relies on the use of the RankNTypes language extension. Therefore, readPrec (and its cousin, readListPrec) are marked as GHC-only. Nevertheless, it is recommended to use readPrec instead of readsPrec whenever possible for the efficiency improvements it brings.

As mentioned above, derived Read instances in GHC will implement readPrec instead of readsPrec. The default implementations of readsPrec (and its cousin, readList) will simply use readPrec under the hood. If you are writing a Read instance by hand, it is recommended to write it like so:

instance Read T where
  readPrec     = ...
  readListPrec = readListPrecDefault

Minimal complete definition

readsPrec | readPrec

Methods

readsPrec Source #

Arguments

:: Int

the operator precedence of the enclosing context (a number from 0 to 11). Function application has precedence 10.

-> ReadS a 

attempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty.

Derived instances of Read and Show satisfy the following:

That is, readsPrec parses the string produced by showsPrec, and delivers the value that showsPrec started with.

readList :: ReadS [a] Source #

The method readList is provided to allow the programmer to give a specialised way of parsing lists of values. For example, this is used by the predefined Read instance of the Char type, where values of type String should be are expected to use double quotes, rather than square brackets.

Instances
Read Bool Source #

Since: 2.1

Instance details
Read Char Source #

Since: 2.1

Instance details
Read Double Source #

Since: 2.1

Instance details
Read Float Source #

Since: 2.1

Instance details
Read Int Source #

Since: 2.1

Instance details
Read Int8 Source #

Since: 2.1

Instance details
Read Int16 Source #

Since: 2.1

Instance details
Read Int32 Source #

Since: 2.1

Instance details
Read Int64 Source #

Since: 2.1

Instance details
Read Integer Source #

Since: 2.1

Instance details
Read Natural Source #

Since: 4.8.0.0

Instance details
Read Ordering Source #

Since: 2.1

Instance details
Read Word Source #

Since: 4.5.0.0

Instance details
Read Word8 Source #

Since: 2.1

Instance details
Read Word16 Source #

Since: 2.1

Instance details
Read Word32 Source #

Since: 2.1

Instance details
Read Word64 Source #

Since: 2.1

Instance details
Read () Source #

Since: 2.1

Instance details
Read GeneralCategory Source # 
Instance details
Read Lexeme Source #

Since: 2.1

Instance details
Read IOMode Source # 
Instance details
Read IntPtr Source # 
Instance details
Read WordPtr Source # 
Instance details
Read CUIntMax Source # 
Instance details
Read CIntMax Source # 
Instance details
Read CUIntPtr Source # 
Instance details
Read CIntPtr Source # 
Instance details
Read CSUSeconds Source # 
Instance details
Read CUSeconds Source # 
Instance details
Read CTime Source # 
Instance details
Read CClock Source # 
Instance details
Read CSigAtomic Source # 
Instance details
Read CWchar Source # 
Instance details
Read CSize Source # 
Instance details
Read CPtrdiff Source # 
Instance details
Read CDouble Source # 
Instance details
Read CFloat Source # 
Instance details
Read CBool Source # 
Instance details
Read CULLong Source # 
Instance details
Read CLLong Source # 
Instance details
Read CULong Source # 
Instance details
Read CLong Source # 
Instance details
Read CUInt Source # 
Instance details
Read CInt Source # 
Instance details
Read CUShort Source # 
Instance details
Read CShort Source # 
Instance details
Read CUChar Source # 
Instance details
Read CSChar Source # 
Instance details
Read CChar Source # 
Instance details
Read SomeNat Source #

Since: 4.7.0.0

Instance details
Read SomeSymbol Source #

Since: 4.7.0.0

Instance details
Read DecidedStrictness Source # 
Instance details
Read SourceStrictness Source # 
Instance details
Read SourceUnpackedness Source # 
Instance details
Read Associativity Source # 
Instance details
Read Fixity Source # 
Instance details
Read Any Source # 
Instance details
Read All Source # 
Instance details
Read SeekMode Source # 
Instance details
Read NewlineMode Source # 
Instance details
Read Newline Source # 
Instance details
Read BufferMode Source # 
Instance details
Read ExitCode Source # 
Instance details
Read Fd Source # 
Instance details
Read CKey Source # 
Instance details
Read CId Source # 
Instance details
Read CFsFilCnt Source # 
Instance details
Read CFsBlkCnt Source # 
Instance details
Read CClockId Source # 
Instance details
Read CBlkCnt Source # 
Instance details
Read CBlkSize Source # 
Instance details
Read CRLim Source # 
Instance details
Read CTcflag Source # 
Instance details
Read CSpeed Source # 
Instance details
Read CCc Source # 
Instance details
Read CUid Source # 
Instance details
Read CNlink Source # 
Instance details
Read CGid Source # 
Instance details
Read CSsize Source # 
Instance details
Read CPid Source # 
Instance details
Read COff Source # 
Instance details
Read CMode Source # 
Instance details
Read CIno Source # 
Instance details
Read CDev Source # 
Instance details
Read Version Source # 
Instance details
Read ByteOrder Source # 
Instance details
Read GCDetails Source # 
Instance details
Read RTSStats Source # 
Instance details
Read Void Source #

Reading a Void value is always a parse error, considering Void as a data type with no constructors.

Since: 4.8.0.0

Instance details
Read a => Read [a] Source #

Since: 2.1

Instance details
Read a => Read (Maybe a) Source #

Since: 2.1

Instance details
(Integral a, Read a) => Read (Ratio a) Source #

Since: 2.1

Instance details
Read p => Read (Par1 p) Source # 
Instance details
Read a => Read (NonEmpty a) Source # 
Instance details
Read a => Read (Down a) Source #

Since: 4.7.0.0

Instance details
Read a => Read (Product a) Source # 
Instance details
Read a => Read (Sum a) Source # 
Instance details
Read a => Read (Dual a) Source # 
Instance details
Read a => Read (Last a) Source # 
Instance details
Read a => Read (First a) Source # 
Instance details
Read a => Read (Identity a) Source #

This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed

Since: 4.8.0.0

Instance details
Read a => Read (ZipList a) Source # 
Instance details
Read a => Read (Option a) Source # 
Instance details
Read m => Read (WrappedMonoid m) Source # 
Instance details
Read a => Read (Last a) Source # 
Instance details
Read a => Read (First a) Source # 
Instance details
Read a => Read (Max a) Source # 
Instance details
Read a => Read (Min a) Source # 
Instance details
HasResolution a => Read (Fixed a) Source #

Since: 4.3.0.0

Instance details
Read a => Read (Complex a) Source # 
Instance details
(Read a, Read b) => Read (Either a b) Source # 
Instance details
Read (V1 p) Source #

Since: 4.9.0.0

Instance details
Read (U1 p) Source #

Since: 4.9.0.0

Instance details
(Read a, Read b) => Read (a, b) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b) Source #

readList :: ReadS [(a, b)] Source #

readPrec :: ReadPrec (a, b) Source #

readListPrec :: ReadPrec [(a, b)] Source #

Read (Proxy t) Source #

Since: 4.7.0.0

Instance details
(Read a, Read b) => Read (Arg a b) Source # 
Instance details
Read (f p) => Read (Rec1 f p) Source # 
Instance details
(Read a, Read b, Read c) => Read (a, b, c) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c) Source #

readList :: ReadS [(a, b, c)] Source #

readPrec :: ReadPrec (a, b, c) Source #

readListPrec :: ReadPrec [(a, b, c)] Source #

a ~ b => Read (a :~: b) Source #

Since: 4.7.0.0

Instance details
Coercible a b => Read (Coercion a b) Source #

Since: 4.7.0.0

Instance details
Read (f a) => Read (Alt f a) Source # 
Instance details
Read a => Read (Const a b) Source #

This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed

Since: 4.8.0.0

Instance details
Read c => Read (K1 i c p) Source # 
Instance details

Methods

readsPrec :: Int -> ReadS (K1 i c p) Source #

readList :: ReadS [K1 i c p] Source #

readPrec :: ReadPrec (K1 i c p) Source #

readListPrec :: ReadPrec [K1 i c p] Source #

(Read (f p), Read (g p)) => Read ((f :+: g) p) Source # 
Instance details

Methods

readsPrec :: Int -> ReadS ((f :+: g) p) Source #

readList :: ReadS [(f :+: g) p] Source #

readPrec :: ReadPrec ((f :+: g) p) Source #

readListPrec :: ReadPrec [(f :+: g) p] Source #

(Read (f p), Read (g p)) => Read ((f :*: g) p) Source # 
Instance details

Methods

readsPrec :: Int -> ReadS ((f :*: g) p) Source #

readList :: ReadS [(f :*: g) p] Source #

readPrec :: ReadPrec ((f :*: g) p) Source #

readListPrec :: ReadPrec [(f :*: g) p] Source #

(Read a, Read b, Read c, Read d) => Read (a, b, c, d) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d) Source #

readList :: ReadS [(a, b, c, d)] Source #

readPrec :: ReadPrec (a, b, c, d) Source #

readListPrec :: ReadPrec [(a, b, c, d)] Source #

a ~~ b => Read (a :~~: b) Source #

Since: 4.10.0.0

Instance details
(Read1 f, Read1 g, Read a) => Read (Sum f g a) Source #

Since: 4.9.0.0

Instance details

Methods

readsPrec :: Int -> ReadS (Sum f g a) Source #

readList :: ReadS [Sum f g a] Source #

readPrec :: ReadPrec (Sum f g a) Source #

readListPrec :: ReadPrec [Sum f g a] Source #

(Read1 f, Read1 g, Read a) => Read (Product f g a) Source #

Since: 4.9.0.0

Instance details
Read (f p) => Read (M1 i c f p) Source # 
Instance details

Methods

readsPrec :: Int -> ReadS (M1 i c f p) Source #

readList :: ReadS [M1 i c f p] Source #

readPrec :: ReadPrec (M1 i c f p) Source #

readListPrec :: ReadPrec [M1 i c f p] Source #

Read (f (g p)) => Read ((f :.: g) p) Source # 
Instance details

Methods

readsPrec :: Int -> ReadS ((f :.: g) p) Source #

readList :: ReadS [(f :.: g) p] Source #

readPrec :: ReadPrec ((f :.: g) p) Source #

readListPrec :: ReadPrec [(f :.: g) p] Source #

(Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e) Source #

readList :: ReadS [(a, b, c, d, e)] Source #

readPrec :: ReadPrec (a, b, c, d, e) Source #

readListPrec :: ReadPrec [(a, b, c, d, e)] Source #

(Read1 f, Read1 g, Read a) => Read (Compose f g a) Source #

Since: 4.9.0.0

Instance details
(Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f) Source #

readList :: ReadS [(a, b, c, d, e, f)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g) Source #

readList :: ReadS [(a, b, c, d, e, f, g)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h) => Read (a, b, c, d, e, f, g, h) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h) Source #

readList :: ReadS [(a, b, c, d, e, f, g, h)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g, h) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i) => Read (a, b, c, d, e, f, g, h, i) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i) Source #

readList :: ReadS [(a, b, c, d, e, f, g, h, i)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j) => Read (a, b, c, d, e, f, g, h, i, j) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j) Source #

readList :: ReadS [(a, b, c, d, e, f, g, h, i, j)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k) => Read (a, b, c, d, e, f, g, h, i, j, k) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k) Source #

readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l) => Read (a, b, c, d, e, f, g, h, i, j, k, l) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l) Source #

readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] Source #

(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n, Read o) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

Since: 2.1

Instance details

Methods

readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] Source #

readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Source #

readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] Source #

reads :: Read a => ReadS a Source #

equivalent to readsPrec with a precedence of 0.

readParen :: Bool -> ReadS a -> ReadS a Source #

readParen True p parses what p parses, but surrounded with parentheses.

readParen False p parses what p parses, but optionally surrounded with parentheses.

read :: Read a => String -> a Source #

The read function reads input from a string, which must be completely consumed by the input process. read fails with an error if the parse is unsuccessful, and it is therefore discouraged from being used in real applications. Use readMaybe or readEither for safe alternatives.

>>> read "123" :: Int
123
>>> read "hello" :: Int
*** Exception: Prelude.read: no parse

lex :: ReadS String Source #

The lex function reads a single lexeme from the input, discarding initial white space, and returning the characters that constitute the lexeme. If the input string contains only white space, lex returns a single successful `lexeme' consisting of the empty string. (Thus lex "" = [("","")].) If there is no legal lexeme at the beginning of the input string, lex fails (i.e. returns []).

This lexer is not completely faithful to the Haskell lexical syntax in the following respects:

  • Qualified names are not handled properly
  • Octal and hexadecimal numerics are not recognized as a single token
  • Comments are not treated properly

Basic Input and output

data IO a #

A value of type IO a is a computation which, when performed, does some I/O before returning a value of type a.

There is really only one way to "perform" an I/O action: bind it to Main.main in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the IO monad and called at some point, directly or indirectly, from Main.main.

IO is a monad, so IO actions can be combined using either the do-notation or the >> and >>= operations from the Monad class.

Instances
Monad IO Source #

Since: 2.1

Instance details

Methods

(>>=) :: IO a -> (a -> IO b) -> IO b Source #

(>>) :: IO a -> IO b -> IO b Source #

return :: a -> IO a Source #

fail :: String -> IO a Source #

Functor IO Source #

Since: 2.1

Instance details

Methods

fmap :: (a -> b) -> IO a -> IO b Source #

(<$) :: a -> IO b -> IO a Source #

MonadFix IO Source #

Since: 2.1

Instance details

Methods

mfix :: (a -> IO a) -> IO a Source #

MonadFail IO Source #

Since: 4.9.0.0

Instance details

Methods

fail :: String -> IO a Source #

Applicative IO Source #

Since: 2.1

Instance details

Methods

pure :: a -> IO a Source #

(<*>) :: IO (a -> b) -> IO a -> IO b Source #

liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c Source #

(*>) :: IO a -> IO b -> IO b Source #

(<*) :: IO a -> IO b -> IO a Source #

MonadPlus IO Source #

Since: 4.9.0.0

Instance details

Methods

mzero :: IO a Source #

mplus :: IO a -> IO a -> IO a Source #

Alternative IO Source #

Since: 4.9.0.0

Instance details

Methods

empty :: IO a Source #

(<|>) :: IO a -> IO a -> IO a Source #

some :: IO a -> IO [a] Source #

many :: IO a -> IO [a] Source #

MonadIO IO Source #

Since: 4.9.0.0

Instance details

Methods

liftIO :: IO a -> IO a Source #

Semigroup a => Semigroup (IO a) Source #

Since: 4.10.0.0

Instance details

Methods

(<>) :: IO a -> IO a -> IO a Source #

sconcat :: NonEmpty (IO a) -> IO a Source #

stimes :: Integral b => b -> IO a -> IO a Source #

Monoid a => Monoid (IO a) Source #

Since: 4.9.0.0

Instance details

Methods

mempty :: IO a Source #

mappend :: IO a -> IO a -> IO a Source #

mconcat :: [IO a] -> IO a Source #

a ~ () => HPrintfType (IO a) Source #

Since: 4.7.0.0

Instance details

Methods

hspr :: Handle -> String -> [UPrintf] -> IO a

a ~ () => PrintfType (IO a) Source #

Since: 4.7.0.0

Instance details

Methods

spr :: String -> [UPrintf] -> IO a

Simple I/O operations

Output functions

putChar :: Char -> IO () Source #

Write a character to the standard output device (same as hPutChar stdout).

putStr :: String -> IO () Source #

Write a string to the standard output device (same as hPutStr stdout).

putStrLn :: String -> IO () Source #

The same as putStr, but adds a newline character.

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]])

Input functions

getChar :: IO Char Source #

Read a character from the standard input device (same as hGetChar stdin).

getLine :: IO String Source #

Read a line from the standard input device (same as hGetLine stdin).

getContents :: IO String Source #

The getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin).

interact :: (String -> String) -> IO () Source #

The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.

Files

type FilePath = String Source #

File and directory names are values of type String, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.

readFile :: FilePath -> IO String Source #

The readFile function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with getContents.

writeFile :: FilePath -> String -> IO () Source #

The computation writeFile file str function writes the string str, to the file file.

appendFile :: FilePath -> String -> IO () Source #

The computation appendFile file str function appends the string str, to the file file.

Note that writeFile and appendFile write a literal string to a file. To write a value of any printable type, as with print, use the show function to convert the value to a string first.

main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])

readIO :: Read a => String -> IO a Source #

The readIO function is similar to read except that it signals parse failure to the IO monad instead of terminating the program.

readLn :: Read a => IO a Source #

The readLn function combines getLine and readIO.

Exception handling in the I/O monad

type IOError = IOException Source #

The Haskell 2010 type for exceptions in the IO monad. Any I/O operation may raise an IOError instead of returning a result. For a more general type of exception, including also those that arise in pure code, see Exception.

In Haskell 2010, this is an opaque type.

ioError :: IOError -> IO a Source #

Raise an IOError in the IO monad.

userError :: String -> IOError Source #

Construct an IOError value with a string describing the error. The fail method of the IO instance of the Monad class raises a userError, thus:

instance Monad IO where
  ...
  fail s = ioError (userError s)