Prelude

base-4.11.1.0: Basic libraries

Copyright | (c) The University of Glasgow 2001
License | BSD-style (see the file libraries/base/LICENSE)
Maintainer | libraries@haskell.org
Stability | stable
Portability | portable
Safe Haskell | Trustworthy
Language | Haskell2010

Prelude

Contents

- Standard types, classes and related functions
  - Basic data types
    - Tuples
  - Basic type classes
  - Numbers
    - Numeric types
    - Numeric type classes
    - Numeric functions
  - Semigroups and Monoids
  - Monads and functors
  - Folds and traversals
  - Miscellaneous functions
- List operations
  - Special folds
  - Building lists
    - Scans
    - Infinite lists
  - Sublists
  - Searching lists
  - Zipping and unzipping lists
  - Functions on strings
- Converting to and from `String`
  - Converting to `String`
  - Converting from `String`
- Basic Input and output
  - Simple I/O operations
    - Output functions
    - Input functions
    - Files
  - Exception handling in the I/O monad

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

- data Bool
  - = False
  - | True
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- not :: Bool -> Bool
- otherwise :: Bool
- data Maybe a
  - = Nothing
  - | Just a
- maybe :: b -> (a -> b) -> Maybe a -> b
- data Either a b
  - = Left a
  - | Right b
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- data Ordering
  - = LT
  - | EQ
  - | GT
- data Char
- type String = [Char]
- fst :: (a, b) -> a
- snd :: (a, b) -> b
- curry :: ((a, b) -> c) -> a -> b -> c
- uncurry :: (a -> b -> c) -> (a, b) -> c
- class Eq a where
- class Eq a => Ord a where
- class Enum a where
- class Bounded a where
- data Int
- data Integer
- data Float
- data Double
- type Rational = Ratio Integer
- data Word
- class Num a where
- class (Num a, Ord a) => Real a where
- class (Real a, Enum a) => Integral a where
- class Num a => Fractional a where
- class Fractional a => Floating a where
- class (Real a, Fractional a) => RealFrac a where
- class (RealFrac a, Floating a) => RealFloat a where
- subtract :: Num a => a -> a -> a
- even :: Integral a => a -> Bool
- odd :: Integral a => a -> Bool
- gcd :: Integral a => a -> a -> a
- lcm :: Integral a => a -> a -> a
- (^) :: (Num a, Integral b) => a -> b -> a
- (^^) :: (Fractional a, Integral b) => a -> b -> a
- fromIntegral :: (Integral a, Num b) => a -> b
- realToFrac :: (Real a, Fractional b) => a -> b
- class Semigroup a where
- class Semigroup a => Monoid a where
- class Functor f where
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- class Functor f => Applicative f where
- class Applicative m => Monad m where
- mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m ()
- sequence_ :: (Foldable t, Monad m) => t (m a) -> m ()
- (=<<) :: Monad m => (a -> m b) -> m a -> m b
- class Foldable t where
- class (Functor t, Foldable t) => Traversable t where
- id :: a -> a
- const :: a -> b -> a
- (.) :: (b -> c) -> (a -> b) -> a -> c
- flip :: (a -> b -> c) -> b -> a -> c
- ($) :: (a -> b) -> a -> b
- until :: (a -> Bool) -> (a -> a) -> a -> a
- asTypeOf :: a -> a -> a
- error :: forall (r :: RuntimeRep). forall (a :: TYPE r). HasCallStack => [Char] -> a
- errorWithoutStackTrace :: forall (r :: RuntimeRep). forall (a :: TYPE r). [Char] -> a
- undefined :: forall (r :: RuntimeRep). forall (a :: TYPE r). HasCallStack => a
- seq :: a -> b -> b
- ($!) :: (a -> b) -> a -> b
- map :: (a -> b) -> [a] -> [b]
- (++) :: [a] -> [a] -> [a]
- filter :: (a -> Bool) -> [a] -> [a]
- head :: [a] -> a
- last :: [a] -> a
- tail :: [a] -> [a]
- init :: [a] -> [a]
- null :: Foldable t => t a -> Bool
- length :: Foldable t => t a -> Int
- (!!) :: [a] -> Int -> a
- reverse :: [a] -> [a]
- and :: Foldable t => t Bool -> Bool
- or :: Foldable t => t Bool -> Bool
- any :: Foldable t => (a -> Bool) -> t a -> Bool
- all :: Foldable t => (a -> Bool) -> t a -> Bool
- concat :: Foldable t => t [a] -> [a]
- concatMap :: Foldable t => (a -> [b]) -> t a -> [b]
- scanl :: (b -> a -> b) -> b -> [a] -> [b]
- scanl1 :: (a -> a -> a) -> [a] -> [a]
- scanr :: (a -> b -> b) -> b -> [a] -> [b]
- scanr1 :: (a -> a -> a) -> [a] -> [a]
- iterate :: (a -> a) -> a -> [a]
- repeat :: a -> [a]
- replicate :: Int -> a -> [a]
- cycle :: [a] -> [a]
- take :: Int -> [a] -> [a]
- drop :: Int -> [a] -> [a]
- splitAt :: Int -> [a] -> ([a], [a])
- takeWhile :: (a -> Bool) -> [a] -> [a]
- dropWhile :: (a -> Bool) -> [a] -> [a]
- span :: (a -> Bool) -> [a] -> ([a], [a])
- break :: (a -> Bool) -> [a] -> ([a], [a])
- notElem :: (Foldable t, Eq a) => a -> t a -> Bool
- lookup :: Eq a => a -> [(a, b)] -> Maybe b
- zip :: [a] -> [b] -> [(a, b)]
- zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
- zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
- zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
- unzip :: [(a, b)] -> ([a], [b])
- unzip3 :: [(a, b, c)] -> ([a], [b], [c])
- lines :: String -> [String]
- words :: String -> [String]
- unlines :: [String] -> String
- unwords :: [String] -> String
- type ShowS = String -> String
- class Show a where
- shows :: Show a => a -> ShowS
- showChar :: Char -> ShowS
- showString :: String -> ShowS
- showParen :: Bool -> ShowS -> ShowS
- type ReadS a = String -> [(a, String)]
- class Read a where
- reads :: Read a => ReadS a
- readParen :: Bool -> ReadS a -> ReadS a
- read :: Read a => String -> a
- lex :: ReadS String
- data IO a
- putChar :: Char -> IO ()
- putStr :: String -> IO ()
- putStrLn :: String -> IO ()
- print :: Show a => a -> IO ()
- getChar :: IO Char
- getLine :: IO String
- getContents :: IO String
- interact :: (String -> String) -> IO ()
- type FilePath = String
- readFile :: FilePath -> IO String
- writeFile :: FilePath -> String -> IO ()
- appendFile :: FilePath -> String -> IO ()
- readIO :: Read a => String -> IO a
- readLn :: Read a => IO a
- type IOError = IOException
- ioError :: IOError -> IO a
- userError :: String -> IOError

# Standard types, classes and related functions

## Basic data types

data Bool Source #

Constructors

False |
True |

Instances

Bounded Bool # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Bool # maxBound :: Bool #
Enum Bool # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Bool -> Bool # pred :: Bool -> Bool # toEnum :: Int -> Bool # fromEnum :: Bool -> Int # enumFrom :: Bool -> [Bool] # enumFromThen :: Bool -> Bool -> [Bool] # enumFromTo :: Bool -> Bool -> [Bool] # enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] #
Eq Bool |
Instance details Defined in GHC.Classes Methods (==) :: Bool -> Bool -> Bool Source # (/=) :: Bool -> Bool -> Bool Source #
Data Bool # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Bool -> c Bool # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Bool # toConstr :: Bool -> Constr # dataTypeOf :: Bool -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Bool) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Bool) # gmapT :: (forall b. Data b => b -> b) -> Bool -> Bool # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Bool -> r # gmapQ :: (forall d. Data d => d -> u) -> Bool -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Bool -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Bool -> m Bool # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Bool -> m Bool #
Ord Bool |
Instance details Defined in GHC.Classes Methods compare :: Bool -> Bool -> Ordering Source # (<) :: Bool -> Bool -> Bool Source # (<=) :: Bool -> Bool -> Bool Source # (>) :: Bool -> Bool -> Bool Source # (>=) :: Bool -> Bool -> Bool Source # max :: Bool -> Bool -> Bool Source # min :: Bool -> Bool -> Bool Source #
Read Bool # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Bool # readList :: ReadS [Bool] # readPrec :: ReadPrec Bool # readListPrec :: ReadPrec [Bool] #
Show Bool # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Bool -> ShowS # show :: Bool -> String # showList :: [Bool] -> ShowS #
Ix Bool # | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Bool, Bool) -> [Bool] # index :: (Bool, Bool) -> Bool -> Int # unsafeIndex :: (Bool, Bool) -> Bool -> Int inRange :: (Bool, Bool) -> Bool -> Bool # rangeSize :: (Bool, Bool) -> Int # unsafeRangeSize :: (Bool, Bool) -> Int
Generic Bool # |
Instance details Defined in GHC.Generics Associated Types type Rep Bool :: * -> * # Methods from :: Bool -> Rep Bool x # to :: Rep Bool x -> Bool #
FiniteBits Bool # | Since: base-4.7.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Bool -> Int # countLeadingZeros :: Bool -> Int # countTrailingZeros :: Bool -> Int #
Bits Bool # | Interpret `Bool` as 1-bit bit-field Since: base-4.7.0.0
Instance details Defined in Data.Bits Methods (.&.) :: Bool -> Bool -> Bool # (.|.) :: Bool -> Bool -> Bool # xor :: Bool -> Bool -> Bool # complement :: Bool -> Bool # shift :: Bool -> Int -> Bool # rotate :: Bool -> Int -> Bool # zeroBits :: Bool # bit :: Int -> Bool # setBit :: Bool -> Int -> Bool # clearBit :: Bool -> Int -> Bool # complementBit :: Bool -> Int -> Bool # testBit :: Bool -> Int -> Bool # bitSizeMaybe :: Bool -> Maybe Int # bitSize :: Bool -> Int # isSigned :: Bool -> Bool # shiftL :: Bool -> Int -> Bool # unsafeShiftL :: Bool -> Int -> Bool # shiftR :: Bool -> Int -> Bool # unsafeShiftR :: Bool -> Int -> Bool # rotateL :: Bool -> Int -> Bool # rotateR :: Bool -> Int -> Bool # popCount :: Bool -> Int #
Storable Bool # | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Bool -> Int # alignment :: Bool -> Int # peekElemOff :: Ptr Bool -> Int -> IO Bool # pokeElemOff :: Ptr Bool -> Int -> Bool -> IO () # peekByteOff :: Ptr b -> Int -> IO Bool # pokeByteOff :: Ptr b -> Int -> Bool -> IO () # peek :: Ptr Bool -> IO Bool # poke :: Ptr Bool -> Bool -> IO () #
type Rep Bool # |
Instance details Defined in GHC.Generics 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 Source #

Boolean "and"

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

Boolean "or"

not :: Bool -> Bool Source #

Boolean "not"

otherwise :: Bool #

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

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

data Maybe a #

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

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

Constructors

Nothing |
Just a |

Instances

Monad Maybe # | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b # (>>) :: Maybe a -> Maybe b -> Maybe b # return :: a -> Maybe a # fail :: String -> Maybe a #
Functor Maybe # | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Maybe a -> Maybe b # (<$) :: a -> Maybe b -> Maybe a #
MonadFix Maybe # | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Maybe a) -> Maybe a #
MonadFail Maybe # | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> Maybe a #
Applicative Maybe # | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> Maybe a # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c # (*>) :: Maybe a -> Maybe b -> Maybe b # (<*) :: Maybe a -> Maybe b -> Maybe a #
Foldable Maybe # | Since: base-2.1
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # toList :: Maybe a -> [a] # null :: Maybe a -> Bool # length :: Maybe a -> Int # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # sum :: Num a => Maybe a -> a # product :: Num a => Maybe a -> a #
Traversable Maybe # | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) # sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) # mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) # sequence :: Monad m => Maybe (m a) -> m (Maybe a) #
MonadPlus Maybe # | Since: base-2.1
Instance details Defined in GHC.Base Methods mzero :: Maybe a # mplus :: Maybe a -> Maybe a -> Maybe a #
Alternative Maybe # | Since: base-2.1
Instance details Defined in GHC.Base Methods empty :: Maybe a # (<|>) :: Maybe a -> Maybe a -> Maybe a # some :: Maybe a -> Maybe [a] # many :: Maybe a -> Maybe [a] #
MonadZip Maybe # | Since: base-4.8.0.0
Instance details Defined in Control.Monad.Zip Methods mzip :: Maybe a -> Maybe b -> Maybe (a, b) # mzipWith :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c # munzip :: Maybe (a, b) -> (Maybe a, Maybe b) #
Show1 Maybe # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> Int -> Maybe a -> ShowS # liftShowList :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> [Maybe a] -> ShowS #
Read1 Maybe # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a) -> ReadS [a] -> Int -> ReadS (Maybe a) # liftReadList :: (Int -> ReadS a) -> ReadS [a] -> ReadS [Maybe a] # liftReadPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec (Maybe a) # liftReadListPrec :: ReadPrec a -> ReadPrec [a] -> ReadPrec [Maybe a] #
Ord1 Maybe # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a -> b -> Ordering) -> Maybe a -> Maybe b -> Ordering #
Eq1 Maybe # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a -> b -> Bool) -> Maybe a -> Maybe b -> Bool #
Eq a => Eq (Maybe a) # |
Instance details Defined in GHC.Base Methods (==) :: Maybe a -> Maybe a -> Bool Source # (/=) :: Maybe a -> Maybe a -> Bool Source #
Data a => Data (Maybe a) # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Maybe a -> c (Maybe a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Maybe a) # toConstr :: Maybe a -> Constr # dataTypeOf :: Maybe a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Maybe a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Maybe a)) # gmapT :: (forall b. Data b => b -> b) -> Maybe a -> Maybe a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Maybe a -> r # gmapQ :: (forall d. Data d => d -> u) -> Maybe a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Maybe a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Maybe a -> m (Maybe a) #
Ord a => Ord (Maybe a) # |
Instance details Defined in GHC.Base Methods compare :: Maybe a -> Maybe a -> Ordering Source # (<) :: Maybe a -> Maybe a -> Bool Source # (<=) :: Maybe a -> Maybe a -> Bool Source # (>) :: Maybe a -> Maybe a -> Bool Source # (>=) :: Maybe a -> Maybe a -> Bool Source # max :: Maybe a -> Maybe a -> Maybe a Source # min :: Maybe a -> Maybe a -> Maybe a Source #
Read a => Read (Maybe a) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Maybe a) # readList :: ReadS [Maybe a] # readPrec :: ReadPrec (Maybe a) # readListPrec :: ReadPrec [Maybe a] #
Show a => Show (Maybe a) # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Maybe a -> ShowS # show :: Maybe a -> String # showList :: [Maybe a] -> ShowS #
Generic (Maybe a) # |
Instance details Defined in GHC.Generics Associated Types type Rep (Maybe a) :: * -> * # Methods from :: Maybe a -> Rep (Maybe a) x # to :: Rep (Maybe a) x -> Maybe a #
Semigroup a => Semigroup (Maybe a) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Maybe a -> Maybe a -> Maybe a # sconcat :: NonEmpty (Maybe a) -> Maybe a # stimes :: Integral b => b -> Maybe a -> Maybe a #
Semigroup a => Monoid (Maybe a) # | Lift a semigroup into `Maybe` forming a `Monoid` according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup `S` may be turned into a monoid simply by adjoining an element `e` not in `S` and defining `e*e = e` and `e*s = s = s*e` for all `s ∈ S`." Since 4.11.0: constraint on inner `a` value generalised from `Monoid` to `Semigroup`. Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Maybe a # mappend :: Maybe a -> Maybe a -> Maybe a # mconcat :: [Maybe a] -> Maybe a #
Generic1 Maybe # |
Instance details Defined in GHC.Generics Associated Types type Rep1 Maybe :: k -> * # Methods from1 :: Maybe a -> Rep1 Maybe a # to1 :: Rep1 Maybe a -> Maybe a #
type Rep (Maybe a) # |
Instance details Defined in GHC.Generics 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 # |
Instance details Defined in GHC.Generics type Rep1 Maybe = 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) Par1))

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

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

#### Examples

Expand

Basic usage:

    >>> maybe False odd (Just 3)
    True

    >>> maybe False odd Nothing
    False

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

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

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

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

data Either a b #

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

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

#### Examples

Expand

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

    >>> 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 `Int`s.

    >>> :{
        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 # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> Int -> Either a b -> ShowS # liftShowList2 :: (Int -> a -> ShowS) -> ([a] -> ShowS) -> (Int -> b -> ShowS) -> ([b] -> ShowS) -> [Either a b] -> ShowS #
Read2 Either # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> Int -> ReadS (Either a b) # liftReadList2 :: (Int -> ReadS a) -> ReadS [a] -> (Int -> ReadS b) -> ReadS [b] -> ReadS [Either a b] # liftReadPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec (Either a b) # liftReadListPrec2 :: ReadPrec a -> ReadPrec [a] -> ReadPrec b -> ReadPrec [b] -> ReadPrec [Either a b] #
Ord2 Either # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare2 :: (a -> b -> Ordering) -> (c -> d -> Ordering) -> Either a c -> Either b d -> Ordering #
Eq2 Either # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq2 :: (a -> b -> Bool) -> (c -> d -> Bool) -> Either a c -> Either b d -> Bool #
Bifunctor Either # | Since: base-4.8.0.0
Instance details Defined in Data.Bifunctor Methods bimap :: (a -> b) -> (c -> d) -> Either a c -> Either b d # first :: (a -> b) -> Either a c -> Either b c # second :: (b -> c) -> Either a b -> Either a c #
Bifoldable Either # | Since: base-4.10.0.0
Instance details Defined in Data.Bifoldable Methods bifold :: Monoid m => Either m m -> m # bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> Either a b -> m # bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> Either a b -> c # bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> Either a b -> c #
Bitraversable Either # | Since: base-4.10.0.0
Instance details Defined in Data.Bitraversable Methods bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> Either a b -> f (Either c d) #
Monad (Either e) # | Since: base-4.4.0.0
Instance details Defined in Data.Either Methods (>>=) :: Either e a -> (a -> Either e b) -> Either e b # (>>) :: Either e a -> Either e b -> Either e b # return :: a -> Either e a # fail :: String -> Either e a #
Functor (Either a) # | Since: base-3.0
Instance details Defined in Data.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b # (<$) :: a0 -> Either a b -> Either a a0 #
MonadFix (Either e) # | Since: base-4.3.0.0
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> Either e a) -> Either e a #
Applicative (Either e) # | Since: base-3.0
Instance details Defined in Data.Either Methods pure :: a -> Either e a # (<*>) :: Either e (a -> b) -> Either e a -> Either e b # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c # (*>) :: Either e a -> Either e b -> Either e b # (<*) :: Either e a -> Either e b -> Either e a #
Foldable (Either a) # | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # null :: Either a a0 -> Bool # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # sum :: Num a0 => Either a a0 -> a0 # product :: Num a0 => Either a a0 -> a0 #
Traversable (Either a) # | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) # sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) # mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) # sequence :: Monad m => Either a (m a0) -> m (Either a a0) #
Show a => Show1 (Either a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftShowsPrec :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> Int -> Either a a0 -> ShowS # liftShowList :: (Int -> a0 -> ShowS) -> ([a0] -> ShowS) -> [Either a a0] -> ShowS #
Read a => Read1 (Either a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftReadsPrec :: (Int -> ReadS a0) -> ReadS [a0] -> Int -> ReadS (Either a a0) # liftReadList :: (Int -> ReadS a0) -> ReadS [a0] -> ReadS [Either a a0] # liftReadPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec (Either a a0) # liftReadListPrec :: ReadPrec a0 -> ReadPrec [a0] -> ReadPrec [Either a a0] #
Ord a => Ord1 (Either a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftCompare :: (a0 -> b -> Ordering) -> Either a a0 -> Either a b -> Ordering #
Eq a => Eq1 (Either a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Classes Methods liftEq :: (a0 -> b -> Bool) -> Either a a0 -> Either a b -> Bool #
Generic1 (Either a :: * -> *) # |
Instance details Defined in GHC.Generics Associated Types type Rep1 (Either a) :: k -> * # Methods from1 :: Either a a0 -> Rep1 (Either a) a0 # to1 :: Rep1 (Either a) a0 -> Either a a0 #
(Eq a, Eq b) => Eq (Either a b) # |
Instance details Defined in Data.Either Methods (==) :: Either a b -> Either a b -> Bool Source # (/=) :: Either a b -> Either a b -> Bool Source #
(Data a, Data b) => Data (Either a b) # | Since: base-4.0.0.0
Instance details Defined in Data.Data 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) # gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Either a b) # toConstr :: Either a b -> Constr # dataTypeOf :: Either a b -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Either a b)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Either a b)) # gmapT :: (forall b0. Data b0 => b0 -> b0) -> Either a b -> Either a b # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Either a b -> r # gmapQ :: (forall d. Data d => d -> u) -> Either a b -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Either a b -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Either a b -> m (Either a b) #
(Ord a, Ord b) => Ord (Either a b) # |
Instance details Defined in Data.Either Methods compare :: Either a b -> Either a b -> Ordering Source # (<) :: Either a b -> Either a b -> Bool Source # (<=) :: Either a b -> Either a b -> Bool Source # (>) :: Either a b -> Either a b -> Bool Source # (>=) :: Either a b -> Either a b -> Bool Source # max :: Either a b -> Either a b -> Either a b Source # min :: Either a b -> Either a b -> Either a b Source #
(Read a, Read b) => Read (Either a b) # |
Instance details Defined in Data.Either Methods readsPrec :: Int -> ReadS (Either a b) # readList :: ReadS [Either a b] # readPrec :: ReadPrec (Either a b) # readListPrec :: ReadPrec [Either a b] #
(Show a, Show b) => Show (Either a b) # |
Instance details Defined in Data.Either Methods showsPrec :: Int -> Either a b -> ShowS # show :: Either a b -> String # showList :: [Either a b] -> ShowS #
Generic (Either a b) # |
Instance details Defined in GHC.Generics Associated Types type Rep (Either a b) :: * -> * # Methods from :: Either a b -> Rep (Either a b) x # to :: Rep (Either a b) x -> Either a b #
Semigroup (Either a b) # | Since: base-4.9.0.0
Instance details Defined in Data.Either Methods (<>) :: Either a b -> Either a b -> Either a b # sconcat :: NonEmpty (Either a b) -> Either a b # stimes :: Integral b0 => b0 -> Either a b -> Either a b #
type Rep1 (Either a :: * -> *) # |
Instance details Defined in GHC.Generics type Rep1 (Either a :: * -> *) = D1 (MetaData "Either" "Data.Either" "base" False) (C1 (MetaCons "Left" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) :+: C1 (MetaCons "Right" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) Par1))
type Rep (Either a b) # |
Instance details Defined in GHC.Generics type Rep (Either a b) = D1 (MetaData "Either" "Data.Either" "base" False) (C1 (MetaCons "Left" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 a)) :+: C1 (MetaCons "Right" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 b)))

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

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

#### Examples

Expand

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

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

data Ordering Source #

Constructors

LT |
EQ |
GT |

Instances

Bounded Ordering # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Ordering # maxBound :: Ordering #
Enum Ordering # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Ordering -> Ordering # pred :: Ordering -> Ordering # toEnum :: Int -> Ordering # fromEnum :: Ordering -> Int # enumFrom :: Ordering -> [Ordering] # enumFromThen :: Ordering -> Ordering -> [Ordering] # enumFromTo :: Ordering -> Ordering -> [Ordering] # enumFromThenTo :: Ordering -> Ordering -> Ordering -> [Ordering] #
Eq Ordering |
Instance details Defined in GHC.Classes Methods (==) :: Ordering -> Ordering -> Bool Source # (/=) :: Ordering -> Ordering -> Bool Source #
Data Ordering # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Ordering -> c Ordering # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Ordering # toConstr :: Ordering -> Constr # dataTypeOf :: Ordering -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Ordering) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Ordering) # gmapT :: (forall b. Data b => b -> b) -> Ordering -> Ordering # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Ordering -> r # gmapQ :: (forall d. Data d => d -> u) -> Ordering -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Ordering -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Ordering -> m Ordering #
Ord Ordering |
Instance details Defined in GHC.Classes Methods compare :: Ordering -> Ordering -> Ordering Source # (<) :: Ordering -> Ordering -> Bool Source # (<=) :: Ordering -> Ordering -> Bool Source # (>) :: Ordering -> Ordering -> Bool Source # (>=) :: Ordering -> Ordering -> Bool Source # max :: Ordering -> Ordering -> Ordering Source # min :: Ordering -> Ordering -> Ordering Source #
Read Ordering # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Ordering # readList :: ReadS [Ordering] # readPrec :: ReadPrec Ordering # readListPrec :: ReadPrec [Ordering] #
Show Ordering # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Ordering -> ShowS # show :: Ordering -> String # showList :: [Ordering] -> ShowS #
Ix Ordering # | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Ordering, Ordering) -> [Ordering] # index :: (Ordering, Ordering) -> Ordering -> Int # unsafeIndex :: (Ordering, Ordering) -> Ordering -> Int inRange :: (Ordering, Ordering) -> Ordering -> Bool # rangeSize :: (Ordering, Ordering) -> Int # unsafeRangeSize :: (Ordering, Ordering) -> Int
Generic Ordering # |
Instance details Defined in GHC.Generics Associated Types type Rep Ordering :: * -> * # Methods from :: Ordering -> Rep Ordering x # to :: Rep Ordering x -> Ordering #
Semigroup Ordering # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Ordering -> Ordering -> Ordering # sconcat :: NonEmpty Ordering -> Ordering # stimes :: Integral b => b -> Ordering -> Ordering #
Monoid Ordering # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Ordering # mappend :: Ordering -> Ordering -> Ordering # mconcat :: [Ordering] -> Ordering #
type Rep Ordering # |
Instance details Defined in GHC.Generics 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 Source #

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

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

Instances

Bounded Char # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Char # maxBound :: Char #
Enum Char # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Char -> Char # pred :: Char -> Char # toEnum :: Int -> Char # fromEnum :: Char -> Int # enumFrom :: Char -> [Char] # enumFromThen :: Char -> Char -> [Char] # enumFromTo :: Char -> Char -> [Char] # enumFromThenTo :: Char -> Char -> Char -> [Char] #
Eq Char |
Instance details Defined in GHC.Classes Methods (==) :: Char -> Char -> Bool Source # (/=) :: Char -> Char -> Bool Source #
Data Char # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Char -> c Char # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Char # toConstr :: Char -> Constr # dataTypeOf :: Char -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Char) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Char) # gmapT :: (forall b. Data b => b -> b) -> Char -> Char # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Char -> r # gmapQ :: (forall d. Data d => d -> u) -> Char -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Char -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Char -> m Char # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Char -> m Char #
Ord Char |
Instance details Defined in GHC.Classes Methods compare :: Char -> Char -> Ordering Source # (<) :: Char -> Char -> Bool Source # (<=) :: Char -> Char -> Bool Source # (>) :: Char -> Char -> Bool Source # (>=) :: Char -> Char -> Bool Source # max :: Char -> Char -> Char Source # min :: Char -> Char -> Char Source #
Read Char # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Char # readList :: ReadS [Char] # readPrec :: ReadPrec Char # readListPrec :: ReadPrec [Char] #
Show Char # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Char -> ShowS # show :: Char -> String # showList :: [Char] -> ShowS #
Ix Char # | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Char, Char) -> [Char] # index :: (Char, Char) -> Char -> Int # unsafeIndex :: (Char, Char) -> Char -> Int inRange :: (Char, Char) -> Char -> Bool # rangeSize :: (Char, Char) -> Int # unsafeRangeSize :: (Char, Char) -> Int
Storable Char # | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Char -> Int # alignment :: Char -> Int # peekElemOff :: Ptr Char -> Int -> IO Char # pokeElemOff :: Ptr Char -> Int -> Char -> IO () # peekByteOff :: Ptr b -> Int -> IO Char # pokeByteOff :: Ptr b -> Int -> Char -> IO () # peek :: Ptr Char -> IO Char # poke :: Ptr Char -> Char -> IO () #
IsChar Char # | Since: base-2.1
Instance details Defined in Text.Printf Methods toChar :: Char -> Char # fromChar :: Char -> Char #
PrintfArg Char # | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Char -> FieldFormatter # parseFormat :: Char -> ModifierParser #
Generic1 (URec Char :: k -> *) # |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Char) :: k -> * # Methods from1 :: URec Char a -> Rep1 (URec Char) a # to1 :: Rep1 (URec Char) a -> URec Char a #
Functor (URec Char :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Char a -> URec Char b # (<$) :: a -> URec Char b -> URec Char a #
Foldable (URec Char :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Char m -> m # foldMap :: Monoid m => (a -> m) -> URec Char a -> m # foldr :: (a -> b -> b) -> b -> URec Char a -> b # foldr' :: (a -> b -> b) -> b -> URec Char a -> b # foldl :: (b -> a -> b) -> b -> URec Char a -> b # foldl' :: (b -> a -> b) -> b -> URec Char a -> b # foldr1 :: (a -> a -> a) -> URec Char a -> a # foldl1 :: (a -> a -> a) -> URec Char a -> a # toList :: URec Char a -> [a] # null :: URec Char a -> Bool # length :: URec Char a -> Int # elem :: Eq a => a -> URec Char a -> Bool # maximum :: Ord a => URec Char a -> a # minimum :: Ord a => URec Char a -> a # sum :: Num a => URec Char a -> a # product :: Num a => URec Char a -> a #
Traversable (URec Char :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) # sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) # mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) # sequence :: Monad m => URec Char (m a) -> m (URec Char a) #
Eq (URec Char p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Char p -> URec Char p -> Bool Source # (/=) :: URec Char p -> URec Char p -> Bool Source #
Ord (URec Char p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Char p -> URec Char p -> Ordering Source # (<) :: URec Char p -> URec Char p -> Bool Source # (<=) :: URec Char p -> URec Char p -> Bool Source # (>) :: URec Char p -> URec Char p -> Bool Source # (>=) :: URec Char p -> URec Char p -> Bool Source # max :: URec Char p -> URec Char p -> URec Char p Source # min :: URec Char p -> URec Char p -> URec Char p Source #
Show (URec Char p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Char p -> ShowS # show :: URec Char p -> String # showList :: [URec Char p] -> ShowS #
Generic (URec Char p) # |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Char p) :: * -> * # Methods from :: URec Char p -> Rep (URec Char p) x # to :: Rep (URec Char p) x -> URec Char p #
data URec Char (p :: k) # | Used for marking occurrences of `Char#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Char (p :: k) = UChar { uChar# :: Char# }
type Rep1 (URec Char :: k -> *) # |
Instance details Defined in GHC.Generics 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) # |
Instance details Defined in GHC.Generics type Rep (URec Char p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UChar" PrefixI True) (S1 (MetaSel (Just "uChar#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UChar :: * -> *)))

type String = [Char] #

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

### Tuples

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

Extract the first component of a pair.

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

Extract the second component of a pair.

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

`curry` converts an uncurried function to a curried function.

#### Examples

Expand

    >>> curry fst 1 2
    1

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

`uncurry` converts a curried function to a function on pairs.

#### Examples

Expand

    >>> uncurry (+) (1,2)
    3

    >>> uncurry ($) (show, 1)
    "1"

    >>> map (uncurry max) [(1,2), (3,4), (6,8)]
    [2,4,8]

## Basic type classes

class Eq a where Source #

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

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

Instances

Eq Bool |
Instance details Defined in GHC.Classes Methods (==) :: Bool -> Bool -> Bool Source # (/=) :: Bool -> Bool -> Bool Source #
Eq Char |
Instance details Defined in GHC.Classes Methods (==) :: Char -> Char -> Bool Source # (/=) :: Char -> Char -> Bool Source #
Eq Double |
Instance details Defined in GHC.Classes Methods (==) :: Double -> Double -> Bool Source # (/=) :: Double -> Double -> Bool Source #
Eq Float |
Instance details Defined in GHC.Classes Methods (==) :: Float -> Float -> Bool Source # (/=) :: Float -> Float -> Bool Source #
Eq Int |
Instance details Defined in GHC.Classes Methods (==) :: Int -> Int -> Bool Source # (/=) :: Int -> Int -> Bool Source #
Eq Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int8 -> Int8 -> Bool Source # (/=) :: Int8 -> Int8 -> Bool Source #
Eq Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int16 -> Int16 -> Bool Source # (/=) :: Int16 -> Int16 -> Bool Source #
Eq Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int32 -> Int32 -> Bool Source # (/=) :: Int32 -> Int32 -> Bool Source #
Eq Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods (==) :: Int64 -> Int64 -> Bool Source # (/=) :: Int64 -> Int64 -> Bool Source #
Eq Integer |
Instance details Defined in GHC.Integer.Type Methods (==) :: Integer -> Integer -> Bool Source # (/=) :: Integer -> Integer -> Bool Source #
Eq Natural # |
Instance details Defined in GHC.Natural Methods (==) :: Natural -> Natural -> Bool Source # (/=) :: Natural -> Natural -> Bool Source #
Eq Ordering |
Instance details Defined in GHC.Classes Methods (==) :: Ordering -> Ordering -> Bool Source # (/=) :: Ordering -> Ordering -> Bool Source #
Eq Word |
Instance details Defined in GHC.Classes Methods (==) :: Word -> Word -> Bool Source # (/=) :: Word -> Word -> Bool Source #
Eq Word8 # | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word8 -> Word8 -> Bool Source # (/=) :: Word8 -> Word8 -> Bool Source #
Eq Word16 # | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word16 -> Word16 -> Bool Source # (/=) :: Word16 -> Word16 -> Bool Source #
Eq Word32 # | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word32 -> Word32 -> Bool Source # (/=) :: Word32 -> Word32 -> Bool Source #
Eq Word64 # | Since: base-2.1
Instance details Defined in GHC.Word Methods (==) :: Word64 -> Word64 -> Bool Source # (/=) :: Word64 -> Word64 -> Bool Source #
Eq SomeTypeRep # |
Instance details Defined in Data.Typeable.Internal Methods (==) :: SomeTypeRep -> SomeTypeRep -> Bool Source # (/=) :: SomeTypeRep -> SomeTypeRep -> Bool Source #
Eq () |
Instance details Defined in GHC.Classes Methods (==) :: () -> () -> Bool Source # (/=) :: () -> () -> Bool Source #
Eq TyCon |
Instance details Defined in GHC.Classes Methods (==) :: TyCon -> TyCon -> Bool Source # (/=) :: TyCon -> TyCon -> Bool Source #
Eq Module |
Instance details Defined in GHC.Classes Methods (==) :: Module -> Module -> Bool Source # (/=) :: Module -> Module -> Bool Source #
Eq TrName |
Instance details Defined in GHC.Classes Methods (==) :: TrName -> TrName -> Bool Source # (/=) :: TrName -> TrName -> Bool Source #
Eq BigNat |
Instance details Defined in GHC.Integer.Type Methods (==) :: BigNat -> BigNat -> Bool Source # (/=) :: BigNat -> BigNat -> Bool Source #
Eq SrcLoc # |
Instance details Defined in GHC.Stack.Types Methods (==) :: SrcLoc -> SrcLoc -> Bool Source # (/=) :: SrcLoc -> SrcLoc -> Bool Source #
Eq GeneralCategory # |
Instance details Defined in GHC.Unicode Methods (==) :: GeneralCategory -> GeneralCategory -> Bool Source # (/=) :: GeneralCategory -> GeneralCategory -> Bool Source #
Eq Number # |
Instance details Defined in Text.Read.Lex Methods (==) :: Number -> Number -> Bool Source # (/=) :: Number -> Number -> Bool Source #
Eq Lexeme # |
Instance details Defined in Text.Read.Lex Methods (==) :: Lexeme -> Lexeme -> Bool Source # (/=) :: Lexeme -> Lexeme -> Bool Source #
Eq Fingerprint # |
Instance details Defined in GHC.Fingerprint.Type Methods (==) :: Fingerprint -> Fingerprint -> Bool Source # (/=) :: Fingerprint -> Fingerprint -> Bool Source #
Eq IOMode # |
Instance details Defined in GHC.IO.IOMode Methods (==) :: IOMode -> IOMode -> Bool Source # (/=) :: IOMode -> IOMode -> Bool Source #
Eq IntPtr # |
Instance details Defined in Foreign.Ptr Methods (==) :: IntPtr -> IntPtr -> Bool Source # (/=) :: IntPtr -> IntPtr -> Bool Source #
Eq WordPtr # |
Instance details Defined in Foreign.Ptr Methods (==) :: WordPtr -> WordPtr -> Bool Source # (/=) :: WordPtr -> WordPtr -> Bool Source #
Eq CUIntMax # |
Instance details Defined in Foreign.C.Types Methods (==) :: CUIntMax -> CUIntMax -> Bool Source # (/=) :: CUIntMax -> CUIntMax -> Bool Source #
Eq CIntMax # |
Instance details Defined in Foreign.C.Types Methods (==) :: CIntMax -> CIntMax -> Bool Source # (/=) :: CIntMax -> CIntMax -> Bool Source #
Eq CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods (==) :: CUIntPtr -> CUIntPtr -> Bool Source # (/=) :: CUIntPtr -> CUIntPtr -> Bool Source #
Eq CIntPtr # |
Instance details Defined in Foreign.C.Types Methods (==) :: CIntPtr -> CIntPtr -> Bool Source # (/=) :: CIntPtr -> CIntPtr -> Bool Source #
Eq CSUSeconds # |
Instance details Defined in Foreign.C.Types Methods (==) :: CSUSeconds -> CSUSeconds -> Bool Source # (/=) :: CSUSeconds -> CSUSeconds -> Bool Source #
Eq CUSeconds # |
Instance details Defined in Foreign.C.Types Methods (==) :: CUSeconds -> CUSeconds -> Bool Source # (/=) :: CUSeconds -> CUSeconds -> Bool Source #
Eq CTime # |
Instance details Defined in Foreign.C.Types Methods (==) :: CTime -> CTime -> Bool Source # (/=) :: CTime -> CTime -> Bool Source #
Eq CClock # |
Instance details Defined in Foreign.C.Types Methods (==) :: CClock -> CClock -> Bool Source # (/=) :: CClock -> CClock -> Bool Source #
Eq CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods (==) :: CSigAtomic -> CSigAtomic -> Bool Source # (/=) :: CSigAtomic -> CSigAtomic -> Bool Source #
Eq CWchar # |
Instance details Defined in Foreign.C.Types Methods (==) :: CWchar -> CWchar -> Bool Source # (/=) :: CWchar -> CWchar -> Bool Source #
Eq CSize # |
Instance details Defined in Foreign.C.Types Methods (==) :: CSize -> CSize -> Bool Source # (/=) :: CSize -> CSize -> Bool Source #
Eq CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods (==) :: CPtrdiff -> CPtrdiff -> Bool Source # (/=) :: CPtrdiff -> CPtrdiff -> Bool Source #
Eq CDouble # |
Instance details Defined in Foreign.C.Types Methods (==) :: CDouble -> CDouble -> Bool Source # (/=) :: CDouble -> CDouble -> Bool Source #
Eq CFloat # |
Instance details Defined in Foreign.C.Types Methods (==) :: CFloat -> CFloat -> Bool Source # (/=) :: CFloat -> CFloat -> Bool Source #
Eq CBool # |
Instance details Defined in Foreign.C.Types Methods (==) :: CBool -> CBool -> Bool Source # (/=) :: CBool -> CBool -> Bool Source #
Eq CULLong # |
Instance details Defined in Foreign.C.Types Methods (==) :: CULLong -> CULLong -> Bool Source # (/=) :: CULLong -> CULLong -> Bool Source #
Eq CLLong # |
Instance details Defined in Foreign.C.Types Methods (==) :: CLLong -> CLLong -> Bool Source # (/=) :: CLLong -> CLLong -> Bool Source #
Eq CULong # |
Instance details Defined in Foreign.C.Types Methods (==) :: CULong -> CULong -> Bool Source # (/=) :: CULong -> CULong -> Bool Source #
Eq CLong # |
Instance details Defined in Foreign.C.Types Methods (==) :: CLong -> CLong -> Bool Source # (/=) :: CLong -> CLong -> Bool Source #
Eq CUInt # |
Instance details Defined in Foreign.C.Types Methods (==) :: CUInt -> CUInt -> Bool Source # (/=) :: CUInt -> CUInt -> Bool Source #
Eq CInt # |
Instance details Defined in Foreign.C.Types Methods (==) :: CInt -> CInt -> Bool Source # (/=) :: CInt -> CInt -> Bool Source #
Eq CUShort # |
Instance details Defined in Foreign.C.Types Methods (==) :: CUShort -> CUShort -> Bool Source # (/=) :: CUShort -> CUShort -> Bool Source #
Eq CShort # |
Instance details Defined in Foreign.C.Types Methods (==) :: CShort -> CShort -> Bool Source # (/=) :: CShort -> CShort -> Bool Source #
Eq CUChar # |
Instance details Defined in Foreign.C.Types Methods (==) :: CUChar -> CUChar -> Bool Source # (/=) :: CUChar -> CUChar -> Bool Source #
Eq CSChar # |
Instance details Defined in Foreign.C.Types Methods (==) :: CSChar -> CSChar -> Bool Source # (/=) :: CSChar -> CSChar -> Bool Source #
Eq CChar # |
Instance details Defined in Foreign.C.Types Methods (==) :: CChar -> CChar -> Bool Source # (/=) :: CChar -> CChar -> Bool Source #
Eq SomeNat # | Since: base-4.7.0.0
Instance details Defined in GHC.TypeNats Methods (==) :: SomeNat -> SomeNat -> Bool Source # (/=) :: SomeNat -> SomeNat -> Bool Source #
Eq SomeSymbol # | Since: base-4.7.0.0
Instance details Defined in GHC.TypeLits Methods (==) :: SomeSymbol -> SomeSymbol -> Bool Source # (/=) :: SomeSymbol -> SomeSymbol -> Bool Source #
Eq DecidedStrictness # |
Instance details Defined in GHC.Generics Methods (==) :: DecidedStrictness -> DecidedStrictness -> Bool Source # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool Source #
Eq SourceStrictness # |
Instance details Defined in GHC.Generics Methods (==) :: SourceStrictness -> SourceStrictness -> Bool Source # (/=) :: SourceStrictness -> SourceStrictness -> Bool Source #
Eq SourceUnpackedness # |
Instance details Defined in GHC.Generics Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source #
Eq Associativity # |
Instance details Defined in GHC.Generics Methods (==) :: Associativity -> Associativity -> Bool Source # (/=) :: Associativity -> Associativity -> Bool Source #
Eq Fixity # |
Instance details Defined in GHC.Generics Methods (==) :: Fixity -> Fixity -> Bool Source # (/=) :: Fixity -> Fixity -> Bool Source #
Eq Any # |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Any -> Any -> Bool Source # (/=) :: Any -> Any -> Bool Source #
Eq All # |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: All -> All -> Bool Source # (/=) :: All -> All -> Bool Source #
Eq ArithException # |
Instance details Defined in GHC.Exception Methods (==) :: ArithException -> ArithException -> Bool Source # (/=) :: ArithException -> ArithException -> Bool Source #
Eq ErrorCall # |
Instance details Defined in GHC.Exception Methods (==) :: ErrorCall -> ErrorCall -> Bool Source # (/=) :: ErrorCall -> ErrorCall -> Bool Source #
Eq IOException # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods (==) :: IOException -> IOException -> Bool Source # (/=) :: IOException -> IOException -> Bool Source #
Eq MaskingState # |
Instance details Defined in GHC.IO Methods (==) :: MaskingState -> MaskingState -> Bool Source # (/=) :: MaskingState -> MaskingState -> Bool Source #
Eq BufferState # |
Instance details Defined in GHC.IO.Buffer Methods (==) :: BufferState -> BufferState -> Bool Source # (/=) :: BufferState -> BufferState -> Bool Source #
Eq CodingProgress # |
Instance details Defined in GHC.IO.Encoding.Types Methods (==) :: CodingProgress -> CodingProgress -> Bool Source # (/=) :: CodingProgress -> CodingProgress -> Bool Source #
Eq SeekMode # |
Instance details Defined in GHC.IO.Device Methods (==) :: SeekMode -> SeekMode -> Bool Source # (/=) :: SeekMode -> SeekMode -> Bool Source #
Eq IODeviceType # |
Instance details Defined in GHC.IO.Device Methods (==) :: IODeviceType -> IODeviceType -> Bool Source # (/=) :: IODeviceType -> IODeviceType -> Bool Source #
Eq NewlineMode # |
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: NewlineMode -> NewlineMode -> Bool Source # (/=) :: NewlineMode -> NewlineMode -> Bool Source #
Eq Newline # |
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: Newline -> Newline -> Bool Source # (/=) :: Newline -> Newline -> Bool Source #
Eq BufferMode # |
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: BufferMode -> BufferMode -> Bool Source # (/=) :: BufferMode -> BufferMode -> Bool Source #
Eq Handle # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods (==) :: Handle -> Handle -> Bool Source # (/=) :: Handle -> Handle -> Bool Source #
Eq IOErrorType # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods (==) :: IOErrorType -> IOErrorType -> Bool Source # (/=) :: IOErrorType -> IOErrorType -> Bool Source #
Eq ExitCode # |
Instance details Defined in GHC.IO.Exception Methods (==) :: ExitCode -> ExitCode -> Bool Source # (/=) :: ExitCode -> ExitCode -> Bool Source #
Eq ArrayException # |
Instance details Defined in GHC.IO.Exception Methods (==) :: ArrayException -> ArrayException -> Bool Source # (/=) :: ArrayException -> ArrayException -> Bool Source #
Eq AsyncException # |
Instance details Defined in GHC.IO.Exception Methods (==) :: AsyncException -> AsyncException -> Bool Source # (/=) :: AsyncException -> AsyncException -> Bool Source #
Eq Errno # | Since: base-2.1
Instance details Defined in Foreign.C.Error Methods (==) :: Errno -> Errno -> Bool Source # (/=) :: Errno -> Errno -> Bool Source #
Eq Fd # |
Instance details Defined in System.Posix.Types Methods (==) :: Fd -> Fd -> Bool Source # (/=) :: Fd -> Fd -> Bool Source #
Eq CTimer # |
Instance details Defined in System.Posix.Types Methods (==) :: CTimer -> CTimer -> Bool Source # (/=) :: CTimer -> CTimer -> Bool Source #
Eq CKey # |
Instance details Defined in System.Posix.Types Methods (==) :: CKey -> CKey -> Bool Source # (/=) :: CKey -> CKey -> Bool Source #
Eq CId # |
Instance details Defined in System.Posix.Types Methods (==) :: CId -> CId -> Bool Source # (/=) :: CId -> CId -> Bool Source #
Eq CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods (==) :: CFsFilCnt -> CFsFilCnt -> Bool Source # (/=) :: CFsFilCnt -> CFsFilCnt -> Bool Source #
Eq CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods (==) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source # (/=) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source #
Eq CClockId # |
Instance details Defined in System.Posix.Types Methods (==) :: CClockId -> CClockId -> Bool Source # (/=) :: CClockId -> CClockId -> Bool Source #
Eq CBlkCnt # |
Instance details Defined in System.Posix.Types Methods (==) :: CBlkCnt -> CBlkCnt -> Bool Source # (/=) :: CBlkCnt -> CBlkCnt -> Bool Source #
Eq CBlkSize # |
Instance details Defined in System.Posix.Types Methods (==) :: CBlkSize -> CBlkSize -> Bool Source # (/=) :: CBlkSize -> CBlkSize -> Bool Source #
Eq CRLim # |
Instance details Defined in System.Posix.Types Methods (==) :: CRLim -> CRLim -> Bool Source # (/=) :: CRLim -> CRLim -> Bool Source #
Eq CTcflag # |
Instance details Defined in System.Posix.Types Methods (==) :: CTcflag -> CTcflag -> Bool Source # (/=) :: CTcflag -> CTcflag -> Bool Source #
Eq CSpeed # |
Instance details Defined in System.Posix.Types Methods (==) :: CSpeed -> CSpeed -> Bool Source # (/=) :: CSpeed -> CSpeed -> Bool Source #
Eq CCc # |
Instance details Defined in System.Posix.Types Methods (==) :: CCc -> CCc -> Bool Source # (/=) :: CCc -> CCc -> Bool Source #
Eq CUid # |
Instance details Defined in System.Posix.Types Methods (==) :: CUid -> CUid -> Bool Source # (/=) :: CUid -> CUid -> Bool Source #
Eq CNlink # |
Instance details Defined in System.Posix.Types Methods (==) :: CNlink -> CNlink -> Bool Source # (/=) :: CNlink -> CNlink -> Bool Source #
Eq CGid # |
Instance details Defined in System.Posix.Types Methods (==) :: CGid -> CGid -> Bool Source # (/=) :: CGid -> CGid -> Bool Source #
Eq CSsize # |
Instance details Defined in System.Posix.Types Methods (==) :: CSsize -> CSsize -> Bool Source # (/=) :: CSsize -> CSsize -> Bool Source #
Eq CPid # |
Instance details Defined in System.Posix.Types Methods (==) :: CPid -> CPid -> Bool Source # (/=) :: CPid -> CPid -> Bool Source #
Eq COff # |
Instance details Defined in System.Posix.Types Methods (==) :: COff -> COff -> Bool Source # (/=) :: COff -> COff -> Bool Source #
Eq CMode # |
Instance details Defined in System.Posix.Types Methods (==) :: CMode -> CMode -> Bool Source # (/=) :: CMode -> CMode -> Bool Source #
Eq CIno # |
Instance details Defined in System.Posix.Types Methods (==) :: CIno -> CIno -> Bool Source # (/=) :: CIno -> CIno -> Bool Source #
Eq CDev # |
Instance details Defined in System.Posix.Types Methods (==) :: CDev -> CDev -> Bool Source # (/=) :: CDev -> CDev -> Bool Source #
Eq Lifetime # |
Instance details Defined in GHC.Event.Internal Methods (==) :: Lifetime -> Lifetime -> Bool Source # (/=) :: Lifetime -> Lifetime -> Bool Source #
Eq Event # |
Instance details Defined in GHC.Event.Internal Methods (==) :: Event -> Event -> Bool Source # (/=) :: Event -> Event -> Bool Source #
Eq ThreadStatus # |
Instance details Defined in GHC.Conc.Sync Methods (==) :: ThreadStatus -> ThreadStatus -> Bool Source # (/=) :: ThreadStatus -> ThreadStatus -> Bool Source #
Eq BlockReason # |
Instance details Defined in GHC.Conc.Sync Methods (==) :: BlockReason -> BlockReason -> Bool Source # (/=) :: BlockReason -> BlockReason -> Bool Source #
Eq ThreadId # | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods (==) :: ThreadId -> ThreadId -> Bool Source # (/=) :: ThreadId -> ThreadId -> Bool Source #
Eq TimeoutKey # |
Instance details Defined in GHC.Event.TimerManager Methods (==) :: TimeoutKey -> TimeoutKey -> Bool Source # (/=) :: TimeoutKey -> TimeoutKey -> Bool Source #
Eq FdKey # |
Instance details Defined in GHC.Event.Manager Methods (==) :: FdKey -> FdKey -> Bool Source # (/=) :: FdKey -> FdKey -> Bool Source #
Eq HandlePosn # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle Methods (==) :: HandlePosn -> HandlePosn -> Bool Source # (/=) :: HandlePosn -> HandlePosn -> Bool Source #
Eq Version # | Since: base-2.1
Instance details Defined in Data.Version Methods (==) :: Version -> Version -> Bool Source # (/=) :: Version -> Version -> Bool Source #
Eq ByteOrder # |
Instance details Defined in GHC.ByteOrder Methods (==) :: ByteOrder -> ByteOrder -> Bool Source # (/=) :: ByteOrder -> ByteOrder -> Bool Source #
Eq Unique # |
Instance details Defined in Data.Unique Methods (==) :: Unique -> Unique -> Bool Source # (/=) :: Unique -> Unique -> Bool Source #
Eq Fixity # |
Instance details Defined in Data.Data Methods (==) :: Fixity -> Fixity -> Bool Source # (/=) :: Fixity -> Fixity -> Bool Source #
Eq ConstrRep # |
Instance details Defined in Data.Data Methods (==) :: ConstrRep -> ConstrRep -> Bool Source # (/=) :: ConstrRep -> ConstrRep -> Bool Source #
Eq DataRep # |
Instance details Defined in Data.Data Methods (==) :: DataRep -> DataRep -> Bool Source # (/=) :: DataRep -> DataRep -> Bool Source #
Eq Constr # | Equality of constructors Since: base-4.0.0.0
Instance details Defined in Data.Data Methods (==) :: Constr -> Constr -> Bool Source # (/=) :: Constr -> Constr -> Bool Source #
Eq SpecConstrAnnotation # |
Instance details Defined in GHC.Exts Methods (==) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool Source # (/=) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool Source #
Eq Void # | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods (==) :: Void -> Void -> Bool Source # (/=) :: Void -> Void -> Bool Source #
Eq a => Eq [a] |
Instance details Defined in GHC.Classes Methods (==) :: [a] -> [a] -> Bool Source # (/=) :: [a] -> [a] -> Bool Source #
Eq a => Eq (Maybe a) # |
Instance details Defined in GHC.Base Methods (==) :: Maybe a -> Maybe a -> Bool Source # (/=) :: Maybe a -> Maybe a -> Bool Source #
Eq a => Eq (Ratio a) # |
Instance details Defined in GHC.Real Methods (==) :: Ratio a -> Ratio a -> Bool Source # (/=) :: Ratio a -> Ratio a -> Bool Source #
Eq (StablePtr a) # | Since: base-2.1
Instance details Defined in GHC.Stable Methods (==) :: StablePtr a -> StablePtr a -> Bool Source # (/=) :: StablePtr a -> StablePtr a -> Bool Source #
Eq (Ptr a) # |
Instance details Defined in GHC.Ptr Methods (==) :: Ptr a -> Ptr a -> Bool Source # (/=) :: Ptr a -> Ptr a -> Bool Source #
Eq (FunPtr a) # |
Instance details Defined in GHC.Ptr Methods (==) :: FunPtr a -> FunPtr a -> Bool Source # (/=) :: FunPtr a -> FunPtr a -> Bool Source #
Eq p => Eq (Par1 p) # |
Instance details Defined in GHC.Generics Methods (==) :: Par1 p -> Par1 p -> Bool Source # (/=) :: Par1 p -> Par1 p -> Bool Source #
Eq a => Eq (NonEmpty a) # |
Instance details Defined in GHC.Base Methods (==) :: NonEmpty a -> NonEmpty a -> Bool Source # (/=) :: NonEmpty a -> NonEmpty a -> Bool Source #
Eq (MVar a) # | Since: base-4.1.0.0
Instance details Defined in GHC.MVar Methods (==) :: MVar a -> MVar a -> Bool Source # (/=) :: MVar a -> MVar a -> Bool Source #
Eq a => Eq (Down a) # |
Instance details Defined in Data.Ord Methods (==) :: Down a -> Down a -> Bool Source # (/=) :: Down a -> Down a -> Bool Source #
Eq a => Eq (Product a) # |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Product a -> Product a -> Bool Source # (/=) :: Product a -> Product a -> Bool Source #
Eq a => Eq (Sum a) # |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Sum a -> Sum a -> Bool Source # (/=) :: Sum a -> Sum a -> Bool Source #
Eq a => Eq (Dual a) # |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Dual a -> Dual a -> Bool Source # (/=) :: Dual a -> Dual a -> Bool Source #
Eq a => Eq (Last a) # |
Instance details Defined in Data.Monoid Methods (==) :: Last a -> Last a -> Bool Source # (/=) :: Last a -> Last a -> Bool Source #
Eq a => Eq (First a) # |
Instance details Defined in Data.Monoid Methods (==) :: First a -> First a -> Bool Source # (/=) :: First a -> First a -> Bool Source #
Eq (IORef a) # | Pointer equality. Since: base-4.1.0.0
Instance details Defined in GHC.IORef Methods (==) :: IORef a -> IORef a -> Bool Source # (/=) :: IORef a -> IORef a -> Bool Source #
Eq (ForeignPtr a) # | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods (==) :: ForeignPtr a -> ForeignPtr a -> Bool Source # (/=) :: ForeignPtr a -> ForeignPtr a -> Bool Source #
Eq (TVar a) # | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods (==) :: TVar a -> TVar a -> Bool Source # (/=) :: TVar a -> TVar a -> Bool Source #
Eq a => Eq (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods (==) :: Identity a -> Identity a -> Bool Source # (/=) :: Identity a -> Identity a -> Bool Source #
Eq a => Eq (ZipList a) # |
Instance details Defined in Control.Applicative Methods (==) :: ZipList a -> ZipList a -> Bool Source # (/=) :: ZipList a -> ZipList a -> Bool Source #
Eq (StableName a) # | Since: base-2.1
Instance details Defined in System.Mem.StableName Methods (==) :: StableName a -> StableName a -> Bool Source # (/=) :: StableName a -> StableName a -> Bool Source #
Eq (Chan a) # |
Instance details Defined in Control.Concurrent.Chan Methods (==) :: Chan a -> Chan a -> Bool Source # (/=) :: Chan a -> Chan a -> Bool Source #
Eq a => Eq (Option a) # |
Instance details Defined in Data.Semigroup Methods (==) :: Option a -> Option a -> Bool Source # (/=) :: Option a -> Option a -> Bool Source #
Eq m => Eq (WrappedMonoid m) # |
Instance details Defined in Data.Semigroup Methods (==) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # (/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source #
Eq a => Eq (Last a) # |
Instance details Defined in Data.Semigroup Methods (==) :: Last a -> Last a -> Bool Source # (/=) :: Last a -> Last a -> Bool Source #
Eq a => Eq (First a) # |
Instance details Defined in Data.Semigroup Methods (==) :: First a -> First a -> Bool Source # (/=) :: First a -> First a -> Bool Source #
Eq a => Eq (Max a) # |
Instance details Defined in Data.Semigroup Methods (==) :: Max a -> Max a -> Bool Source # (/=) :: Max a -> Max a -> Bool Source #
Eq a => Eq (Min a) # |
Instance details Defined in Data.Semigroup Methods (==) :: Min a -> Min a -> Bool Source # (/=) :: Min a -> Min a -> Bool Source #
Eq (Fixed a) # |
Instance details Defined in Data.Fixed Methods (==) :: Fixed a -> Fixed a -> Bool Source # (/=) :: Fixed a -> Fixed a -> Bool Source #
Eq a => Eq (Complex a) # |
Instance details Defined in Data.Complex Methods (==) :: Complex a -> Complex a -> Bool Source # (/=) :: Complex a -> Complex a -> Bool Source #
(Eq a, Eq b) => Eq (Either a b) # |
Instance details Defined in Data.Either Methods (==) :: Either a b -> Either a b -> Bool Source # (/=) :: Either a b -> Either a b -> Bool Source #
Eq (V1 p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (==) :: V1 p -> V1 p -> Bool Source # (/=) :: V1 p -> V1 p -> Bool Source #
Eq (U1 p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (==) :: U1 p -> U1 p -> Bool Source # (/=) :: U1 p -> U1 p -> Bool Source #
Eq (TypeRep a) # | Since: base-2.1
Instance details Defined in Data.Typeable.Internal Methods (==) :: TypeRep a -> TypeRep a -> Bool Source # (/=) :: TypeRep a -> TypeRep a -> Bool Source #
(Eq a, Eq b) => Eq (a, b) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b) -> (a, b) -> Bool Source # (/=) :: (a, b) -> (a, b) -> Bool Source #
Eq (STRef s a) # | Pointer equality. Since: base-2.1
Instance details Defined in GHC.STRef Methods (==) :: STRef s a -> STRef s a -> Bool Source # (/=) :: STRef s a -> STRef s a -> Bool Source #
Eq (Proxy s) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods (==) :: Proxy s -> Proxy s -> Bool Source # (/=) :: Proxy s -> Proxy s -> Bool Source #
Eq a => Eq (Arg a b) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (==) :: Arg a b -> Arg a b -> Bool Source # (/=) :: Arg a b -> Arg a b -> Bool Source #
Eq (f p) => Eq (Rec1 f p) # |
Instance details Defined in GHC.Generics Methods (==) :: Rec1 f p -> Rec1 f p -> Bool Source # (/=) :: Rec1 f p -> Rec1 f p -> Bool Source #
Eq (URec Word p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Word p -> URec Word p -> Bool Source # (/=) :: URec Word p -> URec Word p -> Bool Source #
Eq (URec Int p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Int p -> URec Int p -> Bool Source # (/=) :: URec Int p -> URec Int p -> Bool Source #
Eq (URec Float p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Float p -> URec Float p -> Bool Source # (/=) :: URec Float p -> URec Float p -> Bool Source #
Eq (URec Double p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Double p -> URec Double p -> Bool Source # (/=) :: URec Double p -> URec Double p -> Bool Source #
Eq (URec Char p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Char p -> URec Char p -> Bool Source # (/=) :: URec Char p -> URec Char p -> Bool Source #
Eq (URec (Ptr ()) p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # (/=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source #
(Eq a, Eq b, Eq c) => Eq (a, b, c) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c) -> (a, b, c) -> Bool Source # (/=) :: (a, b, c) -> (a, b, c) -> Bool Source #
Eq (a :~: b) # |
Instance details Defined in Data.Type.Equality Methods (==) :: (a :~: b) -> (a :~: b) -> Bool Source # (/=) :: (a :~: b) -> (a :~: b) -> Bool Source #
Eq (Coercion a b) # |
Instance details Defined in Data.Type.Coercion Methods (==) :: Coercion a b -> Coercion a b -> Bool Source # (/=) :: Coercion a b -> Coercion a b -> Bool Source #
Eq (f a) => Eq (Alt f a) # |
Instance details Defined in Data.Semigroup.Internal Methods (==) :: Alt f a -> Alt f a -> Bool Source # (/=) :: Alt f a -> Alt f a -> Bool Source #
Eq a => Eq (Const a b) # |
Instance details Defined in Data.Functor.Const Methods (==) :: Const a b -> Const a b -> Bool Source # (/=) :: Const a b -> Const a b -> Bool Source #
Eq c => Eq (K1 i c p) # |
Instance details Defined in GHC.Generics Methods (==) :: K1 i c p -> K1 i c p -> Bool Source # (/=) :: K1 i c p -> K1 i c p -> Bool Source #
(Eq (f p), Eq (g p)) => Eq ((f :+: g) p) # |
Instance details Defined in GHC.Generics Methods (==) :: (f :+: g) p -> (f :+: g) p -> Bool Source # (/=) :: (f :+: g) p -> (f :+: g) p -> Bool Source #
(Eq (f p), Eq (g p)) => Eq ((f :*: g) p) # |
Instance details Defined in GHC.Generics Methods (==) :: (f :*: g) p -> (f :*: g) p -> Bool Source # (/=) :: (f :*: g) p -> (f :*: g) p -> Bool Source #
(Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # (/=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source #
Eq (a :~~: b) # | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods (==) :: (a :~~: b) -> (a :~~: b) -> Bool Source # (/=) :: (a :~~: b) -> (a :~~: b) -> Bool Source #
(Eq1 f, Eq1 g, Eq a) => Eq (Sum f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods (==) :: Sum f g a -> Sum f g a -> Bool Source # (/=) :: Sum f g a -> Sum f g a -> Bool Source #
(Eq1 f, Eq1 g, Eq a) => Eq (Product f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods (==) :: Product f g a -> Product f g a -> Bool Source # (/=) :: Product f g a -> Product f g a -> Bool Source #
Eq (f p) => Eq (M1 i c f p) # |
Instance details Defined in GHC.Generics Methods (==) :: M1 i c f p -> M1 i c f p -> Bool Source # (/=) :: M1 i c f p -> M1 i c f p -> Bool Source #
Eq (f (g p)) => Eq ((f :.: g) p) # |
Instance details Defined in GHC.Generics Methods (==) :: (f :.: g) p -> (f :.: g) p -> Bool Source # (/=) :: (f :.: g) p -> (f :.: g) p -> Bool Source #
(Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # (/=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source #
(Eq1 f, Eq1 g, Eq a) => Eq (Compose f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods (==) :: Compose f g a -> Compose f g a -> Bool Source # (/=) :: Compose f g a -> Compose f g a -> Bool Source #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # (/=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source #
(Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) |
Instance details Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # (/=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source #
(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 Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # (/=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source #
(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 Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # (/=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source #
(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 Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # (/=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source #
(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 Defined in GHC.Classes Methods (==) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # (/=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source #
(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 Defined in GHC.Classes 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 Source # (/=) :: (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 Source #
(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 Defined in GHC.Classes 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 Source # (/=) :: (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 Source #
(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 Defined in GHC.Classes 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 Source # (/=) :: (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 Source #
(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 Defined in GHC.Classes 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 Source # (/=) :: (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 Source #

class Eq a => Ord a where Source #

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

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

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

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

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

max :: a -> a -> a Source #

min :: a -> a -> a Source #

Instances

Ord Bool |
Instance details Defined in GHC.Classes Methods compare :: Bool -> Bool -> Ordering Source # (<) :: Bool -> Bool -> Bool Source # (<=) :: Bool -> Bool -> Bool Source # (>) :: Bool -> Bool -> Bool Source # (>=) :: Bool -> Bool -> Bool Source # max :: Bool -> Bool -> Bool Source # min :: Bool -> Bool -> Bool Source #
Ord Char |
Instance details Defined in GHC.Classes Methods compare :: Char -> Char -> Ordering Source # (<) :: Char -> Char -> Bool Source # (<=) :: Char -> Char -> Bool Source # (>) :: Char -> Char -> Bool Source # (>=) :: Char -> Char -> Bool Source # max :: Char -> Char -> Char Source # min :: Char -> Char -> Char Source #
Ord Double |
Instance details Defined in GHC.Classes Methods compare :: Double -> Double -> Ordering Source # (<) :: Double -> Double -> Bool Source # (<=) :: Double -> Double -> Bool Source # (>) :: Double -> Double -> Bool Source # (>=) :: Double -> Double -> Bool Source # max :: Double -> Double -> Double Source # min :: Double -> Double -> Double Source #
Ord Float |
Instance details Defined in GHC.Classes Methods compare :: Float -> Float -> Ordering Source # (<) :: Float -> Float -> Bool Source # (<=) :: Float -> Float -> Bool Source # (>) :: Float -> Float -> Bool Source # (>=) :: Float -> Float -> Bool Source # max :: Float -> Float -> Float Source # min :: Float -> Float -> Float Source #
Ord Int |
Instance details Defined in GHC.Classes Methods compare :: Int -> Int -> Ordering Source # (<) :: Int -> Int -> Bool Source # (<=) :: Int -> Int -> Bool Source # (>) :: Int -> Int -> Bool Source # (>=) :: Int -> Int -> Bool Source # max :: Int -> Int -> Int Source # min :: Int -> Int -> Int Source #
Ord Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int8 -> Int8 -> Ordering Source # (<) :: Int8 -> Int8 -> Bool Source # (<=) :: Int8 -> Int8 -> Bool Source # (>) :: Int8 -> Int8 -> Bool Source # (>=) :: Int8 -> Int8 -> Bool Source # max :: Int8 -> Int8 -> Int8 Source # min :: Int8 -> Int8 -> Int8 Source #
Ord Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int16 -> Int16 -> Ordering Source # (<) :: Int16 -> Int16 -> Bool Source # (<=) :: Int16 -> Int16 -> Bool Source # (>) :: Int16 -> Int16 -> Bool Source # (>=) :: Int16 -> Int16 -> Bool Source # max :: Int16 -> Int16 -> Int16 Source # min :: Int16 -> Int16 -> Int16 Source #
Ord Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int32 -> Int32 -> Ordering Source # (<) :: Int32 -> Int32 -> Bool Source # (<=) :: Int32 -> Int32 -> Bool Source # (>) :: Int32 -> Int32 -> Bool Source # (>=) :: Int32 -> Int32 -> Bool Source # max :: Int32 -> Int32 -> Int32 Source # min :: Int32 -> Int32 -> Int32 Source #
Ord Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods compare :: Int64 -> Int64 -> Ordering Source # (<) :: Int64 -> Int64 -> Bool Source # (<=) :: Int64 -> Int64 -> Bool Source # (>) :: Int64 -> Int64 -> Bool Source # (>=) :: Int64 -> Int64 -> Bool Source # max :: Int64 -> Int64 -> Int64 Source # min :: Int64 -> Int64 -> Int64 Source #
Ord Integer |
Instance details Defined in GHC.Integer.Type Methods compare :: Integer -> Integer -> Ordering Source # (<) :: Integer -> Integer -> Bool Source # (<=) :: Integer -> Integer -> Bool Source # (>) :: Integer -> Integer -> Bool Source # (>=) :: Integer -> Integer -> Bool Source # max :: Integer -> Integer -> Integer Source # min :: Integer -> Integer -> Integer Source #
Ord Natural # |
Instance details Defined in GHC.Natural Methods compare :: Natural -> Natural -> Ordering Source # (<) :: Natural -> Natural -> Bool Source # (<=) :: Natural -> Natural -> Bool Source # (>) :: Natural -> Natural -> Bool Source # (>=) :: Natural -> Natural -> Bool Source # max :: Natural -> Natural -> Natural Source # min :: Natural -> Natural -> Natural Source #
Ord Ordering |
Instance details Defined in GHC.Classes Methods compare :: Ordering -> Ordering -> Ordering Source # (<) :: Ordering -> Ordering -> Bool Source # (<=) :: Ordering -> Ordering -> Bool Source # (>) :: Ordering -> Ordering -> Bool Source # (>=) :: Ordering -> Ordering -> Bool Source # max :: Ordering -> Ordering -> Ordering Source # min :: Ordering -> Ordering -> Ordering Source #
Ord Word |
Instance details Defined in GHC.Classes Methods compare :: Word -> Word -> Ordering Source # (<) :: Word -> Word -> Bool Source # (<=) :: Word -> Word -> Bool Source # (>) :: Word -> Word -> Bool Source # (>=) :: Word -> Word -> Bool Source # max :: Word -> Word -> Word Source # min :: Word -> Word -> Word Source #
Ord Word8 # | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word8 -> Word8 -> Ordering Source # (<) :: Word8 -> Word8 -> Bool Source # (<=) :: Word8 -> Word8 -> Bool Source # (>) :: Word8 -> Word8 -> Bool Source # (>=) :: Word8 -> Word8 -> Bool Source # max :: Word8 -> Word8 -> Word8 Source # min :: Word8 -> Word8 -> Word8 Source #
Ord Word16 # | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word16 -> Word16 -> Ordering Source # (<) :: Word16 -> Word16 -> Bool Source # (<=) :: Word16 -> Word16 -> Bool Source # (>) :: Word16 -> Word16 -> Bool Source # (>=) :: Word16 -> Word16 -> Bool Source # max :: Word16 -> Word16 -> Word16 Source # min :: Word16 -> Word16 -> Word16 Source #
Ord Word32 # | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word32 -> Word32 -> Ordering Source # (<) :: Word32 -> Word32 -> Bool Source # (<=) :: Word32 -> Word32 -> Bool Source # (>) :: Word32 -> Word32 -> Bool Source # (>=) :: Word32 -> Word32 -> Bool Source # max :: Word32 -> Word32 -> Word32 Source # min :: Word32 -> Word32 -> Word32 Source #
Ord Word64 # | Since: base-2.1
Instance details Defined in GHC.Word Methods compare :: Word64 -> Word64 -> Ordering Source # (<) :: Word64 -> Word64 -> Bool Source # (<=) :: Word64 -> Word64 -> Bool Source # (>) :: Word64 -> Word64 -> Bool Source # (>=) :: Word64 -> Word64 -> Bool Source # max :: Word64 -> Word64 -> Word64 Source # min :: Word64 -> Word64 -> Word64 Source #
Ord SomeTypeRep # |
Instance details Defined in Data.Typeable.Internal Methods compare :: SomeTypeRep -> SomeTypeRep -> Ordering Source # (<) :: SomeTypeRep -> SomeTypeRep -> Bool Source # (<=) :: SomeTypeRep -> SomeTypeRep -> Bool Source # (>) :: SomeTypeRep -> SomeTypeRep -> Bool Source # (>=) :: SomeTypeRep -> SomeTypeRep -> Bool Source # max :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep Source # min :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep Source #
Ord () |
Instance details Defined in GHC.Classes Methods compare :: () -> () -> Ordering Source # (<) :: () -> () -> Bool Source # (<=) :: () -> () -> Bool Source # (>) :: () -> () -> Bool Source # (>=) :: () -> () -> Bool Source # max :: () -> () -> () Source # min :: () -> () -> () Source #
Ord TyCon |
Instance details Defined in GHC.Classes Methods compare :: TyCon -> TyCon -> Ordering Source # (<) :: TyCon -> TyCon -> Bool Source # (<=) :: TyCon -> TyCon -> Bool Source # (>) :: TyCon -> TyCon -> Bool Source # (>=) :: TyCon -> TyCon -> Bool Source # max :: TyCon -> TyCon -> TyCon Source # min :: TyCon -> TyCon -> TyCon Source #
Ord BigNat |
Instance details Defined in GHC.Integer.Type Methods compare :: BigNat -> BigNat -> Ordering Source # (<) :: BigNat -> BigNat -> Bool Source # (<=) :: BigNat -> BigNat -> Bool Source # (>) :: BigNat -> BigNat -> Bool Source # (>=) :: BigNat -> BigNat -> Bool Source # max :: BigNat -> BigNat -> BigNat Source # min :: BigNat -> BigNat -> BigNat Source #
Ord GeneralCategory # |
Instance details Defined in GHC.Unicode Methods compare :: GeneralCategory -> GeneralCategory -> Ordering Source # (<) :: GeneralCategory -> GeneralCategory -> Bool Source # (<=) :: GeneralCategory -> GeneralCategory -> Bool Source # (>) :: GeneralCategory -> GeneralCategory -> Bool Source # (>=) :: GeneralCategory -> GeneralCategory -> Bool Source # max :: GeneralCategory -> GeneralCategory -> GeneralCategory Source # min :: GeneralCategory -> GeneralCategory -> GeneralCategory Source #
Ord Fingerprint # |
Instance details Defined in GHC.Fingerprint.Type Methods compare :: Fingerprint -> Fingerprint -> Ordering Source # (<) :: Fingerprint -> Fingerprint -> Bool Source # (<=) :: Fingerprint -> Fingerprint -> Bool Source # (>) :: Fingerprint -> Fingerprint -> Bool Source # (>=) :: Fingerprint -> Fingerprint -> Bool Source # max :: Fingerprint -> Fingerprint -> Fingerprint Source # min :: Fingerprint -> Fingerprint -> Fingerprint Source #
Ord IOMode # |
Instance details Defined in GHC.IO.IOMode Methods compare :: IOMode -> IOMode -> Ordering Source # (<) :: IOMode -> IOMode -> Bool Source # (<=) :: IOMode -> IOMode -> Bool Source # (>) :: IOMode -> IOMode -> Bool Source # (>=) :: IOMode -> IOMode -> Bool Source # max :: IOMode -> IOMode -> IOMode Source # min :: IOMode -> IOMode -> IOMode Source #
Ord IntPtr # |
Instance details Defined in Foreign.Ptr Methods compare :: IntPtr -> IntPtr -> Ordering Source # (<) :: IntPtr -> IntPtr -> Bool Source # (<=) :: IntPtr -> IntPtr -> Bool Source # (>) :: IntPtr -> IntPtr -> Bool Source # (>=) :: IntPtr -> IntPtr -> Bool Source # max :: IntPtr -> IntPtr -> IntPtr Source # min :: IntPtr -> IntPtr -> IntPtr Source #
Ord WordPtr # |
Instance details Defined in Foreign.Ptr Methods compare :: WordPtr -> WordPtr -> Ordering Source # (<) :: WordPtr -> WordPtr -> Bool Source # (<=) :: WordPtr -> WordPtr -> Bool Source # (>) :: WordPtr -> WordPtr -> Bool Source # (>=) :: WordPtr -> WordPtr -> Bool Source # max :: WordPtr -> WordPtr -> WordPtr Source # min :: WordPtr -> WordPtr -> WordPtr Source #
Ord CUIntMax # |
Instance details Defined in Foreign.C.Types Methods compare :: CUIntMax -> CUIntMax -> Ordering Source # (<) :: CUIntMax -> CUIntMax -> Bool Source # (<=) :: CUIntMax -> CUIntMax -> Bool Source # (>) :: CUIntMax -> CUIntMax -> Bool Source # (>=) :: CUIntMax -> CUIntMax -> Bool Source # max :: CUIntMax -> CUIntMax -> CUIntMax Source # min :: CUIntMax -> CUIntMax -> CUIntMax Source #
Ord CIntMax # |
Instance details Defined in Foreign.C.Types Methods compare :: CIntMax -> CIntMax -> Ordering Source # (<) :: CIntMax -> CIntMax -> Bool Source # (<=) :: CIntMax -> CIntMax -> Bool Source # (>) :: CIntMax -> CIntMax -> Bool Source # (>=) :: CIntMax -> CIntMax -> Bool Source # max :: CIntMax -> CIntMax -> CIntMax Source # min :: CIntMax -> CIntMax -> CIntMax Source #
Ord CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods compare :: CUIntPtr -> CUIntPtr -> Ordering Source # (<) :: CUIntPtr -> CUIntPtr -> Bool Source # (<=) :: CUIntPtr -> CUIntPtr -> Bool Source # (>) :: CUIntPtr -> CUIntPtr -> Bool Source # (>=) :: CUIntPtr -> CUIntPtr -> Bool Source # max :: CUIntPtr -> CUIntPtr -> CUIntPtr Source # min :: CUIntPtr -> CUIntPtr -> CUIntPtr Source #
Ord CIntPtr # |
Instance details Defined in Foreign.C.Types Methods compare :: CIntPtr -> CIntPtr -> Ordering Source # (<) :: CIntPtr -> CIntPtr -> Bool Source # (<=) :: CIntPtr -> CIntPtr -> Bool Source # (>) :: CIntPtr -> CIntPtr -> Bool Source # (>=) :: CIntPtr -> CIntPtr -> Bool Source # max :: CIntPtr -> CIntPtr -> CIntPtr Source # min :: CIntPtr -> CIntPtr -> CIntPtr Source #
Ord CSUSeconds # |
Instance details Defined in Foreign.C.Types Methods compare :: CSUSeconds -> CSUSeconds -> Ordering Source # (<) :: CSUSeconds -> CSUSeconds -> Bool Source # (<=) :: CSUSeconds -> CSUSeconds -> Bool Source # (>) :: CSUSeconds -> CSUSeconds -> Bool Source # (>=) :: CSUSeconds -> CSUSeconds -> Bool Source # max :: CSUSeconds -> CSUSeconds -> CSUSeconds Source # min :: CSUSeconds -> CSUSeconds -> CSUSeconds Source #
Ord CUSeconds # |
Instance details Defined in Foreign.C.Types Methods compare :: CUSeconds -> CUSeconds -> Ordering Source # (<) :: CUSeconds -> CUSeconds -> Bool Source # (<=) :: CUSeconds -> CUSeconds -> Bool Source # (>) :: CUSeconds -> CUSeconds -> Bool Source # (>=) :: CUSeconds -> CUSeconds -> Bool Source # max :: CUSeconds -> CUSeconds -> CUSeconds Source # min :: CUSeconds -> CUSeconds -> CUSeconds Source #
Ord CTime # |
Instance details Defined in Foreign.C.Types Methods compare :: CTime -> CTime -> Ordering Source # (<) :: CTime -> CTime -> Bool Source # (<=) :: CTime -> CTime -> Bool Source # (>) :: CTime -> CTime -> Bool Source # (>=) :: CTime -> CTime -> Bool Source # max :: CTime -> CTime -> CTime Source # min :: CTime -> CTime -> CTime Source #
Ord CClock # |
Instance details Defined in Foreign.C.Types Methods compare :: CClock -> CClock -> Ordering Source # (<) :: CClock -> CClock -> Bool Source # (<=) :: CClock -> CClock -> Bool Source # (>) :: CClock -> CClock -> Bool Source # (>=) :: CClock -> CClock -> Bool Source # max :: CClock -> CClock -> CClock Source # min :: CClock -> CClock -> CClock Source #
Ord CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods compare :: CSigAtomic -> CSigAtomic -> Ordering Source # (<) :: CSigAtomic -> CSigAtomic -> Bool Source # (<=) :: CSigAtomic -> CSigAtomic -> Bool Source # (>) :: CSigAtomic -> CSigAtomic -> Bool Source # (>=) :: CSigAtomic -> CSigAtomic -> Bool Source # max :: CSigAtomic -> CSigAtomic -> CSigAtomic Source # min :: CSigAtomic -> CSigAtomic -> CSigAtomic Source #
Ord CWchar # |
Instance details Defined in Foreign.C.Types Methods compare :: CWchar -> CWchar -> Ordering Source # (<) :: CWchar -> CWchar -> Bool Source # (<=) :: CWchar -> CWchar -> Bool Source # (>) :: CWchar -> CWchar -> Bool Source # (>=) :: CWchar -> CWchar -> Bool Source # max :: CWchar -> CWchar -> CWchar Source # min :: CWchar -> CWchar -> CWchar Source #
Ord CSize # |
Instance details Defined in Foreign.C.Types Methods compare :: CSize -> CSize -> Ordering Source # (<) :: CSize -> CSize -> Bool Source # (<=) :: CSize -> CSize -> Bool Source # (>) :: CSize -> CSize -> Bool Source # (>=) :: CSize -> CSize -> Bool Source # max :: CSize -> CSize -> CSize Source # min :: CSize -> CSize -> CSize Source #
Ord CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods compare :: CPtrdiff -> CPtrdiff -> Ordering Source # (<) :: CPtrdiff -> CPtrdiff -> Bool Source # (<=) :: CPtrdiff -> CPtrdiff -> Bool Source # (>) :: CPtrdiff -> CPtrdiff -> Bool Source # (>=) :: CPtrdiff -> CPtrdiff -> Bool Source # max :: CPtrdiff -> CPtrdiff -> CPtrdiff Source # min :: CPtrdiff -> CPtrdiff -> CPtrdiff Source #
Ord CDouble # |
Instance details Defined in Foreign.C.Types Methods compare :: CDouble -> CDouble -> Ordering Source # (<) :: CDouble -> CDouble -> Bool Source # (<=) :: CDouble -> CDouble -> Bool Source # (>) :: CDouble -> CDouble -> Bool Source # (>=) :: CDouble -> CDouble -> Bool Source # max :: CDouble -> CDouble -> CDouble Source # min :: CDouble -> CDouble -> CDouble Source #
Ord CFloat # |
Instance details Defined in Foreign.C.Types Methods compare :: CFloat -> CFloat -> Ordering Source # (<) :: CFloat -> CFloat -> Bool Source # (<=) :: CFloat -> CFloat -> Bool Source # (>) :: CFloat -> CFloat -> Bool Source # (>=) :: CFloat -> CFloat -> Bool Source # max :: CFloat -> CFloat -> CFloat Source # min :: CFloat -> CFloat -> CFloat Source #
Ord CBool # |
Instance details Defined in Foreign.C.Types Methods compare :: CBool -> CBool -> Ordering Source # (<) :: CBool -> CBool -> Bool Source # (<=) :: CBool -> CBool -> Bool Source # (>) :: CBool -> CBool -> Bool Source # (>=) :: CBool -> CBool -> Bool Source # max :: CBool -> CBool -> CBool Source # min :: CBool -> CBool -> CBool Source #
Ord CULLong # |
Instance details Defined in Foreign.C.Types Methods compare :: CULLong -> CULLong -> Ordering Source # (<) :: CULLong -> CULLong -> Bool Source # (<=) :: CULLong -> CULLong -> Bool Source # (>) :: CULLong -> CULLong -> Bool Source # (>=) :: CULLong -> CULLong -> Bool Source # max :: CULLong -> CULLong -> CULLong Source # min :: CULLong -> CULLong -> CULLong Source #
Ord CLLong # |
Instance details Defined in Foreign.C.Types Methods compare :: CLLong -> CLLong -> Ordering Source # (<) :: CLLong -> CLLong -> Bool Source # (<=) :: CLLong -> CLLong -> Bool Source # (>) :: CLLong -> CLLong -> Bool Source # (>=) :: CLLong -> CLLong -> Bool Source # max :: CLLong -> CLLong -> CLLong Source # min :: CLLong -> CLLong -> CLLong Source #
Ord CULong # |
Instance details Defined in Foreign.C.Types Methods compare :: CULong -> CULong -> Ordering Source # (<) :: CULong -> CULong -> Bool Source # (<=) :: CULong -> CULong -> Bool Source # (>) :: CULong -> CULong -> Bool Source # (>=) :: CULong -> CULong -> Bool Source # max :: CULong -> CULong -> CULong Source # min :: CULong -> CULong -> CULong Source #
Ord CLong # |
Instance details Defined in Foreign.C.Types Methods compare :: CLong -> CLong -> Ordering Source # (<) :: CLong -> CLong -> Bool Source # (<=) :: CLong -> CLong -> Bool Source # (>) :: CLong -> CLong -> Bool Source # (>=) :: CLong -> CLong -> Bool Source # max :: CLong -> CLong -> CLong Source # min :: CLong -> CLong -> CLong Source #
Ord CUInt # |
Instance details Defined in Foreign.C.Types Methods compare :: CUInt -> CUInt -> Ordering Source # (<) :: CUInt -> CUInt -> Bool Source # (<=) :: CUInt -> CUInt -> Bool Source # (>) :: CUInt -> CUInt -> Bool Source # (>=) :: CUInt -> CUInt -> Bool Source # max :: CUInt -> CUInt -> CUInt Source # min :: CUInt -> CUInt -> CUInt Source #
Ord CInt # |
Instance details Defined in Foreign.C.Types Methods compare :: CInt -> CInt -> Ordering Source # (<) :: CInt -> CInt -> Bool Source # (<=) :: CInt -> CInt -> Bool Source # (>) :: CInt -> CInt -> Bool Source # (>=) :: CInt -> CInt -> Bool Source # max :: CInt -> CInt -> CInt Source # min :: CInt -> CInt -> CInt Source #
Ord CUShort # |
Instance details Defined in Foreign.C.Types Methods compare :: CUShort -> CUShort -> Ordering Source # (<) :: CUShort -> CUShort -> Bool Source # (<=) :: CUShort -> CUShort -> Bool Source # (>) :: CUShort -> CUShort -> Bool Source # (>=) :: CUShort -> CUShort -> Bool Source # max :: CUShort -> CUShort -> CUShort Source # min :: CUShort -> CUShort -> CUShort Source #
Ord CShort # |
Instance details Defined in Foreign.C.Types Methods compare :: CShort -> CShort -> Ordering Source # (<) :: CShort -> CShort -> Bool Source # (<=) :: CShort -> CShort -> Bool Source # (>) :: CShort -> CShort -> Bool Source # (>=) :: CShort -> CShort -> Bool Source # max :: CShort -> CShort -> CShort Source # min :: CShort -> CShort -> CShort Source #
Ord CUChar # |
Instance details Defined in Foreign.C.Types Methods compare :: CUChar -> CUChar -> Ordering Source # (<) :: CUChar -> CUChar -> Bool Source # (<=) :: CUChar -> CUChar -> Bool Source # (>) :: CUChar -> CUChar -> Bool Source # (>=) :: CUChar -> CUChar -> Bool Source # max :: CUChar -> CUChar -> CUChar Source # min :: CUChar -> CUChar -> CUChar Source #
Ord CSChar # |
Instance details Defined in Foreign.C.Types Methods compare :: CSChar -> CSChar -> Ordering Source # (<) :: CSChar -> CSChar -> Bool Source # (<=) :: CSChar -> CSChar -> Bool Source # (>) :: CSChar -> CSChar -> Bool Source # (>=) :: CSChar -> CSChar -> Bool Source # max :: CSChar -> CSChar -> CSChar Source # min :: CSChar -> CSChar -> CSChar Source #
Ord CChar # |
Instance details Defined in Foreign.C.Types Methods compare :: CChar -> CChar -> Ordering Source # (<) :: CChar -> CChar -> Bool Source # (<=) :: CChar -> CChar -> Bool Source # (>) :: CChar -> CChar -> Bool Source # (>=) :: CChar -> CChar -> Bool Source # max :: CChar -> CChar -> CChar Source # min :: CChar -> CChar -> CChar Source #
Ord SomeNat # | Since: base-4.7.0.0
Instance details Defined in GHC.TypeNats Methods compare :: SomeNat -> SomeNat -> Ordering Source # (<) :: SomeNat -> SomeNat -> Bool Source # (<=) :: SomeNat -> SomeNat -> Bool Source # (>) :: SomeNat -> SomeNat -> Bool Source # (>=) :: SomeNat -> SomeNat -> Bool Source # max :: SomeNat -> SomeNat -> SomeNat Source # min :: SomeNat -> SomeNat -> SomeNat Source #
Ord SomeSymbol # | Since: base-4.7.0.0
Instance details Defined in GHC.TypeLits Methods compare :: SomeSymbol -> SomeSymbol -> Ordering Source # (<) :: SomeSymbol -> SomeSymbol -> Bool Source # (<=) :: SomeSymbol -> SomeSymbol -> Bool Source # (>) :: SomeSymbol -> SomeSymbol -> Bool Source # (>=) :: SomeSymbol -> SomeSymbol -> Bool Source # max :: SomeSymbol -> SomeSymbol -> SomeSymbol Source # min :: SomeSymbol -> SomeSymbol -> SomeSymbol Source #
Ord DecidedStrictness # |
Instance details Defined in GHC.Generics Methods compare :: DecidedStrictness -> DecidedStrictness -> Ordering Source # (<) :: DecidedStrictness -> DecidedStrictness -> Bool Source # (<=) :: DecidedStrictness -> DecidedStrictness -> Bool Source # (>) :: DecidedStrictness -> DecidedStrictness -> Bool Source # (>=) :: DecidedStrictness -> DecidedStrictness -> Bool Source # max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness Source # min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness Source #
Ord SourceStrictness # |
Instance details Defined in GHC.Generics Methods compare :: SourceStrictness -> SourceStrictness -> Ordering Source # (<) :: SourceStrictness -> SourceStrictness -> Bool Source # (<=) :: SourceStrictness -> SourceStrictness -> Bool Source # (>) :: SourceStrictness -> SourceStrictness -> Bool Source # (>=) :: SourceStrictness -> SourceStrictness -> Bool Source # max :: SourceStrictness -> SourceStrictness -> SourceStrictness Source # min :: SourceStrictness -> SourceStrictness -> SourceStrictness Source #
Ord SourceUnpackedness # |
Instance details Defined in GHC.Generics Methods compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering Source # (<) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (>) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # (>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool Source # max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source # min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness Source #
Ord Associativity # |
Instance details Defined in GHC.Generics Methods compare :: Associativity -> Associativity -> Ordering Source # (<) :: Associativity -> Associativity -> Bool Source # (<=) :: Associativity -> Associativity -> Bool Source # (>) :: Associativity -> Associativity -> Bool Source # (>=) :: Associativity -> Associativity -> Bool Source # max :: Associativity -> Associativity -> Associativity Source # min :: Associativity -> Associativity -> Associativity Source #
Ord Fixity # |
Instance details Defined in GHC.Generics Methods compare :: Fixity -> Fixity -> Ordering Source # (<) :: Fixity -> Fixity -> Bool Source # (<=) :: Fixity -> Fixity -> Bool Source # (>) :: Fixity -> Fixity -> Bool Source # (>=) :: Fixity -> Fixity -> Bool Source # max :: Fixity -> Fixity -> Fixity Source # min :: Fixity -> Fixity -> Fixity Source #
Ord Any # |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Any -> Any -> Ordering Source # (<) :: Any -> Any -> Bool Source # (<=) :: Any -> Any -> Bool Source # (>) :: Any -> Any -> Bool Source # (>=) :: Any -> Any -> Bool Source # max :: Any -> Any -> Any Source # min :: Any -> Any -> Any Source #
Ord All # |
Instance details Defined in Data.Semigroup.Internal Methods compare :: All -> All -> Ordering Source # (<) :: All -> All -> Bool Source # (<=) :: All -> All -> Bool Source # (>) :: All -> All -> Bool Source # (>=) :: All -> All -> Bool Source # max :: All -> All -> All Source # min :: All -> All -> All Source #
Ord ArithException # |
Instance details Defined in GHC.Exception Methods compare :: ArithException -> ArithException -> Ordering Source # (<) :: ArithException -> ArithException -> Bool Source # (<=) :: ArithException -> ArithException -> Bool Source # (>) :: ArithException -> ArithException -> Bool Source # (>=) :: ArithException -> ArithException -> Bool Source # max :: ArithException -> ArithException -> ArithException Source # min :: ArithException -> ArithException -> ArithException Source #
Ord ErrorCall # |
Instance details Defined in GHC.Exception Methods compare :: ErrorCall -> ErrorCall -> Ordering Source # (<) :: ErrorCall -> ErrorCall -> Bool Source # (<=) :: ErrorCall -> ErrorCall -> Bool Source # (>) :: ErrorCall -> ErrorCall -> Bool Source # (>=) :: ErrorCall -> ErrorCall -> Bool Source # max :: ErrorCall -> ErrorCall -> ErrorCall Source # min :: ErrorCall -> ErrorCall -> ErrorCall Source #
Ord SeekMode # |
Instance details Defined in GHC.IO.Device Methods compare :: SeekMode -> SeekMode -> Ordering Source # (<) :: SeekMode -> SeekMode -> Bool Source # (<=) :: SeekMode -> SeekMode -> Bool Source # (>) :: SeekMode -> SeekMode -> Bool Source # (>=) :: SeekMode -> SeekMode -> Bool Source # max :: SeekMode -> SeekMode -> SeekMode Source # min :: SeekMode -> SeekMode -> SeekMode Source #
Ord NewlineMode # |
Instance details Defined in GHC.IO.Handle.Types Methods compare :: NewlineMode -> NewlineMode -> Ordering Source # (<) :: NewlineMode -> NewlineMode -> Bool Source # (<=) :: NewlineMode -> NewlineMode -> Bool Source # (>) :: NewlineMode -> NewlineMode -> Bool Source # (>=) :: NewlineMode -> NewlineMode -> Bool Source # max :: NewlineMode -> NewlineMode -> NewlineMode Source # min :: NewlineMode -> NewlineMode -> NewlineMode Source #
Ord Newline # |
Instance details Defined in GHC.IO.Handle.Types Methods compare :: Newline -> Newline -> Ordering Source # (<) :: Newline -> Newline -> Bool Source # (<=) :: Newline -> Newline -> Bool Source # (>) :: Newline -> Newline -> Bool Source # (>=) :: Newline -> Newline -> Bool Source # max :: Newline -> Newline -> Newline Source # min :: Newline -> Newline -> Newline Source #
Ord BufferMode # |
Instance details Defined in GHC.IO.Handle.Types Methods compare :: BufferMode -> BufferMode -> Ordering Source # (<) :: BufferMode -> BufferMode -> Bool Source # (<=) :: BufferMode -> BufferMode -> Bool Source # (>) :: BufferMode -> BufferMode -> Bool Source # (>=) :: BufferMode -> BufferMode -> Bool Source # max :: BufferMode -> BufferMode -> BufferMode Source # min :: BufferMode -> BufferMode -> BufferMode Source #
Ord ExitCode # |
Instance details Defined in GHC.IO.Exception Methods compare :: ExitCode -> ExitCode -> Ordering Source # (<) :: ExitCode -> ExitCode -> Bool Source # (<=) :: ExitCode -> ExitCode -> Bool Source # (>) :: ExitCode -> ExitCode -> Bool Source # (>=) :: ExitCode -> ExitCode -> Bool Source # max :: ExitCode -> ExitCode -> ExitCode Source # min :: ExitCode -> ExitCode -> ExitCode Source #
Ord ArrayException # |
Instance details Defined in GHC.IO.Exception Methods compare :: ArrayException -> ArrayException -> Ordering Source # (<) :: ArrayException -> ArrayException -> Bool Source # (<=) :: ArrayException -> ArrayException -> Bool Source # (>) :: ArrayException -> ArrayException -> Bool Source # (>=) :: ArrayException -> ArrayException -> Bool Source # max :: ArrayException -> ArrayException -> ArrayException Source # min :: ArrayException -> ArrayException -> ArrayException Source #
Ord AsyncException # |
Instance details Defined in GHC.IO.Exception Methods compare :: AsyncException -> AsyncException -> Ordering Source # (<) :: AsyncException -> AsyncException -> Bool Source # (<=) :: AsyncException -> AsyncException -> Bool Source # (>) :: AsyncException -> AsyncException -> Bool Source # (>=) :: AsyncException -> AsyncException -> Bool Source # max :: AsyncException -> AsyncException -> AsyncException Source # min :: AsyncException -> AsyncException -> AsyncException Source #
Ord Fd # |
Instance details Defined in System.Posix.Types Methods compare :: Fd -> Fd -> Ordering Source # (<) :: Fd -> Fd -> Bool Source # (<=) :: Fd -> Fd -> Bool Source # (>) :: Fd -> Fd -> Bool Source # (>=) :: Fd -> Fd -> Bool Source # max :: Fd -> Fd -> Fd Source # min :: Fd -> Fd -> Fd Source #
Ord CTimer # |
Instance details Defined in System.Posix.Types Methods compare :: CTimer -> CTimer -> Ordering Source # (<) :: CTimer -> CTimer -> Bool Source # (<=) :: CTimer -> CTimer -> Bool Source # (>) :: CTimer -> CTimer -> Bool Source # (>=) :: CTimer -> CTimer -> Bool Source # max :: CTimer -> CTimer -> CTimer Source # min :: CTimer -> CTimer -> CTimer Source #
Ord CKey # |
Instance details Defined in System.Posix.Types Methods compare :: CKey -> CKey -> Ordering Source # (<) :: CKey -> CKey -> Bool Source # (<=) :: CKey -> CKey -> Bool Source # (>) :: CKey -> CKey -> Bool Source # (>=) :: CKey -> CKey -> Bool Source # max :: CKey -> CKey -> CKey Source # min :: CKey -> CKey -> CKey Source #
Ord CId # |
Instance details Defined in System.Posix.Types Methods compare :: CId -> CId -> Ordering Source # (<) :: CId -> CId -> Bool Source # (<=) :: CId -> CId -> Bool Source # (>) :: CId -> CId -> Bool Source # (>=) :: CId -> CId -> Bool Source # max :: CId -> CId -> CId Source # min :: CId -> CId -> CId Source #
Ord CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods compare :: CFsFilCnt -> CFsFilCnt -> Ordering Source # (<) :: CFsFilCnt -> CFsFilCnt -> Bool Source # (<=) :: CFsFilCnt -> CFsFilCnt -> Bool Source # (>) :: CFsFilCnt -> CFsFilCnt -> Bool Source # (>=) :: CFsFilCnt -> CFsFilCnt -> Bool Source # max :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt Source # min :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt Source #
Ord CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods compare :: CFsBlkCnt -> CFsBlkCnt -> Ordering Source # (<) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source # (<=) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source # (>) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source # (>=) :: CFsBlkCnt -> CFsBlkCnt -> Bool Source # max :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt Source # min :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt Source #
Ord CClockId # |
Instance details Defined in System.Posix.Types Methods compare :: CClockId -> CClockId -> Ordering Source # (<) :: CClockId -> CClockId -> Bool Source # (<=) :: CClockId -> CClockId -> Bool Source # (>) :: CClockId -> CClockId -> Bool Source # (>=) :: CClockId -> CClockId -> Bool Source # max :: CClockId -> CClockId -> CClockId Source # min :: CClockId -> CClockId -> CClockId Source #
Ord CBlkCnt # |
Instance details Defined in System.Posix.Types Methods compare :: CBlkCnt -> CBlkCnt -> Ordering Source # (<) :: CBlkCnt -> CBlkCnt -> Bool Source # (<=) :: CBlkCnt -> CBlkCnt -> Bool Source # (>) :: CBlkCnt -> CBlkCnt -> Bool Source # (>=) :: CBlkCnt -> CBlkCnt -> Bool Source # max :: CBlkCnt -> CBlkCnt -> CBlkCnt Source # min :: CBlkCnt -> CBlkCnt -> CBlkCnt Source #
Ord CBlkSize # |
Instance details Defined in System.Posix.Types Methods compare :: CBlkSize -> CBlkSize -> Ordering Source # (<) :: CBlkSize -> CBlkSize -> Bool Source # (<=) :: CBlkSize -> CBlkSize -> Bool Source # (>) :: CBlkSize -> CBlkSize -> Bool Source # (>=) :: CBlkSize -> CBlkSize -> Bool Source # max :: CBlkSize -> CBlkSize -> CBlkSize Source # min :: CBlkSize -> CBlkSize -> CBlkSize Source #
Ord CRLim # |
Instance details Defined in System.Posix.Types Methods compare :: CRLim -> CRLim -> Ordering Source # (<) :: CRLim -> CRLim -> Bool Source # (<=) :: CRLim -> CRLim -> Bool Source # (>) :: CRLim -> CRLim -> Bool Source # (>=) :: CRLim -> CRLim -> Bool Source # max :: CRLim -> CRLim -> CRLim Source # min :: CRLim -> CRLim -> CRLim Source #
Ord CTcflag # |
Instance details Defined in System.Posix.Types Methods compare :: CTcflag -> CTcflag -> Ordering Source # (<) :: CTcflag -> CTcflag -> Bool Source # (<=) :: CTcflag -> CTcflag -> Bool Source # (>) :: CTcflag -> CTcflag -> Bool Source # (>=) :: CTcflag -> CTcflag -> Bool Source # max :: CTcflag -> CTcflag -> CTcflag Source # min :: CTcflag -> CTcflag -> CTcflag Source #
Ord CSpeed # |
Instance details Defined in System.Posix.Types Methods compare :: CSpeed -> CSpeed -> Ordering Source # (<) :: CSpeed -> CSpeed -> Bool Source # (<=) :: CSpeed -> CSpeed -> Bool Source # (>) :: CSpeed -> CSpeed -> Bool Source # (>=) :: CSpeed -> CSpeed -> Bool Source # max :: CSpeed -> CSpeed -> CSpeed Source # min :: CSpeed -> CSpeed -> CSpeed Source #
Ord CCc # |
Instance details Defined in System.Posix.Types Methods compare :: CCc -> CCc -> Ordering Source # (<) :: CCc -> CCc -> Bool Source # (<=) :: CCc -> CCc -> Bool Source # (>) :: CCc -> CCc -> Bool Source # (>=) :: CCc -> CCc -> Bool Source # max :: CCc -> CCc -> CCc Source # min :: CCc -> CCc -> CCc Source #
Ord CUid # |
Instance details Defined in System.Posix.Types Methods compare :: CUid -> CUid -> Ordering Source # (<) :: CUid -> CUid -> Bool Source # (<=) :: CUid -> CUid -> Bool Source # (>) :: CUid -> CUid -> Bool Source # (>=) :: CUid -> CUid -> Bool Source # max :: CUid -> CUid -> CUid Source # min :: CUid -> CUid -> CUid Source #
Ord CNlink # |
Instance details Defined in System.Posix.Types Methods compare :: CNlink -> CNlink -> Ordering Source # (<) :: CNlink -> CNlink -> Bool Source # (<=) :: CNlink -> CNlink -> Bool Source # (>) :: CNlink -> CNlink -> Bool Source # (>=) :: CNlink -> CNlink -> Bool Source # max :: CNlink -> CNlink -> CNlink Source # min :: CNlink -> CNlink -> CNlink Source #
Ord CGid # |
Instance details Defined in System.Posix.Types Methods compare :: CGid -> CGid -> Ordering Source # (<) :: CGid -> CGid -> Bool Source # (<=) :: CGid -> CGid -> Bool Source # (>) :: CGid -> CGid -> Bool Source # (>=) :: CGid -> CGid -> Bool Source # max :: CGid -> CGid -> CGid Source # min :: CGid -> CGid -> CGid Source #
Ord CSsize # |
Instance details Defined in System.Posix.Types Methods compare :: CSsize -> CSsize -> Ordering Source # (<) :: CSsize -> CSsize -> Bool Source # (<=) :: CSsize -> CSsize -> Bool Source # (>) :: CSsize -> CSsize -> Bool Source # (>=) :: CSsize -> CSsize -> Bool Source # max :: CSsize -> CSsize -> CSsize Source # min :: CSsize -> CSsize -> CSsize Source #
Ord CPid # |
Instance details Defined in System.Posix.Types Methods compare :: CPid -> CPid -> Ordering Source # (<) :: CPid -> CPid -> Bool Source # (<=) :: CPid -> CPid -> Bool Source # (>) :: CPid -> CPid -> Bool Source # (>=) :: CPid -> CPid -> Bool Source # max :: CPid -> CPid -> CPid Source # min :: CPid -> CPid -> CPid Source #
Ord COff # |
Instance details Defined in System.Posix.Types Methods compare :: COff -> COff -> Ordering Source # (<) :: COff -> COff -> Bool Source # (<=) :: COff -> COff -> Bool Source # (>) :: COff -> COff -> Bool Source # (>=) :: COff -> COff -> Bool Source # max :: COff -> COff -> COff Source # min :: COff -> COff -> COff Source #
Ord CMode # |
Instance details Defined in System.Posix.Types Methods compare :: CMode -> CMode -> Ordering Source # (<) :: CMode -> CMode -> Bool Source # (<=) :: CMode -> CMode -> Bool Source # (>) :: CMode -> CMode -> Bool Source # (>=) :: CMode -> CMode -> Bool Source # max :: CMode -> CMode -> CMode Source # min :: CMode -> CMode -> CMode Source #
Ord CIno # |
Instance details Defined in System.Posix.Types Methods compare :: CIno -> CIno -> Ordering Source # (<) :: CIno -> CIno -> Bool Source # (<=) :: CIno -> CIno -> Bool Source # (>) :: CIno -> CIno -> Bool Source # (>=) :: CIno -> CIno -> Bool Source # max :: CIno -> CIno -> CIno Source # min :: CIno -> CIno -> CIno Source #
Ord CDev # |
Instance details Defined in System.Posix.Types Methods compare :: CDev -> CDev -> Ordering Source # (<) :: CDev -> CDev -> Bool Source # (<=) :: CDev -> CDev -> Bool Source # (>) :: CDev -> CDev -> Bool Source # (>=) :: CDev -> CDev -> Bool Source # max :: CDev -> CDev -> CDev Source # min :: CDev -> CDev -> CDev Source #
Ord ThreadStatus # |
Instance details Defined in GHC.Conc.Sync Methods compare :: ThreadStatus -> ThreadStatus -> Ordering Source # (<) :: ThreadStatus -> ThreadStatus -> Bool Source # (<=) :: ThreadStatus -> ThreadStatus -> Bool Source # (>) :: ThreadStatus -> ThreadStatus -> Bool Source # (>=) :: ThreadStatus -> ThreadStatus -> Bool Source # max :: ThreadStatus -> ThreadStatus -> ThreadStatus Source # min :: ThreadStatus -> ThreadStatus -> ThreadStatus Source #
Ord BlockReason # |
Instance details Defined in GHC.Conc.Sync Methods compare :: BlockReason -> BlockReason -> Ordering Source # (<) :: BlockReason -> BlockReason -> Bool Source # (<=) :: BlockReason -> BlockReason -> Bool Source # (>) :: BlockReason -> BlockReason -> Bool Source # (>=) :: BlockReason -> BlockReason -> Bool Source # max :: BlockReason -> BlockReason -> BlockReason Source # min :: BlockReason -> BlockReason -> BlockReason Source #
Ord ThreadId # | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods compare :: ThreadId -> ThreadId -> Ordering Source # (<) :: ThreadId -> ThreadId -> Bool Source # (<=) :: ThreadId -> ThreadId -> Bool Source # (>) :: ThreadId -> ThreadId -> Bool Source # (>=) :: ThreadId -> ThreadId -> Bool Source # max :: ThreadId -> ThreadId -> ThreadId Source # min :: ThreadId -> ThreadId -> ThreadId Source #
Ord Version # | Since: base-2.1
Instance details Defined in Data.Version Methods compare :: Version -> Version -> Ordering Source # (<) :: Version -> Version -> Bool Source # (<=) :: Version -> Version -> Bool Source # (>) :: Version -> Version -> Bool Source # (>=) :: Version -> Version -> Bool Source # max :: Version -> Version -> Version Source # min :: Version -> Version -> Version Source #
Ord ByteOrder # |
Instance details Defined in GHC.ByteOrder Methods compare :: ByteOrder -> ByteOrder -> Ordering Source # (<) :: ByteOrder -> ByteOrder -> Bool Source # (<=) :: ByteOrder -> ByteOrder -> Bool Source # (>) :: ByteOrder -> ByteOrder -> Bool Source # (>=) :: ByteOrder -> ByteOrder -> Bool Source # max :: ByteOrder -> ByteOrder -> ByteOrder Source # min :: ByteOrder -> ByteOrder -> ByteOrder Source #
Ord Unique # |
Instance details Defined in Data.Unique Methods compare :: Unique -> Unique -> Ordering Source # (<) :: Unique -> Unique -> Bool Source # (<=) :: Unique -> Unique -> Bool Source # (>) :: Unique -> Unique -> Bool Source # (>=) :: Unique -> Unique -> Bool Source # max :: Unique -> Unique -> Unique Source # min :: Unique -> Unique -> Unique Source #
Ord Void # | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods compare :: Void -> Void -> Ordering Source # (<) :: Void -> Void -> Bool Source # (<=) :: Void -> Void -> Bool Source # (>) :: Void -> Void -> Bool Source # (>=) :: Void -> Void -> Bool Source # max :: Void -> Void -> Void Source # min :: Void -> Void -> Void Source #
Ord a => Ord [a] |
Instance details Defined in GHC.Classes Methods compare :: [a] -> [a] -> Ordering Source # (<) :: [a] -> [a] -> Bool Source # (<=) :: [a] -> [a] -> Bool Source # (>) :: [a] -> [a] -> Bool Source # (>=) :: [a] -> [a] -> Bool Source # max :: [a] -> [a] -> [a] Source # min :: [a] -> [a] -> [a] Source #
Ord a => Ord (Maybe a) # |
Instance details Defined in GHC.Base Methods compare :: Maybe a -> Maybe a -> Ordering Source # (<) :: Maybe a -> Maybe a -> Bool Source # (<=) :: Maybe a -> Maybe a -> Bool Source # (>) :: Maybe a -> Maybe a -> Bool Source # (>=) :: Maybe a -> Maybe a -> Bool Source # max :: Maybe a -> Maybe a -> Maybe a Source # min :: Maybe a -> Maybe a -> Maybe a Source #
Integral a => Ord (Ratio a) # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods compare :: Ratio a -> Ratio a -> Ordering Source # (<) :: Ratio a -> Ratio a -> Bool Source # (<=) :: Ratio a -> Ratio a -> Bool Source # (>) :: Ratio a -> Ratio a -> Bool Source # (>=) :: Ratio a -> Ratio a -> Bool Source # max :: Ratio a -> Ratio a -> Ratio a Source # min :: Ratio a -> Ratio a -> Ratio a Source #
Ord (Ptr a) # |
Instance details Defined in GHC.Ptr Methods compare :: Ptr a -> Ptr a -> Ordering Source # (<) :: Ptr a -> Ptr a -> Bool Source # (<=) :: Ptr a -> Ptr a -> Bool Source # (>) :: Ptr a -> Ptr a -> Bool Source # (>=) :: Ptr a -> Ptr a -> Bool Source # max :: Ptr a -> Ptr a -> Ptr a Source # min :: Ptr a -> Ptr a -> Ptr a Source #
Ord (FunPtr a) # |
Instance details Defined in GHC.Ptr Methods compare :: FunPtr a -> FunPtr a -> Ordering Source # (<) :: FunPtr a -> FunPtr a -> Bool Source # (<=) :: FunPtr a -> FunPtr a -> Bool Source # (>) :: FunPtr a -> FunPtr a -> Bool Source # (>=) :: FunPtr a -> FunPtr a -> Bool Source # max :: FunPtr a -> FunPtr a -> FunPtr a Source # min :: FunPtr a -> FunPtr a -> FunPtr a Source #
Ord p => Ord (Par1 p) # |
Instance details Defined in GHC.Generics Methods compare :: Par1 p -> Par1 p -> Ordering Source # (<) :: Par1 p -> Par1 p -> Bool Source # (<=) :: Par1 p -> Par1 p -> Bool Source # (>) :: Par1 p -> Par1 p -> Bool Source # (>=) :: Par1 p -> Par1 p -> Bool Source # max :: Par1 p -> Par1 p -> Par1 p Source # min :: Par1 p -> Par1 p -> Par1 p Source #
Ord a => Ord (NonEmpty a) # |
Instance details Defined in GHC.Base Methods compare :: NonEmpty a -> NonEmpty a -> Ordering Source # (<) :: NonEmpty a -> NonEmpty a -> Bool Source # (<=) :: NonEmpty a -> NonEmpty a -> Bool Source # (>) :: NonEmpty a -> NonEmpty a -> Bool Source # (>=) :: NonEmpty a -> NonEmpty a -> Bool Source # max :: NonEmpty a -> NonEmpty a -> NonEmpty a Source # min :: NonEmpty a -> NonEmpty a -> NonEmpty a Source #
Ord a => Ord (Down a) # | Since: base-4.6.0.0
Instance details Defined in Data.Ord Methods compare :: Down a -> Down a -> Ordering Source # (<) :: Down a -> Down a -> Bool Source # (<=) :: Down a -> Down a -> Bool Source # (>) :: Down a -> Down a -> Bool Source # (>=) :: Down a -> Down a -> Bool Source # max :: Down a -> Down a -> Down a Source # min :: Down a -> Down a -> Down a Source #
Ord a => Ord (Product a) # |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Product a -> Product a -> Ordering Source # (<) :: Product a -> Product a -> Bool Source # (<=) :: Product a -> Product a -> Bool Source # (>) :: Product a -> Product a -> Bool Source # (>=) :: Product a -> Product a -> Bool Source # max :: Product a -> Product a -> Product a Source # min :: Product a -> Product a -> Product a Source #
Ord a => Ord (Sum a) # |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Sum a -> Sum a -> Ordering Source # (<) :: Sum a -> Sum a -> Bool Source # (<=) :: Sum a -> Sum a -> Bool Source # (>) :: Sum a -> Sum a -> Bool Source # (>=) :: Sum a -> Sum a -> Bool Source # max :: Sum a -> Sum a -> Sum a Source # min :: Sum a -> Sum a -> Sum a Source #
Ord a => Ord (Dual a) # |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Dual a -> Dual a -> Ordering Source # (<) :: Dual a -> Dual a -> Bool Source # (<=) :: Dual a -> Dual a -> Bool Source # (>) :: Dual a -> Dual a -> Bool Source # (>=) :: Dual a -> Dual a -> Bool Source # max :: Dual a -> Dual a -> Dual a Source # min :: Dual a -> Dual a -> Dual a Source #
Ord a => Ord (Last a) # |
Instance details Defined in Data.Monoid Methods compare :: Last a -> Last a -> Ordering Source # (<) :: Last a -> Last a -> Bool Source # (<=) :: Last a -> Last a -> Bool Source # (>) :: Last a -> Last a -> Bool Source # (>=) :: Last a -> Last a -> Bool Source # max :: Last a -> Last a -> Last a Source # min :: Last a -> Last a -> Last a Source #
Ord a => Ord (First a) # |
Instance details Defined in Data.Monoid Methods compare :: First a -> First a -> Ordering Source # (<) :: First a -> First a -> Bool Source # (<=) :: First a -> First a -> Bool Source # (>) :: First a -> First a -> Bool Source # (>=) :: First a -> First a -> Bool Source # max :: First a -> First a -> First a Source # min :: First a -> First a -> First a Source #
Ord (ForeignPtr a) # | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods compare :: ForeignPtr a -> ForeignPtr a -> Ordering Source # (<) :: ForeignPtr a -> ForeignPtr a -> Bool Source # (<=) :: ForeignPtr a -> ForeignPtr a -> Bool Source # (>) :: ForeignPtr a -> ForeignPtr a -> Bool Source # (>=) :: ForeignPtr a -> ForeignPtr a -> Bool Source # max :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a Source # min :: ForeignPtr a -> ForeignPtr a -> ForeignPtr a Source #
Ord a => Ord (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods compare :: Identity a -> Identity a -> Ordering Source # (<) :: Identity a -> Identity a -> Bool Source # (<=) :: Identity a -> Identity a -> Bool Source # (>) :: Identity a -> Identity a -> Bool Source # (>=) :: Identity a -> Identity a -> Bool Source # max :: Identity a -> Identity a -> Identity a Source # min :: Identity a -> Identity a -> Identity a Source #
Ord a => Ord (ZipList a) # |
Instance details Defined in Control.Applicative Methods compare :: ZipList a -> ZipList a -> Ordering Source # (<) :: ZipList a -> ZipList a -> Bool Source # (<=) :: ZipList a -> ZipList a -> Bool Source # (>) :: ZipList a -> ZipList a -> Bool Source # (>=) :: ZipList a -> ZipList a -> Bool Source # max :: ZipList a -> ZipList a -> ZipList a Source # min :: ZipList a -> ZipList a -> ZipList a Source #
Ord a => Ord (Option a) # |
Instance details Defined in Data.Semigroup Methods compare :: Option a -> Option a -> Ordering Source # (<) :: Option a -> Option a -> Bool Source # (<=) :: Option a -> Option a -> Bool Source # (>) :: Option a -> Option a -> Bool Source # (>=) :: Option a -> Option a -> Bool Source # max :: Option a -> Option a -> Option a Source # min :: Option a -> Option a -> Option a Source #
Ord m => Ord (WrappedMonoid m) # |
Instance details Defined in Data.Semigroup Methods compare :: WrappedMonoid m -> WrappedMonoid m -> Ordering Source # (<) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # (<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # (>) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # (>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool Source # max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m Source # min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m Source #
Ord a => Ord (Last a) # |
Instance details Defined in Data.Semigroup Methods compare :: Last a -> Last a -> Ordering Source # (<) :: Last a -> Last a -> Bool Source # (<=) :: Last a -> Last a -> Bool Source # (>) :: Last a -> Last a -> Bool Source # (>=) :: Last a -> Last a -> Bool Source # max :: Last a -> Last a -> Last a Source # min :: Last a -> Last a -> Last a Source #
Ord a => Ord (First a) # |
Instance details Defined in Data.Semigroup Methods compare :: First a -> First a -> Ordering Source # (<) :: First a -> First a -> Bool Source # (<=) :: First a -> First a -> Bool Source # (>) :: First a -> First a -> Bool Source # (>=) :: First a -> First a -> Bool Source # max :: First a -> First a -> First a Source # min :: First a -> First a -> First a Source #
Ord a => Ord (Max a) # |
Instance details Defined in Data.Semigroup Methods compare :: Max a -> Max a -> Ordering Source # (<) :: Max a -> Max a -> Bool Source # (<=) :: Max a -> Max a -> Bool Source # (>) :: Max a -> Max a -> Bool Source # (>=) :: Max a -> Max a -> Bool Source # max :: Max a -> Max a -> Max a Source # min :: Max a -> Max a -> Max a Source #
Ord a => Ord (Min a) # |
Instance details Defined in Data.Semigroup Methods compare :: Min a -> Min a -> Ordering Source # (<) :: Min a -> Min a -> Bool Source # (<=) :: Min a -> Min a -> Bool Source # (>) :: Min a -> Min a -> Bool Source # (>=) :: Min a -> Min a -> Bool Source # max :: Min a -> Min a -> Min a Source # min :: Min a -> Min a -> Min a Source #
Ord (Fixed a) # |
Instance details Defined in Data.Fixed Methods compare :: Fixed a -> Fixed a -> Ordering Source # (<) :: Fixed a -> Fixed a -> Bool Source # (<=) :: Fixed a -> Fixed a -> Bool Source # (>) :: Fixed a -> Fixed a -> Bool Source # (>=) :: Fixed a -> Fixed a -> Bool Source # max :: Fixed a -> Fixed a -> Fixed a Source # min :: Fixed a -> Fixed a -> Fixed a Source #
(Ord a, Ord b) => Ord (Either a b) # |
Instance details Defined in Data.Either Methods compare :: Either a b -> Either a b -> Ordering Source # (<) :: Either a b -> Either a b -> Bool Source # (<=) :: Either a b -> Either a b -> Bool Source # (>) :: Either a b -> Either a b -> Bool Source # (>=) :: Either a b -> Either a b -> Bool Source # max :: Either a b -> Either a b -> Either a b Source # min :: Either a b -> Either a b -> Either a b Source #
Ord (V1 p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods compare :: V1 p -> V1 p -> Ordering Source # (<) :: V1 p -> V1 p -> Bool Source # (<=) :: V1 p -> V1 p -> Bool Source # (>) :: V1 p -> V1 p -> Bool Source # (>=) :: V1 p -> V1 p -> Bool Source # max :: V1 p -> V1 p -> V1 p Source # min :: V1 p -> V1 p -> V1 p Source #
Ord (U1 p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods compare :: U1 p -> U1 p -> Ordering Source # (<) :: U1 p -> U1 p -> Bool Source # (<=) :: U1 p -> U1 p -> Bool Source # (>) :: U1 p -> U1 p -> Bool Source # (>=) :: U1 p -> U1 p -> Bool Source # max :: U1 p -> U1 p -> U1 p Source # min :: U1 p -> U1 p -> U1 p Source #
Ord (TypeRep a) # | Since: base-4.4.0.0
Instance details Defined in Data.Typeable.Internal Methods compare :: TypeRep a -> TypeRep a -> Ordering Source # (<) :: TypeRep a -> TypeRep a -> Bool Source # (<=) :: TypeRep a -> TypeRep a -> Bool Source # (>) :: TypeRep a -> TypeRep a -> Bool Source # (>=) :: TypeRep a -> TypeRep a -> Bool Source # max :: TypeRep a -> TypeRep a -> TypeRep a Source # min :: TypeRep a -> TypeRep a -> TypeRep a Source #
(Ord a, Ord b) => Ord (a, b) |
Instance details Defined in GHC.Classes Methods compare :: (a, b) -> (a, b) -> Ordering Source # (<) :: (a, b) -> (a, b) -> Bool Source # (<=) :: (a, b) -> (a, b) -> Bool Source # (>) :: (a, b) -> (a, b) -> Bool Source # (>=) :: (a, b) -> (a, b) -> Bool Source # max :: (a, b) -> (a, b) -> (a, b) Source # min :: (a, b) -> (a, b) -> (a, b) Source #
Ord (Proxy s) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods compare :: Proxy s -> Proxy s -> Ordering Source # (<) :: Proxy s -> Proxy s -> Bool Source # (<=) :: Proxy s -> Proxy s -> Bool Source # (>) :: Proxy s -> Proxy s -> Bool Source # (>=) :: Proxy s -> Proxy s -> Bool Source # max :: Proxy s -> Proxy s -> Proxy s Source # min :: Proxy s -> Proxy s -> Proxy s Source #
Ord a => Ord (Arg a b) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods compare :: Arg a b -> Arg a b -> Ordering Source # (<) :: Arg a b -> Arg a b -> Bool Source # (<=) :: Arg a b -> Arg a b -> Bool Source # (>) :: Arg a b -> Arg a b -> Bool Source # (>=) :: Arg a b -> Arg a b -> Bool Source # max :: Arg a b -> Arg a b -> Arg a b Source # min :: Arg a b -> Arg a b -> Arg a b Source #
Ord (f p) => Ord (Rec1 f p) # |
Instance details Defined in GHC.Generics Methods compare :: Rec1 f p -> Rec1 f p -> Ordering Source # (<) :: Rec1 f p -> Rec1 f p -> Bool Source # (<=) :: Rec1 f p -> Rec1 f p -> Bool Source # (>) :: Rec1 f p -> Rec1 f p -> Bool Source # (>=) :: Rec1 f p -> Rec1 f p -> Bool Source # max :: Rec1 f p -> Rec1 f p -> Rec1 f p Source # min :: Rec1 f p -> Rec1 f p -> Rec1 f p Source #
Ord (URec Word p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Word p -> URec Word p -> Ordering Source # (<) :: URec Word p -> URec Word p -> Bool Source # (<=) :: URec Word p -> URec Word p -> Bool Source # (>) :: URec Word p -> URec Word p -> Bool Source # (>=) :: URec Word p -> URec Word p -> Bool Source # max :: URec Word p -> URec Word p -> URec Word p Source # min :: URec Word p -> URec Word p -> URec Word p Source #
Ord (URec Int p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Int p -> URec Int p -> Ordering Source # (<) :: URec Int p -> URec Int p -> Bool Source # (<=) :: URec Int p -> URec Int p -> Bool Source # (>) :: URec Int p -> URec Int p -> Bool Source # (>=) :: URec Int p -> URec Int p -> Bool Source # max :: URec Int p -> URec Int p -> URec Int p Source # min :: URec Int p -> URec Int p -> URec Int p Source #
Ord (URec Float p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Float p -> URec Float p -> Ordering Source # (<) :: URec Float p -> URec Float p -> Bool Source # (<=) :: URec Float p -> URec Float p -> Bool Source # (>) :: URec Float p -> URec Float p -> Bool Source # (>=) :: URec Float p -> URec Float p -> Bool Source # max :: URec Float p -> URec Float p -> URec Float p Source # min :: URec Float p -> URec Float p -> URec Float p Source #
Ord (URec Double p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Double p -> URec Double p -> Ordering Source # (<) :: URec Double p -> URec Double p -> Bool Source # (<=) :: URec Double p -> URec Double p -> Bool Source # (>) :: URec Double p -> URec Double p -> Bool Source # (>=) :: URec Double p -> URec Double p -> Bool Source # max :: URec Double p -> URec Double p -> URec Double p Source # min :: URec Double p -> URec Double p -> URec Double p Source #
Ord (URec Char p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Char p -> URec Char p -> Ordering Source # (<) :: URec Char p -> URec Char p -> Bool Source # (<=) :: URec Char p -> URec Char p -> Bool Source # (>) :: URec Char p -> URec Char p -> Bool Source # (>=) :: URec Char p -> URec Char p -> Bool Source # max :: URec Char p -> URec Char p -> URec Char p Source # min :: URec Char p -> URec Char p -> URec Char p Source #
Ord (URec (Ptr ()) p) # |
Instance details Defined in GHC.Generics Methods compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering Source # (<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # (<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # (>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # (>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool Source # max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p Source # min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p Source #
(Ord a, Ord b, Ord c) => Ord (a, b, c) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c) -> (a, b, c) -> Ordering Source # (<) :: (a, b, c) -> (a, b, c) -> Bool Source # (<=) :: (a, b, c) -> (a, b, c) -> Bool Source # (>) :: (a, b, c) -> (a, b, c) -> Bool Source # (>=) :: (a, b, c) -> (a, b, c) -> Bool Source # max :: (a, b, c) -> (a, b, c) -> (a, b, c) Source # min :: (a, b, c) -> (a, b, c) -> (a, b, c) Source #
Ord (a :~: b) # |
Instance details Defined in Data.Type.Equality Methods compare :: (a :~: b) -> (a :~: b) -> Ordering Source # (<) :: (a :~: b) -> (a :~: b) -> Bool Source # (<=) :: (a :~: b) -> (a :~: b) -> Bool Source # (>) :: (a :~: b) -> (a :~: b) -> Bool Source # (>=) :: (a :~: b) -> (a :~: b) -> Bool Source # max :: (a :~: b) -> (a :~: b) -> a :~: b Source # min :: (a :~: b) -> (a :~: b) -> a :~: b Source #
Ord (Coercion a b) # |
Instance details Defined in Data.Type.Coercion Methods compare :: Coercion a b -> Coercion a b -> Ordering Source # (<) :: Coercion a b -> Coercion a b -> Bool Source # (<=) :: Coercion a b -> Coercion a b -> Bool Source # (>) :: Coercion a b -> Coercion a b -> Bool Source # (>=) :: Coercion a b -> Coercion a b -> Bool Source # max :: Coercion a b -> Coercion a b -> Coercion a b Source # min :: Coercion a b -> Coercion a b -> Coercion a b Source #
Ord (f a) => Ord (Alt f a) # |
Instance details Defined in Data.Semigroup.Internal Methods compare :: Alt f a -> Alt f a -> Ordering Source # (<) :: Alt f a -> Alt f a -> Bool Source # (<=) :: Alt f a -> Alt f a -> Bool Source # (>) :: Alt f a -> Alt f a -> Bool Source # (>=) :: Alt f a -> Alt f a -> Bool Source # max :: Alt f a -> Alt f a -> Alt f a Source # min :: Alt f a -> Alt f a -> Alt f a Source #
Ord a => Ord (Const a b) # |
Instance details Defined in Data.Functor.Const Methods compare :: Const a b -> Const a b -> Ordering Source # (<) :: Const a b -> Const a b -> Bool Source # (<=) :: Const a b -> Const a b -> Bool Source # (>) :: Const a b -> Const a b -> Bool Source # (>=) :: Const a b -> Const a b -> Bool Source # max :: Const a b -> Const a b -> Const a b Source # min :: Const a b -> Const a b -> Const a b Source #
Ord c => Ord (K1 i c p) # |
Instance details Defined in GHC.Generics Methods compare :: K1 i c p -> K1 i c p -> Ordering Source # (<) :: K1 i c p -> K1 i c p -> Bool Source # (<=) :: K1 i c p -> K1 i c p -> Bool Source # (>) :: K1 i c p -> K1 i c p -> Bool Source # (>=) :: K1 i c p -> K1 i c p -> Bool Source # max :: K1 i c p -> K1 i c p -> K1 i c p Source # min :: K1 i c p -> K1 i c p -> K1 i c p Source #
(Ord (f p), Ord (g p)) => Ord ((f :+: g) p) # |
Instance details Defined in GHC.Generics Methods compare :: (f :+: g) p -> (f :+: g) p -> Ordering Source # (<) :: (f :+: g) p -> (f :+: g) p -> Bool Source # (<=) :: (f :+: g) p -> (f :+: g) p -> Bool Source # (>) :: (f :+: g) p -> (f :+: g) p -> Bool Source # (>=) :: (f :+: g) p -> (f :+: g) p -> Bool Source # max :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p Source # min :: (f :+: g) p -> (f :+: g) p -> (f :+: g) p Source #
(Ord (f p), Ord (g p)) => Ord ((f :*: g) p) # |
Instance details Defined in GHC.Generics Methods compare :: (f :*: g) p -> (f :*: g) p -> Ordering Source # (<) :: (f :*: g) p -> (f :*: g) p -> Bool Source # (<=) :: (f :*: g) p -> (f :*: g) p -> Bool Source # (>) :: (f :*: g) p -> (f :*: g) p -> Bool Source # (>=) :: (f :*: g) p -> (f :*: g) p -> Bool Source # max :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p Source # min :: (f :*: g) p -> (f :*: g) p -> (f :*: g) p Source #
(Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d) -> (a, b, c, d) -> Ordering Source # (<) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # (<=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # (>) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # (>=) :: (a, b, c, d) -> (a, b, c, d) -> Bool Source # max :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source # min :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #
Ord (a :~~: b) # | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods compare :: (a :~~: b) -> (a :~~: b) -> Ordering Source # (<) :: (a :~~: b) -> (a :~~: b) -> Bool Source # (<=) :: (a :~~: b) -> (a :~~: b) -> Bool Source # (>) :: (a :~~: b) -> (a :~~: b) -> Bool Source # (>=) :: (a :~~: b) -> (a :~~: b) -> Bool Source # max :: (a :~~: b) -> (a :~~: b) -> a :~~: b Source # min :: (a :~~: b) -> (a :~~: b) -> a :~~: b Source #
(Ord1 f, Ord1 g, Ord a) => Ord (Sum f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods compare :: Sum f g a -> Sum f g a -> Ordering Source # (<) :: Sum f g a -> Sum f g a -> Bool Source # (<=) :: Sum f g a -> Sum f g a -> Bool Source # (>) :: Sum f g a -> Sum f g a -> Bool Source # (>=) :: Sum f g a -> Sum f g a -> Bool Source # max :: Sum f g a -> Sum f g a -> Sum f g a Source # min :: Sum f g a -> Sum f g a -> Sum f g a Source #
(Ord1 f, Ord1 g, Ord a) => Ord (Product f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods compare :: Product f g a -> Product f g a -> Ordering Source # (<) :: Product f g a -> Product f g a -> Bool Source # (<=) :: Product f g a -> Product f g a -> Bool Source # (>) :: Product f g a -> Product f g a -> Bool Source # (>=) :: Product f g a -> Product f g a -> Bool Source # max :: Product f g a -> Product f g a -> Product f g a Source # min :: Product f g a -> Product f g a -> Product f g a Source #
Ord (f p) => Ord (M1 i c f p) # |
Instance details Defined in GHC.Generics Methods compare :: M1 i c f p -> M1 i c f p -> Ordering Source # (<) :: M1 i c f p -> M1 i c f p -> Bool Source # (<=) :: M1 i c f p -> M1 i c f p -> Bool Source # (>) :: M1 i c f p -> M1 i c f p -> Bool Source # (>=) :: M1 i c f p -> M1 i c f p -> Bool Source # max :: M1 i c f p -> M1 i c f p -> M1 i c f p Source # min :: M1 i c f p -> M1 i c f p -> M1 i c f p Source #
Ord (f (g p)) => Ord ((f :.: g) p) # |
Instance details Defined in GHC.Generics Methods compare :: (f :.: g) p -> (f :.: g) p -> Ordering Source # (<) :: (f :.: g) p -> (f :.: g) p -> Bool Source # (<=) :: (f :.: g) p -> (f :.: g) p -> Bool Source # (>) :: (f :.: g) p -> (f :.: g) p -> Bool Source # (>=) :: (f :.: g) p -> (f :.: g) p -> Bool Source # max :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p Source # min :: (f :.: g) p -> (f :.: g) p -> (f :.: g) p Source #
(Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering Source # (<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # (<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # (>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # (>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool Source # max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source # min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #
(Ord1 f, Ord1 g, Ord a) => Ord (Compose f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods compare :: Compose f g a -> Compose f g a -> Ordering Source # (<) :: Compose f g a -> Compose f g a -> Bool Source # (<=) :: Compose f g a -> Compose f g a -> Bool Source # (>) :: Compose f g a -> Compose f g a -> Bool Source # (>=) :: Compose f g a -> Compose f g a -> Bool Source # max :: Compose f g a -> Compose f g a -> Compose f g a Source # min :: Compose f g a -> Compose f g a -> Compose f g a Source #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering Source # (<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # (<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # (>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # (>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool Source # max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source # min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #
(Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) |
Instance details Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering Source # (<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # (<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # (>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # (>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool Source # max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source # min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #
(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 Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering Source # (<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # (<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # (>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # (>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool Source # 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) Source # 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) Source #
(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 Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Ordering Source # (<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # (<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # (>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # (>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool Source # 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) Source # 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) Source #
(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 Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Ordering Source # (<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # (<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # (>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # (>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool Source # 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) Source # 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) Source #
(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 Defined in GHC.Classes 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 Source # (<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # (<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # (>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # (>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool Source # 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) Source # 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) Source #
(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 Defined in GHC.Classes 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 Source # (<) :: (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 Source # (<=) :: (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 Source # (>) :: (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 Source # (>=) :: (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 Source # 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) Source # 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) Source #
(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 Defined in GHC.Classes 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 Source # (<) :: (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 Source # (<=) :: (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 Source # (>) :: (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 Source # (>=) :: (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 Source # 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) Source # 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) Source #
(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 Defined in GHC.Classes 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 Source # (<) :: (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 Source # (<=) :: (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 Source # (>) :: (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 Source # (>=) :: (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 Source # 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) Source # 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) Source #
(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 Defined in GHC.Classes 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 Source # (<) :: (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 Source # (<=) :: (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 Source # (>) :: (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 Source # (>=) :: (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 Source # 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) Source # 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) Source #

class Enum a where #

Class `Enum` defines operations on sequentially ordered types.

The `enumFrom`... methods are used in Haskell's translation of arithmetic sequences.

Instances of `Enum` may be derived for any enumeration type (types whose constructors have no fields). The nullary constructors are assumed to be numbered left-to-right by `fromEnum` from `0` through `n-1`. See Chapter 10 of the Haskell Report for more details.

For any type that is an instance of class `Bounded` as well as `Enum`, the following should hold:

- The calls ``succ` `maxBound`` and ``pred` `minBound`` should result in a runtime error.
- `fromEnum` and `toEnum` should give a runtime error if the result value is not representable in the result type. For example, ``toEnum` 7 :: `Bool`` is an error.
- `enumFrom` and `enumFromThen` should be defined with an implicit bound, thus:

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

Minimal complete definition

toEnum, fromEnum

Methods

succ :: a -> a #

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

pred :: a -> a #

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

toEnum :: Int -> a #

Convert from an `Int`.

fromEnum :: a -> Int #

Convert to an `Int`. It is implementation-dependent what `fromEnum` returns when applied to a value that is too large to fit in an `Int`.

enumFrom :: a -> [a] #

Used in Haskell's translation of `[n..]`.

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

Used in Haskell's translation of `[n,n'..]`.

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

Used in Haskell's translation of `[n..m]`.

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

Used in Haskell's translation of `[n,n'..m]`.

Instances

Enum Bool # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Bool -> Bool # pred :: Bool -> Bool # toEnum :: Int -> Bool # fromEnum :: Bool -> Int # enumFrom :: Bool -> [Bool] # enumFromThen :: Bool -> Bool -> [Bool] # enumFromTo :: Bool -> Bool -> [Bool] # enumFromThenTo :: Bool -> Bool -> Bool -> [Bool] #
Enum Char # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Char -> Char # pred :: Char -> Char # toEnum :: Int -> Char # fromEnum :: Char -> Int # enumFrom :: Char -> [Char] # enumFromThen :: Char -> Char -> [Char] # enumFromTo :: Char -> Char -> [Char] # enumFromThenTo :: Char -> Char -> Char -> [Char] #
Enum Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods succ :: Double -> Double # pred :: Double -> Double # toEnum :: Int -> Double # fromEnum :: Double -> Int # enumFrom :: Double -> [Double] # enumFromThen :: Double -> Double -> [Double] # enumFromTo :: Double -> Double -> [Double] # enumFromThenTo :: Double -> Double -> Double -> [Double] #
Enum Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods succ :: Float -> Float # pred :: Float -> Float # toEnum :: Int -> Float # fromEnum :: Float -> Int # enumFrom :: Float -> [Float] # enumFromThen :: Float -> Float -> [Float] # enumFromTo :: Float -> Float -> [Float] # enumFromThenTo :: Float -> Float -> Float -> [Float] #
Enum Int # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Int -> Int # pred :: Int -> Int # toEnum :: Int -> Int # fromEnum :: Int -> Int # enumFrom :: Int -> [Int] # enumFromThen :: Int -> Int -> [Int] # enumFromTo :: Int -> Int -> [Int] # enumFromThenTo :: Int -> Int -> Int -> [Int] #
Enum Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int8 -> Int8 # pred :: Int8 -> Int8 # toEnum :: Int -> Int8 # fromEnum :: Int8 -> Int # enumFrom :: Int8 -> [Int8] # enumFromThen :: Int8 -> Int8 -> [Int8] # enumFromTo :: Int8 -> Int8 -> [Int8] # enumFromThenTo :: Int8 -> Int8 -> Int8 -> [Int8] #
Enum Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int16 -> Int16 # pred :: Int16 -> Int16 # toEnum :: Int -> Int16 # fromEnum :: Int16 -> Int # enumFrom :: Int16 -> [Int16] # enumFromThen :: Int16 -> Int16 -> [Int16] # enumFromTo :: Int16 -> Int16 -> [Int16] # enumFromThenTo :: Int16 -> Int16 -> Int16 -> [Int16] #
Enum Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int32 -> Int32 # pred :: Int32 -> Int32 # toEnum :: Int -> Int32 # fromEnum :: Int32 -> Int # enumFrom :: Int32 -> [Int32] # enumFromThen :: Int32 -> Int32 -> [Int32] # enumFromTo :: Int32 -> Int32 -> [Int32] # enumFromThenTo :: Int32 -> Int32 -> Int32 -> [Int32] #
Enum Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods succ :: Int64 -> Int64 # pred :: Int64 -> Int64 # toEnum :: Int -> Int64 # fromEnum :: Int64 -> Int # enumFrom :: Int64 -> [Int64] # enumFromThen :: Int64 -> Int64 -> [Int64] # enumFromTo :: Int64 -> Int64 -> [Int64] # enumFromThenTo :: Int64 -> Int64 -> Int64 -> [Int64] #
Enum Integer # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Integer -> Integer # pred :: Integer -> Integer # toEnum :: Int -> Integer # fromEnum :: Integer -> Int # enumFrom :: Integer -> [Integer] # enumFromThen :: Integer -> Integer -> [Integer] # enumFromTo :: Integer -> Integer -> [Integer] # enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] #
Enum Natural # | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods succ :: Natural -> Natural # pred :: Natural -> Natural # toEnum :: Int -> Natural # fromEnum :: Natural -> Int # enumFrom :: Natural -> [Natural] # enumFromThen :: Natural -> Natural -> [Natural] # enumFromTo :: Natural -> Natural -> [Natural] # enumFromThenTo :: Natural -> Natural -> Natural -> [Natural] #
Enum Ordering # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Ordering -> Ordering # pred :: Ordering -> Ordering # toEnum :: Int -> Ordering # fromEnum :: Ordering -> Int # enumFrom :: Ordering -> [Ordering] # enumFromThen :: Ordering -> Ordering -> [Ordering] # enumFromTo :: Ordering -> Ordering -> [Ordering] # enumFromThenTo :: Ordering -> Ordering -> Ordering -> [Ordering] #
Enum Word # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Word -> Word # pred :: Word -> Word # toEnum :: Int -> Word # fromEnum :: Word -> Int # enumFrom :: Word -> [Word] # enumFromThen :: Word -> Word -> [Word] # enumFromTo :: Word -> Word -> [Word] # enumFromThenTo :: Word -> Word -> Word -> [Word] #
Enum Word8 # | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word8 -> Word8 # pred :: Word8 -> Word8 # toEnum :: Int -> Word8 # fromEnum :: Word8 -> Int # enumFrom :: Word8 -> [Word8] # enumFromThen :: Word8 -> Word8 -> [Word8] # enumFromTo :: Word8 -> Word8 -> [Word8] # enumFromThenTo :: Word8 -> Word8 -> Word8 -> [Word8] #
Enum Word16 # | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word16 -> Word16 # pred :: Word16 -> Word16 # toEnum :: Int -> Word16 # fromEnum :: Word16 -> Int # enumFrom :: Word16 -> [Word16] # enumFromThen :: Word16 -> Word16 -> [Word16] # enumFromTo :: Word16 -> Word16 -> [Word16] # enumFromThenTo :: Word16 -> Word16 -> Word16 -> [Word16] #
Enum Word32 # | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word32 -> Word32 # pred :: Word32 -> Word32 # toEnum :: Int -> Word32 # fromEnum :: Word32 -> Int # enumFrom :: Word32 -> [Word32] # enumFromThen :: Word32 -> Word32 -> [Word32] # enumFromTo :: Word32 -> Word32 -> [Word32] # enumFromThenTo :: Word32 -> Word32 -> Word32 -> [Word32] #
Enum Word64 # | Since: base-2.1
Instance details Defined in GHC.Word Methods succ :: Word64 -> Word64 # pred :: Word64 -> Word64 # toEnum :: Int -> Word64 # fromEnum :: Word64 -> Int # enumFrom :: Word64 -> [Word64] # enumFromThen :: Word64 -> Word64 -> [Word64] # enumFromTo :: Word64 -> Word64 -> [Word64] # enumFromThenTo :: Word64 -> Word64 -> Word64 -> [Word64] #
Enum VecCount # | Since: base-4.10.0.0
Instance details Defined in GHC.Enum Methods succ :: VecCount -> VecCount # pred :: VecCount -> VecCount # toEnum :: Int -> VecCount # fromEnum :: VecCount -> Int # enumFrom :: VecCount -> [VecCount] # enumFromThen :: VecCount -> VecCount -> [VecCount] # enumFromTo :: VecCount -> VecCount -> [VecCount] # enumFromThenTo :: VecCount -> VecCount -> VecCount -> [VecCount] #
Enum VecElem # | Since: base-4.10.0.0
Instance details Defined in GHC.Enum Methods succ :: VecElem -> VecElem # pred :: VecElem -> VecElem # toEnum :: Int -> VecElem # fromEnum :: VecElem -> Int # enumFrom :: VecElem -> [VecElem] # enumFromThen :: VecElem -> VecElem -> [VecElem] # enumFromTo :: VecElem -> VecElem -> [VecElem] # enumFromThenTo :: VecElem -> VecElem -> VecElem -> [VecElem] #
Enum () # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: () -> () # pred :: () -> () # toEnum :: Int -> () # fromEnum :: () -> Int # enumFrom :: () -> [()] # enumFromThen :: () -> () -> [()] # enumFromTo :: () -> () -> [()] # enumFromThenTo :: () -> () -> () -> [()] #
Enum GeneralCategory # |
Instance details Defined in GHC.Unicode Methods succ :: GeneralCategory -> GeneralCategory # pred :: GeneralCategory -> GeneralCategory # toEnum :: Int -> GeneralCategory # fromEnum :: GeneralCategory -> Int # enumFrom :: GeneralCategory -> [GeneralCategory] # enumFromThen :: GeneralCategory -> GeneralCategory -> [GeneralCategory] # enumFromTo :: GeneralCategory -> GeneralCategory -> [GeneralCategory] # enumFromThenTo :: GeneralCategory -> GeneralCategory -> GeneralCategory -> [GeneralCategory] #
Enum IOMode # |
Instance details Defined in GHC.IO.IOMode Methods succ :: IOMode -> IOMode # pred :: IOMode -> IOMode # toEnum :: Int -> IOMode # fromEnum :: IOMode -> Int # enumFrom :: IOMode -> [IOMode] # enumFromThen :: IOMode -> IOMode -> [IOMode] # enumFromTo :: IOMode -> IOMode -> [IOMode] # enumFromThenTo :: IOMode -> IOMode -> IOMode -> [IOMode] #
Enum IntPtr # |
Instance details Defined in Foreign.Ptr Methods succ :: IntPtr -> IntPtr # pred :: IntPtr -> IntPtr # toEnum :: Int -> IntPtr # fromEnum :: IntPtr -> Int # enumFrom :: IntPtr -> [IntPtr] # enumFromThen :: IntPtr -> IntPtr -> [IntPtr] # enumFromTo :: IntPtr -> IntPtr -> [IntPtr] # enumFromThenTo :: IntPtr -> IntPtr -> IntPtr -> [IntPtr] #
Enum WordPtr # |
Instance details Defined in Foreign.Ptr Methods succ :: WordPtr -> WordPtr # pred :: WordPtr -> WordPtr # toEnum :: Int -> WordPtr # fromEnum :: WordPtr -> Int # enumFrom :: WordPtr -> [WordPtr] # enumFromThen :: WordPtr -> WordPtr -> [WordPtr] # enumFromTo :: WordPtr -> WordPtr -> [WordPtr] # enumFromThenTo :: WordPtr -> WordPtr -> WordPtr -> [WordPtr] #
Enum CUIntMax # |
Instance details Defined in Foreign.C.Types Methods succ :: CUIntMax -> CUIntMax # pred :: CUIntMax -> CUIntMax # toEnum :: Int -> CUIntMax # fromEnum :: CUIntMax -> Int # enumFrom :: CUIntMax -> [CUIntMax] # enumFromThen :: CUIntMax -> CUIntMax -> [CUIntMax] # enumFromTo :: CUIntMax -> CUIntMax -> [CUIntMax] # enumFromThenTo :: CUIntMax -> CUIntMax -> CUIntMax -> [CUIntMax] #
Enum CIntMax # |
Instance details Defined in Foreign.C.Types Methods succ :: CIntMax -> CIntMax # pred :: CIntMax -> CIntMax # toEnum :: Int -> CIntMax # fromEnum :: CIntMax -> Int # enumFrom :: CIntMax -> [CIntMax] # enumFromThen :: CIntMax -> CIntMax -> [CIntMax] # enumFromTo :: CIntMax -> CIntMax -> [CIntMax] # enumFromThenTo :: CIntMax -> CIntMax -> CIntMax -> [CIntMax] #
Enum CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods succ :: CUIntPtr -> CUIntPtr # pred :: CUIntPtr -> CUIntPtr # toEnum :: Int -> CUIntPtr # fromEnum :: CUIntPtr -> Int # enumFrom :: CUIntPtr -> [CUIntPtr] # enumFromThen :: CUIntPtr -> CUIntPtr -> [CUIntPtr] # enumFromTo :: CUIntPtr -> CUIntPtr -> [CUIntPtr] # enumFromThenTo :: CUIntPtr -> CUIntPtr -> CUIntPtr -> [CUIntPtr] #
Enum CIntPtr # |
Instance details Defined in Foreign.C.Types Methods succ :: CIntPtr -> CIntPtr # pred :: CIntPtr -> CIntPtr # toEnum :: Int -> CIntPtr # fromEnum :: CIntPtr -> Int # enumFrom :: CIntPtr -> [CIntPtr] # enumFromThen :: CIntPtr -> CIntPtr -> [CIntPtr] # enumFromTo :: CIntPtr -> CIntPtr -> [CIntPtr] # enumFromThenTo :: CIntPtr -> CIntPtr -> CIntPtr -> [CIntPtr] #
Enum CSUSeconds # |
Instance details Defined in Foreign.C.Types Methods succ :: CSUSeconds -> CSUSeconds # pred :: CSUSeconds -> CSUSeconds # toEnum :: Int -> CSUSeconds # fromEnum :: CSUSeconds -> Int # enumFrom :: CSUSeconds -> [CSUSeconds] # enumFromThen :: CSUSeconds -> CSUSeconds -> [CSUSeconds] # enumFromTo :: CSUSeconds -> CSUSeconds -> [CSUSeconds] # enumFromThenTo :: CSUSeconds -> CSUSeconds -> CSUSeconds -> [CSUSeconds] #
Enum CUSeconds # |
Instance details Defined in Foreign.C.Types Methods succ :: CUSeconds -> CUSeconds # pred :: CUSeconds -> CUSeconds # toEnum :: Int -> CUSeconds # fromEnum :: CUSeconds -> Int # enumFrom :: CUSeconds -> [CUSeconds] # enumFromThen :: CUSeconds -> CUSeconds -> [CUSeconds] # enumFromTo :: CUSeconds -> CUSeconds -> [CUSeconds] # enumFromThenTo :: CUSeconds -> CUSeconds -> CUSeconds -> [CUSeconds] #
Enum CTime # |
Instance details Defined in Foreign.C.Types Methods succ :: CTime -> CTime # pred :: CTime -> CTime # toEnum :: Int -> CTime # fromEnum :: CTime -> Int # enumFrom :: CTime -> [CTime] # enumFromThen :: CTime -> CTime -> [CTime] # enumFromTo :: CTime -> CTime -> [CTime] # enumFromThenTo :: CTime -> CTime -> CTime -> [CTime] #
Enum CClock # |
Instance details Defined in Foreign.C.Types Methods succ :: CClock -> CClock # pred :: CClock -> CClock # toEnum :: Int -> CClock # fromEnum :: CClock -> Int # enumFrom :: CClock -> [CClock] # enumFromThen :: CClock -> CClock -> [CClock] # enumFromTo :: CClock -> CClock -> [CClock] # enumFromThenTo :: CClock -> CClock -> CClock -> [CClock] #
Enum CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods succ :: CSigAtomic -> CSigAtomic # pred :: CSigAtomic -> CSigAtomic # toEnum :: Int -> CSigAtomic # fromEnum :: CSigAtomic -> Int # enumFrom :: CSigAtomic -> [CSigAtomic] # enumFromThen :: CSigAtomic -> CSigAtomic -> [CSigAtomic] # enumFromTo :: CSigAtomic -> CSigAtomic -> [CSigAtomic] # enumFromThenTo :: CSigAtomic -> CSigAtomic -> CSigAtomic -> [CSigAtomic] #
Enum CWchar # |
Instance details Defined in Foreign.C.Types Methods succ :: CWchar -> CWchar # pred :: CWchar -> CWchar # toEnum :: Int -> CWchar # fromEnum :: CWchar -> Int # enumFrom :: CWchar -> [CWchar] # enumFromThen :: CWchar -> CWchar -> [CWchar] # enumFromTo :: CWchar -> CWchar -> [CWchar] # enumFromThenTo :: CWchar -> CWchar -> CWchar -> [CWchar] #
Enum CSize # |
Instance details Defined in Foreign.C.Types Methods succ :: CSize -> CSize # pred :: CSize -> CSize # toEnum :: Int -> CSize # fromEnum :: CSize -> Int # enumFrom :: CSize -> [CSize] # enumFromThen :: CSize -> CSize -> [CSize] # enumFromTo :: CSize -> CSize -> [CSize] # enumFromThenTo :: CSize -> CSize -> CSize -> [CSize] #
Enum CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods succ :: CPtrdiff -> CPtrdiff # pred :: CPtrdiff -> CPtrdiff # toEnum :: Int -> CPtrdiff # fromEnum :: CPtrdiff -> Int # enumFrom :: CPtrdiff -> [CPtrdiff] # enumFromThen :: CPtrdiff -> CPtrdiff -> [CPtrdiff] # enumFromTo :: CPtrdiff -> CPtrdiff -> [CPtrdiff] # enumFromThenTo :: CPtrdiff -> CPtrdiff -> CPtrdiff -> [CPtrdiff] #
Enum CDouble # |
Instance details Defined in Foreign.C.Types Methods succ :: CDouble -> CDouble # pred :: CDouble -> CDouble # toEnum :: Int -> CDouble # fromEnum :: CDouble -> Int # enumFrom :: CDouble -> [CDouble] # enumFromThen :: CDouble -> CDouble -> [CDouble] # enumFromTo :: CDouble -> CDouble -> [CDouble] # enumFromThenTo :: CDouble -> CDouble -> CDouble -> [CDouble] #
Enum CFloat # |
Instance details Defined in Foreign.C.Types Methods succ :: CFloat -> CFloat # pred :: CFloat -> CFloat # toEnum :: Int -> CFloat # fromEnum :: CFloat -> Int # enumFrom :: CFloat -> [CFloat] # enumFromThen :: CFloat -> CFloat -> [CFloat] # enumFromTo :: CFloat -> CFloat -> [CFloat] # enumFromThenTo :: CFloat -> CFloat -> CFloat -> [CFloat] #
Enum CBool # |
Instance details Defined in Foreign.C.Types Methods succ :: CBool -> CBool # pred :: CBool -> CBool # toEnum :: Int -> CBool # fromEnum :: CBool -> Int # enumFrom :: CBool -> [CBool] # enumFromThen :: CBool -> CBool -> [CBool] # enumFromTo :: CBool -> CBool -> [CBool] # enumFromThenTo :: CBool -> CBool -> CBool -> [CBool] #
Enum CULLong # |
Instance details Defined in Foreign.C.Types Methods succ :: CULLong -> CULLong # pred :: CULLong -> CULLong # toEnum :: Int -> CULLong # fromEnum :: CULLong -> Int # enumFrom :: CULLong -> [CULLong] # enumFromThen :: CULLong -> CULLong -> [CULLong] # enumFromTo :: CULLong -> CULLong -> [CULLong] # enumFromThenTo :: CULLong -> CULLong -> CULLong -> [CULLong] #
Enum CLLong # |
Instance details Defined in Foreign.C.Types Methods succ :: CLLong -> CLLong # pred :: CLLong -> CLLong # toEnum :: Int -> CLLong # fromEnum :: CLLong -> Int # enumFrom :: CLLong -> [CLLong] # enumFromThen :: CLLong -> CLLong -> [CLLong] # enumFromTo :: CLLong -> CLLong -> [CLLong] # enumFromThenTo :: CLLong -> CLLong -> CLLong -> [CLLong] #
Enum CULong # |
Instance details Defined in Foreign.C.Types Methods succ :: CULong -> CULong # pred :: CULong -> CULong # toEnum :: Int -> CULong # fromEnum :: CULong -> Int # enumFrom :: CULong -> [CULong] # enumFromThen :: CULong -> CULong -> [CULong] # enumFromTo :: CULong -> CULong -> [CULong] # enumFromThenTo :: CULong -> CULong -> CULong -> [CULong] #
Enum CLong # |
Instance details Defined in Foreign.C.Types Methods succ :: CLong -> CLong # pred :: CLong -> CLong # toEnum :: Int -> CLong # fromEnum :: CLong -> Int # enumFrom :: CLong -> [CLong] # enumFromThen :: CLong -> CLong -> [CLong] # enumFromTo :: CLong -> CLong -> [CLong] # enumFromThenTo :: CLong -> CLong -> CLong -> [CLong] #
Enum CUInt # |
Instance details Defined in Foreign.C.Types Methods succ :: CUInt -> CUInt # pred :: CUInt -> CUInt # toEnum :: Int -> CUInt # fromEnum :: CUInt -> Int # enumFrom :: CUInt -> [CUInt] # enumFromThen :: CUInt -> CUInt -> [CUInt] # enumFromTo :: CUInt -> CUInt -> [CUInt] # enumFromThenTo :: CUInt -> CUInt -> CUInt -> [CUInt] #
Enum CInt # |
Instance details Defined in Foreign.C.Types Methods succ :: CInt -> CInt # pred :: CInt -> CInt # toEnum :: Int -> CInt # fromEnum :: CInt -> Int # enumFrom :: CInt -> [CInt] # enumFromThen :: CInt -> CInt -> [CInt] # enumFromTo :: CInt -> CInt -> [CInt] # enumFromThenTo :: CInt -> CInt -> CInt -> [CInt] #
Enum CUShort # |
Instance details Defined in Foreign.C.Types Methods succ :: CUShort -> CUShort # pred :: CUShort -> CUShort # toEnum :: Int -> CUShort # fromEnum :: CUShort -> Int # enumFrom :: CUShort -> [CUShort] # enumFromThen :: CUShort -> CUShort -> [CUShort] # enumFromTo :: CUShort -> CUShort -> [CUShort] # enumFromThenTo :: CUShort -> CUShort -> CUShort -> [CUShort] #
Enum CShort # |
Instance details Defined in Foreign.C.Types Methods succ :: CShort -> CShort # pred :: CShort -> CShort # toEnum :: Int -> CShort # fromEnum :: CShort -> Int # enumFrom :: CShort -> [CShort] # enumFromThen :: CShort -> CShort -> [CShort] # enumFromTo :: CShort -> CShort -> [CShort] # enumFromThenTo :: CShort -> CShort -> CShort -> [CShort] #
Enum CUChar # |
Instance details Defined in Foreign.C.Types Methods succ :: CUChar -> CUChar # pred :: CUChar -> CUChar # toEnum :: Int -> CUChar # fromEnum :: CUChar -> Int # enumFrom :: CUChar -> [CUChar] # enumFromThen :: CUChar -> CUChar -> [CUChar] # enumFromTo :: CUChar -> CUChar -> [CUChar] # enumFromThenTo :: CUChar -> CUChar -> CUChar -> [CUChar] #
Enum CSChar # |
Instance details Defined in Foreign.C.Types Methods succ :: CSChar -> CSChar # pred :: CSChar -> CSChar # toEnum :: Int -> CSChar # fromEnum :: CSChar -> Int # enumFrom :: CSChar -> [CSChar] # enumFromThen :: CSChar -> CSChar -> [CSChar] # enumFromTo :: CSChar -> CSChar -> [CSChar] # enumFromThenTo :: CSChar -> CSChar -> CSChar -> [CSChar] #
Enum CChar # |
Instance details Defined in Foreign.C.Types Methods succ :: CChar -> CChar # pred :: CChar -> CChar # toEnum :: Int -> CChar # fromEnum :: CChar -> Int # enumFrom :: CChar -> [CChar] # enumFromThen :: CChar -> CChar -> [CChar] # enumFromTo :: CChar -> CChar -> [CChar] # enumFromThenTo :: CChar -> CChar -> CChar -> [CChar] #
Enum DecidedStrictness # |
Instance details Defined in GHC.Generics Methods succ :: DecidedStrictness -> DecidedStrictness # pred :: DecidedStrictness -> DecidedStrictness # toEnum :: Int -> DecidedStrictness # fromEnum :: DecidedStrictness -> Int # enumFrom :: DecidedStrictness -> [DecidedStrictness] # enumFromThen :: DecidedStrictness -> DecidedStrictness -> [DecidedStrictness] # enumFromTo :: DecidedStrictness -> DecidedStrictness -> [DecidedStrictness] # enumFromThenTo :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness -> [DecidedStrictness] #
Enum SourceStrictness # |
Instance details Defined in GHC.Generics Methods succ :: SourceStrictness -> SourceStrictness # pred :: SourceStrictness -> SourceStrictness # toEnum :: Int -> SourceStrictness # fromEnum :: SourceStrictness -> Int # enumFrom :: SourceStrictness -> [SourceStrictness] # enumFromThen :: SourceStrictness -> SourceStrictness -> [SourceStrictness] # enumFromTo :: SourceStrictness -> SourceStrictness -> [SourceStrictness] # enumFromThenTo :: SourceStrictness -> SourceStrictness -> SourceStrictness -> [SourceStrictness] #
Enum SourceUnpackedness # |
Instance details Defined in GHC.Generics Methods succ :: SourceUnpackedness -> SourceUnpackedness # pred :: SourceUnpackedness -> SourceUnpackedness # toEnum :: Int -> SourceUnpackedness # fromEnum :: SourceUnpackedness -> Int # enumFrom :: SourceUnpackedness -> [SourceUnpackedness] # enumFromThen :: SourceUnpackedness -> SourceUnpackedness -> [SourceUnpackedness] # enumFromTo :: SourceUnpackedness -> SourceUnpackedness -> [SourceUnpackedness] # enumFromThenTo :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness -> [SourceUnpackedness] #
Enum Associativity # |
Instance details Defined in GHC.Generics Methods succ :: Associativity -> Associativity # pred :: Associativity -> Associativity # toEnum :: Int -> Associativity # fromEnum :: Associativity -> Int # enumFrom :: Associativity -> [Associativity] # enumFromThen :: Associativity -> Associativity -> [Associativity] # enumFromTo :: Associativity -> Associativity -> [Associativity] # enumFromThenTo :: Associativity -> Associativity -> Associativity -> [Associativity] #
Enum SeekMode # |
Instance details Defined in GHC.IO.Device Methods succ :: SeekMode -> SeekMode # pred :: SeekMode -> SeekMode # toEnum :: Int -> SeekMode # fromEnum :: SeekMode -> Int # enumFrom :: SeekMode -> [SeekMode] # enumFromThen :: SeekMode -> SeekMode -> [SeekMode] # enumFromTo :: SeekMode -> SeekMode -> [SeekMode] # enumFromThenTo :: SeekMode -> SeekMode -> SeekMode -> [SeekMode] #
Enum Fd # |
Instance details Defined in System.Posix.Types Methods succ :: Fd -> Fd # pred :: Fd -> Fd # toEnum :: Int -> Fd # fromEnum :: Fd -> Int # enumFrom :: Fd -> [Fd] # enumFromThen :: Fd -> Fd -> [Fd] # enumFromTo :: Fd -> Fd -> [Fd] # enumFromThenTo :: Fd -> Fd -> Fd -> [Fd] #
Enum CKey # |
Instance details Defined in System.Posix.Types Methods succ :: CKey -> CKey # pred :: CKey -> CKey # toEnum :: Int -> CKey # fromEnum :: CKey -> Int # enumFrom :: CKey -> [CKey] # enumFromThen :: CKey -> CKey -> [CKey] # enumFromTo :: CKey -> CKey -> [CKey] # enumFromThenTo :: CKey -> CKey -> CKey -> [CKey] #
Enum CId # |
Instance details Defined in System.Posix.Types Methods succ :: CId -> CId # pred :: CId -> CId # toEnum :: Int -> CId # fromEnum :: CId -> Int # enumFrom :: CId -> [CId] # enumFromThen :: CId -> CId -> [CId] # enumFromTo :: CId -> CId -> [CId] # enumFromThenTo :: CId -> CId -> CId -> [CId] #
Enum CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods succ :: CFsFilCnt -> CFsFilCnt # pred :: CFsFilCnt -> CFsFilCnt # toEnum :: Int -> CFsFilCnt # fromEnum :: CFsFilCnt -> Int # enumFrom :: CFsFilCnt -> [CFsFilCnt] # enumFromThen :: CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] # enumFromTo :: CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] # enumFromThenTo :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt -> [CFsFilCnt] #
Enum CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods succ :: CFsBlkCnt -> CFsBlkCnt # pred :: CFsBlkCnt -> CFsBlkCnt # toEnum :: Int -> CFsBlkCnt # fromEnum :: CFsBlkCnt -> Int # enumFrom :: CFsBlkCnt -> [CFsBlkCnt] # enumFromThen :: CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] # enumFromTo :: CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] # enumFromThenTo :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt -> [CFsBlkCnt] #
Enum CClockId # |
Instance details Defined in System.Posix.Types Methods succ :: CClockId -> CClockId # pred :: CClockId -> CClockId # toEnum :: Int -> CClockId # fromEnum :: CClockId -> Int # enumFrom :: CClockId -> [CClockId] # enumFromThen :: CClockId -> CClockId -> [CClockId] # enumFromTo :: CClockId -> CClockId -> [CClockId] # enumFromThenTo :: CClockId -> CClockId -> CClockId -> [CClockId] #
Enum CBlkCnt # |
Instance details Defined in System.Posix.Types Methods succ :: CBlkCnt -> CBlkCnt # pred :: CBlkCnt -> CBlkCnt # toEnum :: Int -> CBlkCnt # fromEnum :: CBlkCnt -> Int # enumFrom :: CBlkCnt -> [CBlkCnt] # enumFromThen :: CBlkCnt -> CBlkCnt -> [CBlkCnt] # enumFromTo :: CBlkCnt -> CBlkCnt -> [CBlkCnt] # enumFromThenTo :: CBlkCnt -> CBlkCnt -> CBlkCnt -> [CBlkCnt] #
Enum CBlkSize # |
Instance details Defined in System.Posix.Types Methods succ :: CBlkSize -> CBlkSize # pred :: CBlkSize -> CBlkSize # toEnum :: Int -> CBlkSize # fromEnum :: CBlkSize -> Int # enumFrom :: CBlkSize -> [CBlkSize] # enumFromThen :: CBlkSize -> CBlkSize -> [CBlkSize] # enumFromTo :: CBlkSize -> CBlkSize -> [CBlkSize] # enumFromThenTo :: CBlkSize -> CBlkSize -> CBlkSize -> [CBlkSize] #
Enum CRLim # |
Instance details Defined in System.Posix.Types Methods succ :: CRLim -> CRLim # pred :: CRLim -> CRLim # toEnum :: Int -> CRLim # fromEnum :: CRLim -> Int # enumFrom :: CRLim -> [CRLim] # enumFromThen :: CRLim -> CRLim -> [CRLim] # enumFromTo :: CRLim -> CRLim -> [CRLim] # enumFromThenTo :: CRLim -> CRLim -> CRLim -> [CRLim] #
Enum CTcflag # |
Instance details Defined in System.Posix.Types Methods succ :: CTcflag -> CTcflag # pred :: CTcflag -> CTcflag # toEnum :: Int -> CTcflag # fromEnum :: CTcflag -> Int # enumFrom :: CTcflag -> [CTcflag] # enumFromThen :: CTcflag -> CTcflag -> [CTcflag] # enumFromTo :: CTcflag -> CTcflag -> [CTcflag] # enumFromThenTo :: CTcflag -> CTcflag -> CTcflag -> [CTcflag] #
Enum CSpeed # |
Instance details Defined in System.Posix.Types Methods succ :: CSpeed -> CSpeed # pred :: CSpeed -> CSpeed # toEnum :: Int -> CSpeed # fromEnum :: CSpeed -> Int # enumFrom :: CSpeed -> [CSpeed] # enumFromThen :: CSpeed -> CSpeed -> [CSpeed] # enumFromTo :: CSpeed -> CSpeed -> [CSpeed] # enumFromThenTo :: CSpeed -> CSpeed -> CSpeed -> [CSpeed] #
Enum CCc # |
Instance details Defined in System.Posix.Types Methods succ :: CCc -> CCc # pred :: CCc -> CCc # toEnum :: Int -> CCc # fromEnum :: CCc -> Int # enumFrom :: CCc -> [CCc] # enumFromThen :: CCc -> CCc -> [CCc] # enumFromTo :: CCc -> CCc -> [CCc] # enumFromThenTo :: CCc -> CCc -> CCc -> [CCc] #
Enum CUid # |
Instance details Defined in System.Posix.Types Methods succ :: CUid -> CUid # pred :: CUid -> CUid # toEnum :: Int -> CUid # fromEnum :: CUid -> Int # enumFrom :: CUid -> [CUid] # enumFromThen :: CUid -> CUid -> [CUid] # enumFromTo :: CUid -> CUid -> [CUid] # enumFromThenTo :: CUid -> CUid -> CUid -> [CUid] #
Enum CNlink # |
Instance details Defined in System.Posix.Types Methods succ :: CNlink -> CNlink # pred :: CNlink -> CNlink # toEnum :: Int -> CNlink # fromEnum :: CNlink -> Int # enumFrom :: CNlink -> [CNlink] # enumFromThen :: CNlink -> CNlink -> [CNlink] # enumFromTo :: CNlink -> CNlink -> [CNlink] # enumFromThenTo :: CNlink -> CNlink -> CNlink -> [CNlink] #
Enum CGid # |
Instance details Defined in System.Posix.Types Methods succ :: CGid -> CGid # pred :: CGid -> CGid # toEnum :: Int -> CGid # fromEnum :: CGid -> Int # enumFrom :: CGid -> [CGid] # enumFromThen :: CGid -> CGid -> [CGid] # enumFromTo :: CGid -> CGid -> [CGid] # enumFromThenTo :: CGid -> CGid -> CGid -> [CGid] #
Enum CSsize # |
Instance details Defined in System.Posix.Types Methods succ :: CSsize -> CSsize # pred :: CSsize -> CSsize # toEnum :: Int -> CSsize # fromEnum :: CSsize -> Int # enumFrom :: CSsize -> [CSsize] # enumFromThen :: CSsize -> CSsize -> [CSsize] # enumFromTo :: CSsize -> CSsize -> [CSsize] # enumFromThenTo :: CSsize -> CSsize -> CSsize -> [CSsize] #
Enum CPid # |
Instance details Defined in System.Posix.Types Methods succ :: CPid -> CPid # pred :: CPid -> CPid # toEnum :: Int -> CPid # fromEnum :: CPid -> Int # enumFrom :: CPid -> [CPid] # enumFromThen :: CPid -> CPid -> [CPid] # enumFromTo :: CPid -> CPid -> [CPid] # enumFromThenTo :: CPid -> CPid -> CPid -> [CPid] #
Enum COff # |
Instance details Defined in System.Posix.Types Methods succ :: COff -> COff # pred :: COff -> COff # toEnum :: Int -> COff # fromEnum :: COff -> Int # enumFrom :: COff -> [COff] # enumFromThen :: COff -> COff -> [COff] # enumFromTo :: COff -> COff -> [COff] # enumFromThenTo :: COff -> COff -> COff -> [COff] #
Enum CMode # |
Instance details Defined in System.Posix.Types Methods succ :: CMode -> CMode # pred :: CMode -> CMode # toEnum :: Int -> CMode # fromEnum :: CMode -> Int # enumFrom :: CMode -> [CMode] # enumFromThen :: CMode -> CMode -> [CMode] # enumFromTo :: CMode -> CMode -> [CMode] # enumFromThenTo :: CMode -> CMode -> CMode -> [CMode] #
Enum CIno # |
Instance details Defined in System.Posix.Types Methods succ :: CIno -> CIno # pred :: CIno -> CIno # toEnum :: Int -> CIno # fromEnum :: CIno -> Int # enumFrom :: CIno -> [CIno] # enumFromThen :: CIno -> CIno -> [CIno] # enumFromTo :: CIno -> CIno -> [CIno] # enumFromThenTo :: CIno -> CIno -> CIno -> [CIno] #
Enum CDev # |
Instance details Defined in System.Posix.Types Methods succ :: CDev -> CDev # pred :: CDev -> CDev # toEnum :: Int -> CDev # fromEnum :: CDev -> Int # enumFrom :: CDev -> [CDev] # enumFromThen :: CDev -> CDev -> [CDev] # enumFromTo :: CDev -> CDev -> [CDev] # enumFromThenTo :: CDev -> CDev -> CDev -> [CDev] #
Enum ByteOrder # |
Instance details Defined in GHC.ByteOrder Methods succ :: ByteOrder -> ByteOrder # pred :: ByteOrder -> ByteOrder # toEnum :: Int -> ByteOrder # fromEnum :: ByteOrder -> Int # enumFrom :: ByteOrder -> [ByteOrder] # enumFromThen :: ByteOrder -> ByteOrder -> [ByteOrder] # enumFromTo :: ByteOrder -> ByteOrder -> [ByteOrder] # enumFromThenTo :: ByteOrder -> ByteOrder -> ByteOrder -> [ByteOrder] #
Enum DoTrace # | Since: base-4.8.0.0
Instance details Defined in GHC.RTS.Flags Methods succ :: DoTrace -> DoTrace # pred :: DoTrace -> DoTrace # toEnum :: Int -> DoTrace # fromEnum :: DoTrace -> Int # enumFrom :: DoTrace -> [DoTrace] # enumFromThen :: DoTrace -> DoTrace -> [DoTrace] # enumFromTo :: DoTrace -> DoTrace -> [DoTrace] # enumFromThenTo :: DoTrace -> DoTrace -> DoTrace -> [DoTrace] #
Enum DoHeapProfile # | Since: base-4.8.0.0
Instance details Defined in GHC.RTS.Flags Methods succ :: DoHeapProfile -> DoHeapProfile # pred :: DoHeapProfile -> DoHeapProfile # toEnum :: Int -> DoHeapProfile # fromEnum :: DoHeapProfile -> Int # enumFrom :: DoHeapProfile -> [DoHeapProfile] # enumFromThen :: DoHeapProfile -> DoHeapProfile -> [DoHeapProfile] # enumFromTo :: DoHeapProfile -> DoHeapProfile -> [DoHeapProfile] # enumFromThenTo :: DoHeapProfile -> DoHeapProfile -> DoHeapProfile -> [DoHeapProfile] #
Enum DoCostCentres # | Since: base-4.8.0.0
Instance details Defined in GHC.RTS.Flags Methods succ :: DoCostCentres -> DoCostCentres # pred :: DoCostCentres -> DoCostCentres # toEnum :: Int -> DoCostCentres # fromEnum :: DoCostCentres -> Int # enumFrom :: DoCostCentres -> [DoCostCentres] # enumFromThen :: DoCostCentres -> DoCostCentres -> [DoCostCentres] # enumFromTo :: DoCostCentres -> DoCostCentres -> [DoCostCentres] # enumFromThenTo :: DoCostCentres -> DoCostCentres -> DoCostCentres -> [DoCostCentres] #
Enum GiveGCStats # | Since: base-4.8.0.0
Instance details Defined in GHC.RTS.Flags Methods succ :: GiveGCStats -> GiveGCStats # pred :: GiveGCStats -> GiveGCStats # toEnum :: Int -> GiveGCStats # fromEnum :: GiveGCStats -> Int # enumFrom :: GiveGCStats -> [GiveGCStats] # enumFromThen :: GiveGCStats -> GiveGCStats -> [GiveGCStats] # enumFromTo :: GiveGCStats -> GiveGCStats -> [GiveGCStats] # enumFromThenTo :: GiveGCStats -> GiveGCStats -> GiveGCStats -> [GiveGCStats] #
Integral a => Enum (Ratio a) # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods succ :: Ratio a -> Ratio a # pred :: Ratio a -> Ratio a # toEnum :: Int -> Ratio a # fromEnum :: Ratio a -> Int # enumFrom :: Ratio a -> [Ratio a] # enumFromThen :: Ratio a -> Ratio a -> [Ratio a] # enumFromTo :: Ratio a -> Ratio a -> [Ratio a] # enumFromThenTo :: Ratio a -> Ratio a -> Ratio a -> [Ratio a] #
Enum a => Enum (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods succ :: Identity a -> Identity a # pred :: Identity a -> Identity a # toEnum :: Int -> Identity a # fromEnum :: Identity a -> Int # enumFrom :: Identity a -> [Identity a] # enumFromThen :: Identity a -> Identity a -> [Identity a] # enumFromTo :: Identity a -> Identity a -> [Identity a] # enumFromThenTo :: Identity a -> Identity a -> Identity a -> [Identity a] #
Enum a => Enum (WrappedMonoid a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: WrappedMonoid a -> WrappedMonoid a # pred :: WrappedMonoid a -> WrappedMonoid a # toEnum :: Int -> WrappedMonoid a # fromEnum :: WrappedMonoid a -> Int # enumFrom :: WrappedMonoid a -> [WrappedMonoid a] # enumFromThen :: WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] # enumFromTo :: WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] # enumFromThenTo :: WrappedMonoid a -> WrappedMonoid a -> WrappedMonoid a -> [WrappedMonoid a] #
Enum a => Enum (Last a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Last a -> Last a # pred :: Last a -> Last a # toEnum :: Int -> Last a # fromEnum :: Last a -> Int # enumFrom :: Last a -> [Last a] # enumFromThen :: Last a -> Last a -> [Last a] # enumFromTo :: Last a -> Last a -> [Last a] # enumFromThenTo :: Last a -> Last a -> Last a -> [Last a] #
Enum a => Enum (First a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: First a -> First a # pred :: First a -> First a # toEnum :: Int -> First a # fromEnum :: First a -> Int # enumFrom :: First a -> [First a] # enumFromThen :: First a -> First a -> [First a] # enumFromTo :: First a -> First a -> [First a] # enumFromThenTo :: First a -> First a -> First a -> [First a] #
Enum a => Enum (Max a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Max a -> Max a # pred :: Max a -> Max a # toEnum :: Int -> Max a # fromEnum :: Max a -> Int # enumFrom :: Max a -> [Max a] # enumFromThen :: Max a -> Max a -> [Max a] # enumFromTo :: Max a -> Max a -> [Max a] # enumFromThenTo :: Max a -> Max a -> Max a -> [Max a] #
Enum a => Enum (Min a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods succ :: Min a -> Min a # pred :: Min a -> Min a # toEnum :: Int -> Min a # fromEnum :: Min a -> Int # enumFrom :: Min a -> [Min a] # enumFromThen :: Min a -> Min a -> [Min a] # enumFromTo :: Min a -> Min a -> [Min a] # enumFromThenTo :: Min a -> Min a -> Min a -> [Min a] #
Enum (Fixed a) # | Since: base-2.1
Instance details Defined in Data.Fixed Methods succ :: Fixed a -> Fixed a # pred :: Fixed a -> Fixed a # toEnum :: Int -> Fixed a # fromEnum :: Fixed a -> Int # enumFrom :: Fixed a -> [Fixed a] # enumFromThen :: Fixed a -> Fixed a -> [Fixed a] # enumFromTo :: Fixed a -> Fixed a -> [Fixed a] # enumFromThenTo :: Fixed a -> Fixed a -> Fixed a -> [Fixed a] #
Enum (Proxy s) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods succ :: Proxy s -> Proxy s # pred :: Proxy s -> Proxy s # toEnum :: Int -> Proxy s # fromEnum :: Proxy s -> Int # enumFrom :: Proxy s -> [Proxy s] # enumFromThen :: Proxy s -> Proxy s -> [Proxy s] # enumFromTo :: Proxy s -> Proxy s -> [Proxy s] # enumFromThenTo :: Proxy s -> Proxy s -> Proxy s -> [Proxy s] #
a ~ b => Enum (a :~: b) # | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods succ :: (a :~: b) -> a :~: b # pred :: (a :~: b) -> a :~: b # toEnum :: Int -> a :~: b # fromEnum :: (a :~: b) -> Int # enumFrom :: (a :~: b) -> [a :~: b] # enumFromThen :: (a :~: b) -> (a :~: b) -> [a :~: b] # enumFromTo :: (a :~: b) -> (a :~: b) -> [a :~: b] # enumFromThenTo :: (a :~: b) -> (a :~: b) -> (a :~: b) -> [a :~: b] #
Coercible a b => Enum (Coercion a b) # | Since: base-4.7.0.0
Instance details Defined in Data.Type.Coercion Methods succ :: Coercion a b -> Coercion a b # pred :: Coercion a b -> Coercion a b # toEnum :: Int -> Coercion a b # fromEnum :: Coercion a b -> Int # enumFrom :: Coercion a b -> [Coercion a b] # enumFromThen :: Coercion a b -> Coercion a b -> [Coercion a b] # enumFromTo :: Coercion a b -> Coercion a b -> [Coercion a b] # enumFromThenTo :: Coercion a b -> Coercion a b -> Coercion a b -> [Coercion a b] #
Enum (f a) => Enum (Alt f a) # |
Instance details Defined in Data.Semigroup.Internal Methods succ :: Alt f a -> Alt f a # pred :: Alt f a -> Alt f a # toEnum :: Int -> Alt f a # fromEnum :: Alt f a -> Int # enumFrom :: Alt f a -> [Alt f a] # enumFromThen :: Alt f a -> Alt f a -> [Alt f a] # enumFromTo :: Alt f a -> Alt f a -> [Alt f a] # enumFromThenTo :: Alt f a -> Alt f a -> Alt f a -> [Alt f a] #
Enum a => Enum (Const a b) # |
Instance details Defined in Data.Functor.Const Methods succ :: Const a b -> Const a b # pred :: Const a b -> Const a b # toEnum :: Int -> Const a b # fromEnum :: Const a b -> Int # enumFrom :: Const a b -> [Const a b] # enumFromThen :: Const a b -> Const a b -> [Const a b] # enumFromTo :: Const a b -> Const a b -> [Const a b] # enumFromThenTo :: Const a b -> Const a b -> Const a b -> [Const a b] #
a ~~ b => Enum (a :~~: b) # | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods succ :: (a :~~: b) -> a :~~: b # pred :: (a :~~: b) -> a :~~: b # toEnum :: Int -> a :~~: b # fromEnum :: (a :~~: b) -> Int # enumFrom :: (a :~~: b) -> [a :~~: b] # enumFromThen :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] # enumFromTo :: (a :~~: b) -> (a :~~: b) -> [a :~~: b] # enumFromThenTo :: (a :~~: b) -> (a :~~: b) -> (a :~~: b) -> [a :~~: b] #

class Bounded a where #

The `Bounded` class is used to name the upper and lower limits of a type. `Ord` is not a superclass of `Bounded` since types that are not totally ordered may also have upper and lower bounds.

The `Bounded` class may be derived for any enumeration type; `minBound` is the first constructor listed in the `data` declaration and `maxBound` is the last. `Bounded` may also be derived for single-constructor datatypes whose constituent types are in `Bounded`.

Minimal complete definition

minBound, maxBound

Methods

minBound :: a #

maxBound :: a #

Instances

Bounded Bool # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Bool # maxBound :: Bool #
Bounded Char # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Char # maxBound :: Char #
Bounded Int # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Int # maxBound :: Int #
Bounded Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int8 # maxBound :: Int8 #
Bounded Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int16 # maxBound :: Int16 #
Bounded Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int32 # maxBound :: Int32 #
Bounded Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods minBound :: Int64 # maxBound :: Int64 #
Bounded Ordering # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Ordering # maxBound :: Ordering #
Bounded Word # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Word # maxBound :: Word #
Bounded Word8 # | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word8 # maxBound :: Word8 #
Bounded Word16 # | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word16 # maxBound :: Word16 #
Bounded Word32 # | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word32 # maxBound :: Word32 #
Bounded Word64 # | Since: base-2.1
Instance details Defined in GHC.Word Methods minBound :: Word64 # maxBound :: Word64 #
Bounded VecCount # | Since: base-4.10.0.0
Instance details Defined in GHC.Enum Methods minBound :: VecCount # maxBound :: VecCount #
Bounded VecElem # | Since: base-4.10.0.0
Instance details Defined in GHC.Enum Methods minBound :: VecElem # maxBound :: VecElem #
Bounded () # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: () # maxBound :: () #
Bounded GeneralCategory # |
Instance details Defined in GHC.Unicode Methods minBound :: GeneralCategory # maxBound :: GeneralCategory #
Bounded IntPtr # |
Instance details Defined in Foreign.Ptr Methods minBound :: IntPtr # maxBound :: IntPtr #
Bounded WordPtr # |
Instance details Defined in Foreign.Ptr Methods minBound :: WordPtr # maxBound :: WordPtr #
Bounded CUIntMax # |
Instance details Defined in Foreign.C.Types Methods minBound :: CUIntMax # maxBound :: CUIntMax #
Bounded CIntMax # |
Instance details Defined in Foreign.C.Types Methods minBound :: CIntMax # maxBound :: CIntMax #
Bounded CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods minBound :: CUIntPtr # maxBound :: CUIntPtr #
Bounded CIntPtr # |
Instance details Defined in Foreign.C.Types Methods minBound :: CIntPtr # maxBound :: CIntPtr #
Bounded CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods minBound :: CSigAtomic # maxBound :: CSigAtomic #
Bounded CWchar # |
Instance details Defined in Foreign.C.Types Methods minBound :: CWchar # maxBound :: CWchar #
Bounded CSize # |
Instance details Defined in Foreign.C.Types Methods minBound :: CSize # maxBound :: CSize #
Bounded CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods minBound :: CPtrdiff # maxBound :: CPtrdiff #
Bounded CBool # |
Instance details Defined in Foreign.C.Types Methods minBound :: CBool # maxBound :: CBool #
Bounded CULLong # |
Instance details Defined in Foreign.C.Types Methods minBound :: CULLong # maxBound :: CULLong #
Bounded CLLong # |
Instance details Defined in Foreign.C.Types Methods minBound :: CLLong # maxBound :: CLLong #
Bounded CULong # |
Instance details Defined in Foreign.C.Types Methods minBound :: CULong # maxBound :: CULong #
Bounded CLong # |
Instance details Defined in Foreign.C.Types Methods minBound :: CLong # maxBound :: CLong #
Bounded CUInt # |
Instance details Defined in Foreign.C.Types Methods minBound :: CUInt # maxBound :: CUInt #
Bounded CInt # |
Instance details Defined in Foreign.C.Types Methods minBound :: CInt # maxBound :: CInt #
Bounded CUShort # |
Instance details Defined in Foreign.C.Types Methods minBound :: CUShort # maxBound :: CUShort #
Bounded CShort # |
Instance details Defined in Foreign.C.Types Methods minBound :: CShort # maxBound :: CShort #
Bounded CUChar # |
Instance details Defined in Foreign.C.Types Methods minBound :: CUChar # maxBound :: CUChar #
Bounded CSChar # |
Instance details Defined in Foreign.C.Types Methods minBound :: CSChar # maxBound :: CSChar #
Bounded CChar # |
Instance details Defined in Foreign.C.Types Methods minBound :: CChar # maxBound :: CChar #
Bounded DecidedStrictness # |
Instance details Defined in GHC.Generics Methods minBound :: DecidedStrictness # maxBound :: DecidedStrictness #
Bounded SourceStrictness # |
Instance details Defined in GHC.Generics Methods minBound :: SourceStrictness # maxBound :: SourceStrictness #
Bounded SourceUnpackedness # |
Instance details Defined in GHC.Generics Methods minBound :: SourceUnpackedness # maxBound :: SourceUnpackedness #
Bounded Associativity # |
Instance details Defined in GHC.Generics Methods minBound :: Associativity # maxBound :: Associativity #
Bounded Any # |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Any # maxBound :: Any #
Bounded All # |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: All # maxBound :: All #
Bounded Fd # |
Instance details Defined in System.Posix.Types Methods minBound :: Fd # maxBound :: Fd #
Bounded CKey # |
Instance details Defined in System.Posix.Types Methods minBound :: CKey # maxBound :: CKey #
Bounded CId # |
Instance details Defined in System.Posix.Types Methods minBound :: CId # maxBound :: CId #
Bounded CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods minBound :: CFsFilCnt # maxBound :: CFsFilCnt #
Bounded CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods minBound :: CFsBlkCnt # maxBound :: CFsBlkCnt #
Bounded CClockId # |
Instance details Defined in System.Posix.Types Methods minBound :: CClockId # maxBound :: CClockId #
Bounded CBlkCnt # |
Instance details Defined in System.Posix.Types Methods minBound :: CBlkCnt # maxBound :: CBlkCnt #
Bounded CBlkSize # |
Instance details Defined in System.Posix.Types Methods minBound :: CBlkSize # maxBound :: CBlkSize #
Bounded CRLim # |
Instance details Defined in System.Posix.Types Methods minBound :: CRLim # maxBound :: CRLim #
Bounded CTcflag # |
Instance details Defined in System.Posix.Types Methods minBound :: CTcflag # maxBound :: CTcflag #
Bounded CUid # |
Instance details Defined in System.Posix.Types Methods minBound :: CUid # maxBound :: CUid #
Bounded CNlink # |
Instance details Defined in System.Posix.Types Methods minBound :: CNlink # maxBound :: CNlink #
Bounded CGid # |
Instance details Defined in System.Posix.Types Methods minBound :: CGid # maxBound :: CGid #
Bounded CSsize # |
Instance details Defined in System.Posix.Types Methods minBound :: CSsize # maxBound :: CSsize #
Bounded CPid # |
Instance details Defined in System.Posix.Types Methods minBound :: CPid # maxBound :: CPid #
Bounded COff # |
Instance details Defined in System.Posix.Types Methods minBound :: COff # maxBound :: COff #
Bounded CMode # |
Instance details Defined in System.Posix.Types Methods minBound :: CMode # maxBound :: CMode #
Bounded CIno # |
Instance details Defined in System.Posix.Types Methods minBound :: CIno # maxBound :: CIno #
Bounded CDev # |
Instance details Defined in System.Posix.Types Methods minBound :: CDev # maxBound :: CDev #
Bounded ByteOrder # |
Instance details Defined in GHC.ByteOrder Methods minBound :: ByteOrder # maxBound :: ByteOrder #
Bounded a => Bounded (Product a) # |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Product a # maxBound :: Product a #
Bounded a => Bounded (Sum a) # |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Sum a # maxBound :: Sum a #
Bounded a => Bounded (Dual a) # |
Instance details Defined in Data.Semigroup.Internal Methods minBound :: Dual a # maxBound :: Dual a #
Bounded a => Bounded (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods minBound :: Identity a # maxBound :: Identity a #
Bounded m => Bounded (WrappedMonoid m) # |
Instance details Defined in Data.Semigroup Methods minBound :: WrappedMonoid m # maxBound :: WrappedMonoid m #
Bounded a => Bounded (Last a) # |
Instance details Defined in Data.Semigroup Methods minBound :: Last a # maxBound :: Last a #
Bounded a => Bounded (First a) # |
Instance details Defined in Data.Semigroup Methods minBound :: First a # maxBound :: First a #
Bounded a => Bounded (Max a) # |
Instance details Defined in Data.Semigroup Methods minBound :: Max a # maxBound :: Max a #
Bounded a => Bounded (Min a) # |
Instance details Defined in Data.Semigroup Methods minBound :: Min a # maxBound :: Min a #
(Bounded a, Bounded b) => Bounded (a, b) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b) # maxBound :: (a, b) #
Bounded (Proxy t) # |
Instance details Defined in Data.Proxy Methods minBound :: Proxy t # maxBound :: Proxy t #
(Bounded a, Bounded b, Bounded c) => Bounded (a, b, c) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c) # maxBound :: (a, b, c) #
a ~ b => Bounded (a :~: b) # | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods minBound :: a :~: b # maxBound :: a :~: b #
Coercible a b => Bounded (Coercion a b) # | Since: base-4.7.0.0
Instance details Defined in Data.Type.Coercion Methods minBound :: Coercion a b # maxBound :: Coercion a b #
Bounded a => Bounded (Const a b) # |
Instance details Defined in Data.Functor.Const Methods minBound :: Const a b # maxBound :: Const a b #
(Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d) # maxBound :: (a, b, c, d) #
a ~~ b => Bounded (a :~~: b) # | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods minBound :: a :~~: b # maxBound :: a :~~: b #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e) # maxBound :: (a, b, c, d, e) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f) => Bounded (a, b, c, d, e, f) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f) # maxBound :: (a, b, c, d, e, f) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g) => Bounded (a, b, c, d, e, f, g) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g) # maxBound :: (a, b, c, d, e, f, g) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h) => Bounded (a, b, c, d, e, f, g, h) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h) # maxBound :: (a, b, c, d, e, f, g, h) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i) => Bounded (a, b, c, d, e, f, g, h, i) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i) # maxBound :: (a, b, c, d, e, f, g, h, i) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j) => Bounded (a, b, c, d, e, f, g, h, i, j) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j) # maxBound :: (a, b, c, d, e, f, g, h, i, j) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k) => Bounded (a, b, c, d, e, f, g, h, i, j, k) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k, l) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) #
(Bounded a, Bounded b, Bounded c, Bounded d, Bounded e, Bounded f, Bounded g, Bounded h, Bounded i, Bounded j, Bounded k, Bounded l, Bounded m, Bounded n, Bounded o) => Bounded (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

## Numbers

### Numeric types

data Int Source #

A fixed-precision integer type with at least the range `[-2^29 .. 2^29-1]`. The exact range for a given implementation can be determined by using `minBound` and `maxBound` from the `Bounded` class.

Instances

Bounded Int # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Int # maxBound :: Int #
Enum Int # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Int -> Int # pred :: Int -> Int # toEnum :: Int -> Int # fromEnum :: Int -> Int # enumFrom :: Int -> [Int] # enumFromThen :: Int -> Int -> [Int] # enumFromTo :: Int -> Int -> [Int] # enumFromThenTo :: Int -> Int -> Int -> [Int] #
Eq Int |
Instance details Defined in GHC.Classes Methods (==) :: Int -> Int -> Bool Source # (/=) :: Int -> Int -> Bool Source #
Integral Int # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods quot :: Int -> Int -> Int # rem :: Int -> Int -> Int # div :: Int -> Int -> Int # mod :: Int -> Int -> Int # quotRem :: Int -> Int -> (Int, Int) # divMod :: Int -> Int -> (Int, Int) # toInteger :: Int -> Integer #
Data Int # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Int -> c Int # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Int # toConstr :: Int -> Constr # dataTypeOf :: Int -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Int) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Int) # gmapT :: (forall b. Data b => b -> b) -> Int -> Int # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Int -> r # gmapQ :: (forall d. Data d => d -> u) -> Int -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Int -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Int -> m Int # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Int -> m Int #
Num Int # | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Int -> Int -> Int # (-) :: Int -> Int -> Int # (*) :: Int -> Int -> Int # negate :: Int -> Int # abs :: Int -> Int # signum :: Int -> Int # fromInteger :: Integer -> Int #
Ord Int |
Instance details Defined in GHC.Classes Methods compare :: Int -> Int -> Ordering Source # (<) :: Int -> Int -> Bool Source # (<=) :: Int -> Int -> Bool Source # (>) :: Int -> Int -> Bool Source # (>=) :: Int -> Int -> Bool Source # max :: Int -> Int -> Int Source # min :: Int -> Int -> Int Source #
Read Int # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Int # readList :: ReadS [Int] # readPrec :: ReadPrec Int # readListPrec :: ReadPrec [Int] #
Real Int # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Int -> Rational #
Show Int # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Int -> ShowS # show :: Int -> String # showList :: [Int] -> ShowS #
Ix Int # | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Int, Int) -> [Int] # index :: (Int, Int) -> Int -> Int # unsafeIndex :: (Int, Int) -> Int -> Int inRange :: (Int, Int) -> Int -> Bool # rangeSize :: (Int, Int) -> Int # unsafeRangeSize :: (Int, Int) -> Int
FiniteBits Int # | Since: base-4.6.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Int -> Int # countLeadingZeros :: Int -> Int # countTrailingZeros :: Int -> Int #
Bits Int # | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Int -> Int -> Int # (.|.) :: Int -> Int -> Int # xor :: Int -> Int -> Int # complement :: Int -> Int # shift :: Int -> Int -> Int # rotate :: Int -> Int -> Int # zeroBits :: Int # bit :: Int -> Int # setBit :: Int -> Int -> Int # clearBit :: Int -> Int -> Int # complementBit :: Int -> Int -> Int # testBit :: Int -> Int -> Bool # bitSizeMaybe :: Int -> Maybe Int # bitSize :: Int -> Int # isSigned :: Int -> Bool # shiftL :: Int -> Int -> Int # unsafeShiftL :: Int -> Int -> Int # shiftR :: Int -> Int -> Int # unsafeShiftR :: Int -> Int -> Int # rotateL :: Int -> Int -> Int # rotateR :: Int -> Int -> Int # popCount :: Int -> Int #
Storable Int # | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Int -> Int # alignment :: Int -> Int # peekElemOff :: Ptr Int -> Int -> IO Int # pokeElemOff :: Ptr Int -> Int -> Int -> IO () # peekByteOff :: Ptr b -> Int -> IO Int # pokeByteOff :: Ptr b -> Int -> Int -> IO () # peek :: Ptr Int -> IO Int # poke :: Ptr Int -> Int -> IO () #
PrintfArg Int # | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Int -> FieldFormatter # parseFormat :: Int -> ModifierParser #
Generic1 (URec Int :: k -> *) # |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Int) :: k -> * # Methods from1 :: URec Int a -> Rep1 (URec Int) a # to1 :: Rep1 (URec Int) a -> URec Int a #
Functor (URec Int :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Int a -> URec Int b # (<$) :: a -> URec Int b -> URec Int a #
Foldable (URec Int :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Int m -> m # foldMap :: Monoid m => (a -> m) -> URec Int a -> m # foldr :: (a -> b -> b) -> b -> URec Int a -> b # foldr' :: (a -> b -> b) -> b -> URec Int a -> b # foldl :: (b -> a -> b) -> b -> URec Int a -> b # foldl' :: (b -> a -> b) -> b -> URec Int a -> b # foldr1 :: (a -> a -> a) -> URec Int a -> a # foldl1 :: (a -> a -> a) -> URec Int a -> a # toList :: URec Int a -> [a] # null :: URec Int a -> Bool # length :: URec Int a -> Int # elem :: Eq a => a -> URec Int a -> Bool # maximum :: Ord a => URec Int a -> a # minimum :: Ord a => URec Int a -> a # sum :: Num a => URec Int a -> a # product :: Num a => URec Int a -> a #
Traversable (URec Int :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Int a -> f (URec Int b) # sequenceA :: Applicative f => URec Int (f a) -> f (URec Int a) # mapM :: Monad m => (a -> m b) -> URec Int a -> m (URec Int b) # sequence :: Monad m => URec Int (m a) -> m (URec Int a) #
Eq (URec Int p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Int p -> URec Int p -> Bool Source # (/=) :: URec Int p -> URec Int p -> Bool Source #
Ord (URec Int p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Int p -> URec Int p -> Ordering Source # (<) :: URec Int p -> URec Int p -> Bool Source # (<=) :: URec Int p -> URec Int p -> Bool Source # (>) :: URec Int p -> URec Int p -> Bool Source # (>=) :: URec Int p -> URec Int p -> Bool Source # max :: URec Int p -> URec Int p -> URec Int p Source # min :: URec Int p -> URec Int p -> URec Int p Source #
Show (URec Int p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Int p -> ShowS # show :: URec Int p -> String # showList :: [URec Int p] -> ShowS #
Generic (URec Int p) # |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Int p) :: * -> * # Methods from :: URec Int p -> Rep (URec Int p) x # to :: Rep (URec Int p) x -> URec Int p #
data URec Int (p :: k) # | Used for marking occurrences of `Int#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Int (p :: k) = UInt { uInt# :: Int# }
type Rep1 (URec Int :: k -> *) # |
Instance details Defined in GHC.Generics 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) # |
Instance details Defined in GHC.Generics type Rep (URec Int p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UInt" PrefixI True) (S1 (MetaSel (Just "uInt#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UInt :: * -> *)))

data Integer Source #

Invariant: `Jn#` and `Jp#` are used iff value doesn't fit in `S#`

Useful properties resulting from the invariants:

-     abs (S# _) <= abs (Jp# _)

-     abs (S# _) <  abs (Jn# _)

Instances

Enum Integer # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Integer -> Integer # pred :: Integer -> Integer # toEnum :: Int -> Integer # fromEnum :: Integer -> Int # enumFrom :: Integer -> [Integer] # enumFromThen :: Integer -> Integer -> [Integer] # enumFromTo :: Integer -> Integer -> [Integer] # enumFromThenTo :: Integer -> Integer -> Integer -> [Integer] #
Eq Integer |
Instance details Defined in GHC.Integer.Type Methods (==) :: Integer -> Integer -> Bool Source # (/=) :: Integer -> Integer -> Bool Source #
Integral Integer # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods quot :: Integer -> Integer -> Integer # rem :: Integer -> Integer -> Integer # div :: Integer -> Integer -> Integer # mod :: Integer -> Integer -> Integer # quotRem :: Integer -> Integer -> (Integer, Integer) # divMod :: Integer -> Integer -> (Integer, Integer) # toInteger :: Integer -> Integer #
Data Integer # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Integer -> c Integer # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Integer # toConstr :: Integer -> Constr # dataTypeOf :: Integer -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Integer) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Integer) # gmapT :: (forall b. Data b => b -> b) -> Integer -> Integer # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Integer -> r # gmapQ :: (forall d. Data d => d -> u) -> Integer -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Integer -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Integer -> m Integer #
Num Integer # | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Integer -> Integer -> Integer # (-) :: Integer -> Integer -> Integer # (*) :: Integer -> Integer -> Integer # negate :: Integer -> Integer # abs :: Integer -> Integer # signum :: Integer -> Integer # fromInteger :: Integer -> Integer #
Ord Integer |
Instance details Defined in GHC.Integer.Type Methods compare :: Integer -> Integer -> Ordering Source # (<) :: Integer -> Integer -> Bool Source # (<=) :: Integer -> Integer -> Bool Source # (>) :: Integer -> Integer -> Bool Source # (>=) :: Integer -> Integer -> Bool Source # max :: Integer -> Integer -> Integer Source # min :: Integer -> Integer -> Integer Source #
Read Integer # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Integer # readList :: ReadS [Integer] # readPrec :: ReadPrec Integer # readListPrec :: ReadPrec [Integer] #
Real Integer # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Integer -> Rational #
Show Integer # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Integer -> ShowS # show :: Integer -> String # showList :: [Integer] -> ShowS #
Ix Integer # | Since: base-2.1
Instance details Defined in GHC.Arr Methods range :: (Integer, Integer) -> [Integer] # index :: (Integer, Integer) -> Integer -> Int # unsafeIndex :: (Integer, Integer) -> Integer -> Int inRange :: (Integer, Integer) -> Integer -> Bool # rangeSize :: (Integer, Integer) -> Int # unsafeRangeSize :: (Integer, Integer) -> Int
Bits Integer # | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Integer -> Integer -> Integer # (.|.) :: Integer -> Integer -> Integer # xor :: Integer -> Integer -> Integer # complement :: Integer -> Integer # shift :: Integer -> Int -> Integer # rotate :: Integer -> Int -> Integer # zeroBits :: Integer # bit :: Int -> Integer # setBit :: Integer -> Int -> Integer # clearBit :: Integer -> Int -> Integer # complementBit :: Integer -> Int -> Integer # testBit :: Integer -> Int -> Bool # bitSizeMaybe :: Integer -> Maybe Int # bitSize :: Integer -> Int # isSigned :: Integer -> Bool # shiftL :: Integer -> Int -> Integer # unsafeShiftL :: Integer -> Int -> Integer # shiftR :: Integer -> Int -> Integer # unsafeShiftR :: Integer -> Int -> Integer # rotateL :: Integer -> Int -> Integer # rotateR :: Integer -> Int -> Integer # popCount :: Integer -> Int #
PrintfArg Integer # | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Integer -> FieldFormatter # parseFormat :: Integer -> ModifierParser #

data Float Source #

Single-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE single-precision type.

Instances

Enum Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods succ :: Float -> Float # pred :: Float -> Float # toEnum :: Int -> Float # fromEnum :: Float -> Int # enumFrom :: Float -> [Float] # enumFromThen :: Float -> Float -> [Float] # enumFromTo :: Float -> Float -> [Float] # enumFromThenTo :: Float -> Float -> Float -> [Float] #
Eq Float |
Instance details Defined in GHC.Classes Methods (==) :: Float -> Float -> Bool Source # (/=) :: Float -> Float -> Bool Source #
Floating Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Float # exp :: Float -> Float # log :: Float -> Float # sqrt :: Float -> Float # (**) :: Float -> Float -> Float # logBase :: Float -> Float -> Float # sin :: Float -> Float # cos :: Float -> Float # tan :: Float -> Float # asin :: Float -> Float # acos :: Float -> Float # atan :: Float -> Float # sinh :: Float -> Float # cosh :: Float -> Float # tanh :: Float -> Float # asinh :: Float -> Float # acosh :: Float -> Float # atanh :: Float -> Float # log1p :: Float -> Float # expm1 :: Float -> Float # log1pexp :: Float -> Float # log1mexp :: Float -> Float #
Fractional Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods (/) :: Float -> Float -> Float # recip :: Float -> Float # fromRational :: Rational -> Float #
Data Float # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Float -> c Float # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Float # toConstr :: Float -> Constr # dataTypeOf :: Float -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Float) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Float) # gmapT :: (forall b. Data b => b -> b) -> Float -> Float # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Float -> r # gmapQ :: (forall d. Data d => d -> u) -> Float -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Float -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Float -> m Float #
Num Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods (+) :: Float -> Float -> Float # (-) :: Float -> Float -> Float # (*) :: Float -> Float -> Float # negate :: Float -> Float # abs :: Float -> Float # signum :: Float -> Float # fromInteger :: Integer -> Float #
Ord Float |
Instance details Defined in GHC.Classes Methods compare :: Float -> Float -> Ordering Source # (<) :: Float -> Float -> Bool Source # (<=) :: Float -> Float -> Bool Source # (>) :: Float -> Float -> Bool Source # (>=) :: Float -> Float -> Bool Source # max :: Float -> Float -> Float Source # min :: Float -> Float -> Float Source #
Read Float # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Float # readList :: ReadS [Float] # readPrec :: ReadPrec Float # readListPrec :: ReadPrec [Float] #
Real Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods toRational :: Float -> Rational #
RealFloat Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Float -> Integer # floatDigits :: Float -> Int # floatRange :: Float -> (Int, Int) # decodeFloat :: Float -> (Integer, Int) # encodeFloat :: Integer -> Int -> Float # exponent :: Float -> Int # significand :: Float -> Float # scaleFloat :: Int -> Float -> Float # isNaN :: Float -> Bool # isInfinite :: Float -> Bool # isDenormalized :: Float -> Bool # isNegativeZero :: Float -> Bool # isIEEE :: Float -> Bool # atan2 :: Float -> Float -> Float #
RealFrac Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods properFraction :: Integral b => Float -> (b, Float) # truncate :: Integral b => Float -> b # round :: Integral b => Float -> b # ceiling :: Integral b => Float -> b # floor :: Integral b => Float -> b #
Show Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods showsPrec :: Int -> Float -> ShowS # show :: Float -> String # showList :: [Float] -> ShowS #
Storable Float # | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Float -> Int # alignment :: Float -> Int # peekElemOff :: Ptr Float -> Int -> IO Float # pokeElemOff :: Ptr Float -> Int -> Float -> IO () # peekByteOff :: Ptr b -> Int -> IO Float # pokeByteOff :: Ptr b -> Int -> Float -> IO () # peek :: Ptr Float -> IO Float # poke :: Ptr Float -> Float -> IO () #
PrintfArg Float # | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Float -> FieldFormatter # parseFormat :: Float -> ModifierParser #
Generic1 (URec Float :: k -> *) # |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Float) :: k -> * # Methods from1 :: URec Float a -> Rep1 (URec Float) a # to1 :: Rep1 (URec Float) a -> URec Float a #
Functor (URec Float :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Float a -> URec Float b # (<$) :: a -> URec Float b -> URec Float a #
Foldable (URec Float :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Float m -> m # foldMap :: Monoid m => (a -> m) -> URec Float a -> m # foldr :: (a -> b -> b) -> b -> URec Float a -> b # foldr' :: (a -> b -> b) -> b -> URec Float a -> b # foldl :: (b -> a -> b) -> b -> URec Float a -> b # foldl' :: (b -> a -> b) -> b -> URec Float a -> b # foldr1 :: (a -> a -> a) -> URec Float a -> a # foldl1 :: (a -> a -> a) -> URec Float a -> a # toList :: URec Float a -> [a] # null :: URec Float a -> Bool # length :: URec Float a -> Int # elem :: Eq a => a -> URec Float a -> Bool # maximum :: Ord a => URec Float a -> a # minimum :: Ord a => URec Float a -> a # sum :: Num a => URec Float a -> a # product :: Num a => URec Float a -> a #
Traversable (URec Float :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) # sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) # mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) # sequence :: Monad m => URec Float (m a) -> m (URec Float a) #
Eq (URec Float p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Float p -> URec Float p -> Bool Source # (/=) :: URec Float p -> URec Float p -> Bool Source #
Ord (URec Float p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Float p -> URec Float p -> Ordering Source # (<) :: URec Float p -> URec Float p -> Bool Source # (<=) :: URec Float p -> URec Float p -> Bool Source # (>) :: URec Float p -> URec Float p -> Bool Source # (>=) :: URec Float p -> URec Float p -> Bool Source # max :: URec Float p -> URec Float p -> URec Float p Source # min :: URec Float p -> URec Float p -> URec Float p Source #
Show (URec Float p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Float p -> ShowS # show :: URec Float p -> String # showList :: [URec Float p] -> ShowS #
Generic (URec Float p) # |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Float p) :: * -> * # Methods from :: URec Float p -> Rep (URec Float p) x # to :: Rep (URec Float p) x -> URec Float p #
data URec Float (p :: k) # | Used for marking occurrences of `Float#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Float (p :: k) = UFloat { uFloat# :: Float# }
type Rep1 (URec Float :: k -> *) # |
Instance details Defined in GHC.Generics 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) # |
Instance details Defined in GHC.Generics type Rep (URec Float p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UFloat" PrefixI True) (S1 (MetaSel (Just "uFloat#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UFloat :: * -> *)))

data Double Source #

Double-precision floating point numbers. It is desirable that this type be at least equal in range and precision to the IEEE double-precision type.

Instances

Enum Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods succ :: Double -> Double # pred :: Double -> Double # toEnum :: Int -> Double # fromEnum :: Double -> Int # enumFrom :: Double -> [Double] # enumFromThen :: Double -> Double -> [Double] # enumFromTo :: Double -> Double -> [Double] # enumFromThenTo :: Double -> Double -> Double -> [Double] #
Eq Double |
Instance details Defined in GHC.Classes Methods (==) :: Double -> Double -> Bool Source # (/=) :: Double -> Double -> Bool Source #
Floating Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Double # exp :: Double -> Double # log :: Double -> Double # sqrt :: Double -> Double # (**) :: Double -> Double -> Double # logBase :: Double -> Double -> Double # sin :: Double -> Double # cos :: Double -> Double # tan :: Double -> Double # asin :: Double -> Double # acos :: Double -> Double # atan :: Double -> Double # sinh :: Double -> Double # cosh :: Double -> Double # tanh :: Double -> Double # asinh :: Double -> Double # acosh :: Double -> Double # atanh :: Double -> Double # log1p :: Double -> Double # expm1 :: Double -> Double # log1pexp :: Double -> Double # log1mexp :: Double -> Double #
Fractional Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods (/) :: Double -> Double -> Double # recip :: Double -> Double # fromRational :: Rational -> Double #
Data Double # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Double -> c Double # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Double # toConstr :: Double -> Constr # dataTypeOf :: Double -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Double) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Double) # gmapT :: (forall b. Data b => b -> b) -> Double -> Double # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Double -> r # gmapQ :: (forall d. Data d => d -> u) -> Double -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Double -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Double -> m Double #
Num Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods (+) :: Double -> Double -> Double # (-) :: Double -> Double -> Double # (*) :: Double -> Double -> Double # negate :: Double -> Double # abs :: Double -> Double # signum :: Double -> Double # fromInteger :: Integer -> Double #
Ord Double |
Instance details Defined in GHC.Classes Methods compare :: Double -> Double -> Ordering Source # (<) :: Double -> Double -> Bool Source # (<=) :: Double -> Double -> Bool Source # (>) :: Double -> Double -> Bool Source # (>=) :: Double -> Double -> Bool Source # max :: Double -> Double -> Double Source # min :: Double -> Double -> Double Source #
Read Double # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Double # readList :: ReadS [Double] # readPrec :: ReadPrec Double # readListPrec :: ReadPrec [Double] #
Real Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods toRational :: Double -> Rational #
RealFloat Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Double -> Integer # floatDigits :: Double -> Int # floatRange :: Double -> (Int, Int) # decodeFloat :: Double -> (Integer, Int) # encodeFloat :: Integer -> Int -> Double # exponent :: Double -> Int # significand :: Double -> Double # scaleFloat :: Int -> Double -> Double # isNaN :: Double -> Bool # isInfinite :: Double -> Bool # isDenormalized :: Double -> Bool # isNegativeZero :: Double -> Bool # isIEEE :: Double -> Bool # atan2 :: Double -> Double -> Double #
RealFrac Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods properFraction :: Integral b => Double -> (b, Double) # truncate :: Integral b => Double -> b # round :: Integral b => Double -> b # ceiling :: Integral b => Double -> b # floor :: Integral b => Double -> b #
Show Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods showsPrec :: Int -> Double -> ShowS # show :: Double -> String # showList :: [Double] -> ShowS #
Storable Double # | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Double -> Int # alignment :: Double -> Int # peekElemOff :: Ptr Double -> Int -> IO Double # pokeElemOff :: Ptr Double -> Int -> Double -> IO () # peekByteOff :: Ptr b -> Int -> IO Double # pokeByteOff :: Ptr b -> Int -> Double -> IO () # peek :: Ptr Double -> IO Double # poke :: Ptr Double -> Double -> IO () #
PrintfArg Double # | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Double -> FieldFormatter # parseFormat :: Double -> ModifierParser #
Generic1 (URec Double :: k -> *) # |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Double) :: k -> * # Methods from1 :: URec Double a -> Rep1 (URec Double) a # to1 :: Rep1 (URec Double) a -> URec Double a #
Functor (URec Double :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Double a -> URec Double b # (<$) :: a -> URec Double b -> URec Double a #
Foldable (URec Double :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Double m -> m # foldMap :: Monoid m => (a -> m) -> URec Double a -> m # foldr :: (a -> b -> b) -> b -> URec Double a -> b # foldr' :: (a -> b -> b) -> b -> URec Double a -> b # foldl :: (b -> a -> b) -> b -> URec Double a -> b # foldl' :: (b -> a -> b) -> b -> URec Double a -> b # foldr1 :: (a -> a -> a) -> URec Double a -> a # foldl1 :: (a -> a -> a) -> URec Double a -> a # toList :: URec Double a -> [a] # null :: URec Double a -> Bool # length :: URec Double a -> Int # elem :: Eq a => a -> URec Double a -> Bool # maximum :: Ord a => URec Double a -> a # minimum :: Ord a => URec Double a -> a # sum :: Num a => URec Double a -> a # product :: Num a => URec Double a -> a #
Traversable (URec Double :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) # sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) # mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) # sequence :: Monad m => URec Double (m a) -> m (URec Double a) #
Eq (URec Double p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Double p -> URec Double p -> Bool Source # (/=) :: URec Double p -> URec Double p -> Bool Source #
Ord (URec Double p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Double p -> URec Double p -> Ordering Source # (<) :: URec Double p -> URec Double p -> Bool Source # (<=) :: URec Double p -> URec Double p -> Bool Source # (>) :: URec Double p -> URec Double p -> Bool Source # (>=) :: URec Double p -> URec Double p -> Bool Source # max :: URec Double p -> URec Double p -> URec Double p Source # min :: URec Double p -> URec Double p -> URec Double p Source #
Show (URec Double p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Double p -> ShowS # show :: URec Double p -> String # showList :: [URec Double p] -> ShowS #
Generic (URec Double p) # |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Double p) :: * -> * # Methods from :: URec Double p -> Rep (URec Double p) x # to :: Rep (URec Double p) x -> URec Double p #
data URec Double (p :: k) # | Used for marking occurrences of `Double#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Double (p :: k) = UDouble { uDouble# :: Double# }
type Rep1 (URec Double :: k -> *) # |
Instance details Defined in GHC.Generics 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) # |
Instance details Defined in GHC.Generics type Rep (URec Double p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UDouble" PrefixI True) (S1 (MetaSel (Just "uDouble#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UDouble :: * -> *)))

type Rational = Ratio Integer #

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

data Word Source #

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

Instances

Bounded Word # | Since: base-2.1
Instance details Defined in GHC.Enum Methods minBound :: Word # maxBound :: Word #
Enum Word # | Since: base-2.1
Instance details Defined in GHC.Enum Methods succ :: Word -> Word # pred :: Word -> Word # toEnum :: Int -> Word # fromEnum :: Word -> Int # enumFrom :: Word -> [Word] # enumFromThen :: Word -> Word -> [Word] # enumFromTo :: Word -> Word -> [Word] # enumFromThenTo :: Word -> Word -> Word -> [Word] #
Eq Word |
Instance details Defined in GHC.Classes Methods (==) :: Word -> Word -> Bool Source # (/=) :: Word -> Word -> Bool Source #
Integral Word # | Since: base-2.1
Instance details Defined in GHC.Real Methods quot :: Word -> Word -> Word # rem :: Word -> Word -> Word # div :: Word -> Word -> Word # mod :: Word -> Word -> Word # quotRem :: Word -> Word -> (Word, Word) # divMod :: Word -> Word -> (Word, Word) # toInteger :: Word -> Integer #
Data Word # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Word -> c Word # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Word # toConstr :: Word -> Constr # dataTypeOf :: Word -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Word) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Word) # gmapT :: (forall b. Data b => b -> b) -> Word -> Word # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Word -> r # gmapQ :: (forall d. Data d => d -> u) -> Word -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Word -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Word -> m Word #
Num Word # | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Word -> Word -> Word # (-) :: Word -> Word -> Word # (*) :: Word -> Word -> Word # negate :: Word -> Word # abs :: Word -> Word # signum :: Word -> Word # fromInteger :: Integer -> Word #
Ord Word |
Instance details Defined in GHC.Classes Methods compare :: Word -> Word -> Ordering Source # (<) :: Word -> Word -> Bool Source # (<=) :: Word -> Word -> Bool Source # (>) :: Word -> Word -> Bool Source # (>=) :: Word -> Word -> Bool Source # max :: Word -> Word -> Word Source # min :: Word -> Word -> Word Source #
Read Word # | Since: base-4.5.0.0
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word # readList :: ReadS [Word] # readPrec :: ReadPrec Word # readListPrec :: ReadPrec [Word] #
Real Word # | Since: base-2.1
Instance details Defined in GHC.Real Methods toRational :: Word -> Rational #
Show Word # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Word -> ShowS # show :: Word -> String # showList :: [Word] -> ShowS #
Ix Word # | Since: base-4.6.0.0
Instance details Defined in GHC.Arr Methods range :: (Word, Word) -> [Word] # index :: (Word, Word) -> Word -> Int # unsafeIndex :: (Word, Word) -> Word -> Int inRange :: (Word, Word) -> Word -> Bool # rangeSize :: (Word, Word) -> Int # unsafeRangeSize :: (Word, Word) -> Int
FiniteBits Word # | Since: base-4.6.0.0
Instance details Defined in Data.Bits Methods finiteBitSize :: Word -> Int # countLeadingZeros :: Word -> Int # countTrailingZeros :: Word -> Int #
Bits Word # | Since: base-2.1
Instance details Defined in Data.Bits Methods (.&.) :: Word -> Word -> Word # (.|.) :: Word -> Word -> Word # xor :: Word -> Word -> Word # complement :: Word -> Word # shift :: Word -> Int -> Word # rotate :: Word -> Int -> Word # zeroBits :: Word # bit :: Int -> Word # setBit :: Word -> Int -> Word # clearBit :: Word -> Int -> Word # complementBit :: Word -> Int -> Word # testBit :: Word -> Int -> Bool # bitSizeMaybe :: Word -> Maybe Int # bitSize :: Word -> Int # isSigned :: Word -> Bool # shiftL :: Word -> Int -> Word # unsafeShiftL :: Word -> Int -> Word # shiftR :: Word -> Int -> Word # unsafeShiftR :: Word -> Int -> Word # rotateL :: Word -> Int -> Word # rotateR :: Word -> Int -> Word # popCount :: Word -> Int #
Storable Word # | Since: base-2.1
Instance details Defined in Foreign.Storable Methods sizeOf :: Word -> Int # alignment :: Word -> Int # peekElemOff :: Ptr Word -> Int -> IO Word # pokeElemOff :: Ptr Word -> Int -> Word -> IO () # peekByteOff :: Ptr b -> Int -> IO Word # pokeByteOff :: Ptr b -> Int -> Word -> IO () # peek :: Ptr Word -> IO Word # poke :: Ptr Word -> Word -> IO () #
PrintfArg Word # | Since: base-2.1
Instance details Defined in Text.Printf Methods formatArg :: Word -> FieldFormatter # parseFormat :: Word -> ModifierParser #
Generic1 (URec Word :: k -> *) # |
Instance details Defined in GHC.Generics Associated Types type Rep1 (URec Word) :: k -> * # Methods from1 :: URec Word a -> Rep1 (URec Word) a # to1 :: Rep1 (URec Word) a -> URec Word a #
Functor (URec Word :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Word a -> URec Word b # (<$) :: a -> URec Word b -> URec Word a #
Foldable (URec Word :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Word m -> m # foldMap :: Monoid m => (a -> m) -> URec Word a -> m # foldr :: (a -> b -> b) -> b -> URec Word a -> b # foldr' :: (a -> b -> b) -> b -> URec Word a -> b # foldl :: (b -> a -> b) -> b -> URec Word a -> b # foldl' :: (b -> a -> b) -> b -> URec Word a -> b # foldr1 :: (a -> a -> a) -> URec Word a -> a # foldl1 :: (a -> a -> a) -> URec Word a -> a # toList :: URec Word a -> [a] # null :: URec Word a -> Bool # length :: URec Word a -> Int # elem :: Eq a => a -> URec Word a -> Bool # maximum :: Ord a => URec Word a -> a # minimum :: Ord a => URec Word a -> a # sum :: Num a => URec Word a -> a # product :: Num a => URec Word a -> a #
Traversable (URec Word :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) # sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) # mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) # sequence :: Monad m => URec Word (m a) -> m (URec Word a) #
Eq (URec Word p) # |
Instance details Defined in GHC.Generics Methods (==) :: URec Word p -> URec Word p -> Bool Source # (/=) :: URec Word p -> URec Word p -> Bool Source #
Ord (URec Word p) # |
Instance details Defined in GHC.Generics Methods compare :: URec Word p -> URec Word p -> Ordering Source # (<) :: URec Word p -> URec Word p -> Bool Source # (<=) :: URec Word p -> URec Word p -> Bool Source # (>) :: URec Word p -> URec Word p -> Bool Source # (>=) :: URec Word p -> URec Word p -> Bool Source # max :: URec Word p -> URec Word p -> URec Word p Source # min :: URec Word p -> URec Word p -> URec Word p Source #
Show (URec Word p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Word p -> ShowS # show :: URec Word p -> String # showList :: [URec Word p] -> ShowS #
Generic (URec Word p) # |
Instance details Defined in GHC.Generics Associated Types type Rep (URec Word p) :: * -> * # Methods from :: URec Word p -> Rep (URec Word p) x # to :: Rep (URec Word p) x -> URec Word p #
data URec Word (p :: k) # | Used for marking occurrences of `Word#` Since: base-4.9.0.0
Instance details Defined in GHC.Generics data URec Word (p :: k) = UWord { uWord# :: Word# }
type Rep1 (URec Word :: k -> *) # |
Instance details Defined in GHC.Generics 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) # |
Instance details Defined in GHC.Generics type Rep (URec Word p) = D1 (MetaData "URec" "GHC.Generics" "base" False) (C1 (MetaCons "UWord" PrefixI True) (S1 (MetaSel (Just "uWord#") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (UWord :: * -> *)))

### Numeric type classes

class Num a where #

Basic numeric class.

Minimal complete definition

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

Methods

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

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

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

negate :: a -> a #

Unary negation.

abs :: a -> a #

Absolute value.

signum :: a -> a #

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 #

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 # | Since: base-2.1
Instance details Defined in GHC.Float Methods (+) :: Double -> Double -> Double # (-) :: Double -> Double -> Double # (*) :: Double -> Double -> Double # negate :: Double -> Double # abs :: Double -> Double # signum :: Double -> Double # fromInteger :: Integer -> Double #
Num Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods (+) :: Float -> Float -> Float # (-) :: Float -> Float -> Float # (*) :: Float -> Float -> Float # negate :: Float -> Float # abs :: Float -> Float # signum :: Float -> Float # fromInteger :: Integer -> Float #
Num Int # | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Int -> Int -> Int # (-) :: Int -> Int -> Int # (*) :: Int -> Int -> Int # negate :: Int -> Int # abs :: Int -> Int # signum :: Int -> Int # fromInteger :: Integer -> Int #
Num Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int8 -> Int8 -> Int8 # (-) :: Int8 -> Int8 -> Int8 # (*) :: Int8 -> Int8 -> Int8 # negate :: Int8 -> Int8 # abs :: Int8 -> Int8 # signum :: Int8 -> Int8 # fromInteger :: Integer -> Int8 #
Num Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int16 -> Int16 -> Int16 # (-) :: Int16 -> Int16 -> Int16 # (*) :: Int16 -> Int16 -> Int16 # negate :: Int16 -> Int16 # abs :: Int16 -> Int16 # signum :: Int16 -> Int16 # fromInteger :: Integer -> Int16 #
Num Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int32 -> Int32 -> Int32 # (-) :: Int32 -> Int32 -> Int32 # (*) :: Int32 -> Int32 -> Int32 # negate :: Int32 -> Int32 # abs :: Int32 -> Int32 # signum :: Int32 -> Int32 # fromInteger :: Integer -> Int32 #
Num Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods (+) :: Int64 -> Int64 -> Int64 # (-) :: Int64 -> Int64 -> Int64 # (*) :: Int64 -> Int64 -> Int64 # negate :: Int64 -> Int64 # abs :: Int64 -> Int64 # signum :: Int64 -> Int64 # fromInteger :: Integer -> Int64 #
Num Integer # | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Integer -> Integer -> Integer # (-) :: Integer -> Integer -> Integer # (*) :: Integer -> Integer -> Integer # negate :: Integer -> Integer # abs :: Integer -> Integer # signum :: Integer -> Integer # fromInteger :: Integer -> Integer #
Num Natural # | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods (+) :: Natural -> Natural -> Natural # (-) :: Natural -> Natural -> Natural # (*) :: Natural -> Natural -> Natural # negate :: Natural -> Natural # abs :: Natural -> Natural # signum :: Natural -> Natural # fromInteger :: Integer -> Natural #
Num Word # | Since: base-2.1
Instance details Defined in GHC.Num Methods (+) :: Word -> Word -> Word # (-) :: Word -> Word -> Word # (*) :: Word -> Word -> Word # negate :: Word -> Word # abs :: Word -> Word # signum :: Word -> Word # fromInteger :: Integer -> Word #
Num Word8 # | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word8 -> Word8 -> Word8 # (-) :: Word8 -> Word8 -> Word8 # (*) :: Word8 -> Word8 -> Word8 # negate :: Word8 -> Word8 # abs :: Word8 -> Word8 # signum :: Word8 -> Word8 # fromInteger :: Integer -> Word8 #
Num Word16 # | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word16 -> Word16 -> Word16 # (-) :: Word16 -> Word16 -> Word16 # (*) :: Word16 -> Word16 -> Word16 # negate :: Word16 -> Word16 # abs :: Word16 -> Word16 # signum :: Word16 -> Word16 # fromInteger :: Integer -> Word16 #
Num Word32 # | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word32 -> Word32 -> Word32 # (-) :: Word32 -> Word32 -> Word32 # (*) :: Word32 -> Word32 -> Word32 # negate :: Word32 -> Word32 # abs :: Word32 -> Word32 # signum :: Word32 -> Word32 # fromInteger :: Integer -> Word32 #
Num Word64 # | Since: base-2.1
Instance details Defined in GHC.Word Methods (+) :: Word64 -> Word64 -> Word64 # (-) :: Word64 -> Word64 -> Word64 # (*) :: Word64 -> Word64 -> Word64 # negate :: Word64 -> Word64 # abs :: Word64 -> Word64 # signum :: Word64 -> Word64 # fromInteger :: Integer -> Word64 #
Num IntPtr # |
Instance details Defined in Foreign.Ptr Methods (+) :: IntPtr -> IntPtr -> IntPtr # (-) :: IntPtr -> IntPtr -> IntPtr # (*) :: IntPtr -> IntPtr -> IntPtr # negate :: IntPtr -> IntPtr # abs :: IntPtr -> IntPtr # signum :: IntPtr -> IntPtr # fromInteger :: Integer -> IntPtr #
Num WordPtr # |
Instance details Defined in Foreign.Ptr Methods (+) :: WordPtr -> WordPtr -> WordPtr # (-) :: WordPtr -> WordPtr -> WordPtr # (*) :: WordPtr -> WordPtr -> WordPtr # negate :: WordPtr -> WordPtr # abs :: WordPtr -> WordPtr # signum :: WordPtr -> WordPtr # fromInteger :: Integer -> WordPtr #
Num CUIntMax # |
Instance details Defined in Foreign.C.Types Methods (+) :: CUIntMax -> CUIntMax -> CUIntMax # (-) :: CUIntMax -> CUIntMax -> CUIntMax # (*) :: CUIntMax -> CUIntMax -> CUIntMax # negate :: CUIntMax -> CUIntMax # abs :: CUIntMax -> CUIntMax # signum :: CUIntMax -> CUIntMax # fromInteger :: Integer -> CUIntMax #
Num CIntMax # |
Instance details Defined in Foreign.C.Types Methods (+) :: CIntMax -> CIntMax -> CIntMax # (-) :: CIntMax -> CIntMax -> CIntMax # (*) :: CIntMax -> CIntMax -> CIntMax # negate :: CIntMax -> CIntMax # abs :: CIntMax -> CIntMax # signum :: CIntMax -> CIntMax # fromInteger :: Integer -> CIntMax #
Num CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods (+) :: CUIntPtr -> CUIntPtr -> CUIntPtr # (-) :: CUIntPtr -> CUIntPtr -> CUIntPtr # (*) :: CUIntPtr -> CUIntPtr -> CUIntPtr # negate :: CUIntPtr -> CUIntPtr # abs :: CUIntPtr -> CUIntPtr # signum :: CUIntPtr -> CUIntPtr # fromInteger :: Integer -> CUIntPtr #
Num CIntPtr # |
Instance details Defined in Foreign.C.Types Methods (+) :: CIntPtr -> CIntPtr -> CIntPtr # (-) :: CIntPtr -> CIntPtr -> CIntPtr # (*) :: CIntPtr -> CIntPtr -> CIntPtr # negate :: CIntPtr -> CIntPtr # abs :: CIntPtr -> CIntPtr # signum :: CIntPtr -> CIntPtr # fromInteger :: Integer -> CIntPtr #
Num CSUSeconds # |
Instance details Defined in Foreign.C.Types Methods (+) :: CSUSeconds -> CSUSeconds -> CSUSeconds # (-) :: CSUSeconds -> CSUSeconds -> CSUSeconds # (*) :: CSUSeconds -> CSUSeconds -> CSUSeconds # negate :: CSUSeconds -> CSUSeconds # abs :: CSUSeconds -> CSUSeconds # signum :: CSUSeconds -> CSUSeconds # fromInteger :: Integer -> CSUSeconds #
Num CUSeconds # |
Instance details Defined in Foreign.C.Types Methods (+) :: CUSeconds -> CUSeconds -> CUSeconds # (-) :: CUSeconds -> CUSeconds -> CUSeconds # (*) :: CUSeconds -> CUSeconds -> CUSeconds # negate :: CUSeconds -> CUSeconds # abs :: CUSeconds -> CUSeconds # signum :: CUSeconds -> CUSeconds # fromInteger :: Integer -> CUSeconds #
Num CTime # |
Instance details Defined in Foreign.C.Types Methods (+) :: CTime -> CTime -> CTime # (-) :: CTime -> CTime -> CTime # (*) :: CTime -> CTime -> CTime # negate :: CTime -> CTime # abs :: CTime -> CTime # signum :: CTime -> CTime # fromInteger :: Integer -> CTime #
Num CClock # |
Instance details Defined in Foreign.C.Types Methods (+) :: CClock -> CClock -> CClock # (-) :: CClock -> CClock -> CClock # (*) :: CClock -> CClock -> CClock # negate :: CClock -> CClock # abs :: CClock -> CClock # signum :: CClock -> CClock # fromInteger :: Integer -> CClock #
Num CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods (+) :: CSigAtomic -> CSigAtomic -> CSigAtomic # (-) :: CSigAtomic -> CSigAtomic -> CSigAtomic # (*) :: CSigAtomic -> CSigAtomic -> CSigAtomic # negate :: CSigAtomic -> CSigAtomic # abs :: CSigAtomic -> CSigAtomic # signum :: CSigAtomic -> CSigAtomic # fromInteger :: Integer -> CSigAtomic #
Num CWchar # |
Instance details Defined in Foreign.C.Types Methods (+) :: CWchar -> CWchar -> CWchar # (-) :: CWchar -> CWchar -> CWchar # (*) :: CWchar -> CWchar -> CWchar # negate :: CWchar -> CWchar # abs :: CWchar -> CWchar # signum :: CWchar -> CWchar # fromInteger :: Integer -> CWchar #
Num CSize # |
Instance details Defined in Foreign.C.Types Methods (+) :: CSize -> CSize -> CSize # (-) :: CSize -> CSize -> CSize # (*) :: CSize -> CSize -> CSize # negate :: CSize -> CSize # abs :: CSize -> CSize # signum :: CSize -> CSize # fromInteger :: Integer -> CSize #
Num CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods (+) :: CPtrdiff -> CPtrdiff -> CPtrdiff # (-) :: CPtrdiff -> CPtrdiff -> CPtrdiff # (*) :: CPtrdiff -> CPtrdiff -> CPtrdiff # negate :: CPtrdiff -> CPtrdiff # abs :: CPtrdiff -> CPtrdiff # signum :: CPtrdiff -> CPtrdiff # fromInteger :: Integer -> CPtrdiff #
Num CDouble # |
Instance details Defined in Foreign.C.Types Methods (+) :: CDouble -> CDouble -> CDouble # (-) :: CDouble -> CDouble -> CDouble # (*) :: CDouble -> CDouble -> CDouble # negate :: CDouble -> CDouble # abs :: CDouble -> CDouble # signum :: CDouble -> CDouble # fromInteger :: Integer -> CDouble #
Num CFloat # |
Instance details Defined in Foreign.C.Types Methods (+) :: CFloat -> CFloat -> CFloat # (-) :: CFloat -> CFloat -> CFloat # (*) :: CFloat -> CFloat -> CFloat # negate :: CFloat -> CFloat # abs :: CFloat -> CFloat # signum :: CFloat -> CFloat # fromInteger :: Integer -> CFloat #
Num CBool # |
Instance details Defined in Foreign.C.Types Methods (+) :: CBool -> CBool -> CBool # (-) :: CBool -> CBool -> CBool # (*) :: CBool -> CBool -> CBool # negate :: CBool -> CBool # abs :: CBool -> CBool # signum :: CBool -> CBool # fromInteger :: Integer -> CBool #
Num CULLong # |
Instance details Defined in Foreign.C.Types Methods (+) :: CULLong -> CULLong -> CULLong # (-) :: CULLong -> CULLong -> CULLong # (*) :: CULLong -> CULLong -> CULLong # negate :: CULLong -> CULLong # abs :: CULLong -> CULLong # signum :: CULLong -> CULLong # fromInteger :: Integer -> CULLong #
Num CLLong # |
Instance details Defined in Foreign.C.Types Methods (+) :: CLLong -> CLLong -> CLLong # (-) :: CLLong -> CLLong -> CLLong # (*) :: CLLong -> CLLong -> CLLong # negate :: CLLong -> CLLong # abs :: CLLong -> CLLong # signum :: CLLong -> CLLong # fromInteger :: Integer -> CLLong #
Num CULong # |
Instance details Defined in Foreign.C.Types Methods (+) :: CULong -> CULong -> CULong # (-) :: CULong -> CULong -> CULong # (*) :: CULong -> CULong -> CULong # negate :: CULong -> CULong # abs :: CULong -> CULong # signum :: CULong -> CULong # fromInteger :: Integer -> CULong #
Num CLong # |
Instance details Defined in Foreign.C.Types Methods (+) :: CLong -> CLong -> CLong # (-) :: CLong -> CLong -> CLong # (*) :: CLong -> CLong -> CLong # negate :: CLong -> CLong # abs :: CLong -> CLong # signum :: CLong -> CLong # fromInteger :: Integer -> CLong #
Num CUInt # |
Instance details Defined in Foreign.C.Types Methods (+) :: CUInt -> CUInt -> CUInt # (-) :: CUInt -> CUInt -> CUInt # (*) :: CUInt -> CUInt -> CUInt # negate :: CUInt -> CUInt # abs :: CUInt -> CUInt # signum :: CUInt -> CUInt # fromInteger :: Integer -> CUInt #
Num CInt # |
Instance details Defined in Foreign.C.Types Methods (+) :: CInt -> CInt -> CInt # (-) :: CInt -> CInt -> CInt # (*) :: CInt -> CInt -> CInt # negate :: CInt -> CInt # abs :: CInt -> CInt # signum :: CInt -> CInt # fromInteger :: Integer -> CInt #
Num CUShort # |
Instance details Defined in Foreign.C.Types Methods (+) :: CUShort -> CUShort -> CUShort # (-) :: CUShort -> CUShort -> CUShort # (*) :: CUShort -> CUShort -> CUShort # negate :: CUShort -> CUShort # abs :: CUShort -> CUShort # signum :: CUShort -> CUShort # fromInteger :: Integer -> CUShort #
Num CShort # |
Instance details Defined in Foreign.C.Types Methods (+) :: CShort -> CShort -> CShort # (-) :: CShort -> CShort -> CShort # (*) :: CShort -> CShort -> CShort # negate :: CShort -> CShort # abs :: CShort -> CShort # signum :: CShort -> CShort # fromInteger :: Integer -> CShort #
Num CUChar # |
Instance details Defined in Foreign.C.Types Methods (+) :: CUChar -> CUChar -> CUChar # (-) :: CUChar -> CUChar -> CUChar # (*) :: CUChar -> CUChar -> CUChar # negate :: CUChar -> CUChar # abs :: CUChar -> CUChar # signum :: CUChar -> CUChar # fromInteger :: Integer -> CUChar #
Num CSChar # |
Instance details Defined in Foreign.C.Types Methods (+) :: CSChar -> CSChar -> CSChar # (-) :: CSChar -> CSChar -> CSChar # (*) :: CSChar -> CSChar -> CSChar # negate :: CSChar -> CSChar # abs :: CSChar -> CSChar # signum :: CSChar -> CSChar # fromInteger :: Integer -> CSChar #
Num CChar # |
Instance details Defined in Foreign.C.Types Methods (+) :: CChar -> CChar -> CChar # (-) :: CChar -> CChar -> CChar # (*) :: CChar -> CChar -> CChar # negate :: CChar -> CChar # abs :: CChar -> CChar # signum :: CChar -> CChar # fromInteger :: Integer -> CChar #
Num Fd # |
Instance details Defined in System.Posix.Types Methods (+) :: Fd -> Fd -> Fd # (-) :: Fd -> Fd -> Fd # (*) :: Fd -> Fd -> Fd # negate :: Fd -> Fd # abs :: Fd -> Fd # signum :: Fd -> Fd # fromInteger :: Integer -> Fd #
Num CKey # |
Instance details Defined in System.Posix.Types Methods (+) :: CKey -> CKey -> CKey # (-) :: CKey -> CKey -> CKey # (*) :: CKey -> CKey -> CKey # negate :: CKey -> CKey # abs :: CKey -> CKey # signum :: CKey -> CKey # fromInteger :: Integer -> CKey #
Num CId # |
Instance details Defined in System.Posix.Types Methods (+) :: CId -> CId -> CId # (-) :: CId -> CId -> CId # (*) :: CId -> CId -> CId # negate :: CId -> CId # abs :: CId -> CId # signum :: CId -> CId # fromInteger :: Integer -> CId #
Num CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods (+) :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # (-) :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # (*) :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # negate :: CFsFilCnt -> CFsFilCnt # abs :: CFsFilCnt -> CFsFilCnt # signum :: CFsFilCnt -> CFsFilCnt # fromInteger :: Integer -> CFsFilCnt #
Num CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods (+) :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # (-) :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # (*) :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # negate :: CFsBlkCnt -> CFsBlkCnt # abs :: CFsBlkCnt -> CFsBlkCnt # signum :: CFsBlkCnt -> CFsBlkCnt # fromInteger :: Integer -> CFsBlkCnt #
Num CClockId # |
Instance details Defined in System.Posix.Types Methods (+) :: CClockId -> CClockId -> CClockId # (-) :: CClockId -> CClockId -> CClockId # (*) :: CClockId -> CClockId -> CClockId # negate :: CClockId -> CClockId # abs :: CClockId -> CClockId # signum :: CClockId -> CClockId # fromInteger :: Integer -> CClockId #
Num CBlkCnt # |
Instance details Defined in System.Posix.Types Methods (+) :: CBlkCnt -> CBlkCnt -> CBlkCnt # (-) :: CBlkCnt -> CBlkCnt -> CBlkCnt # (*) :: CBlkCnt -> CBlkCnt -> CBlkCnt # negate :: CBlkCnt -> CBlkCnt # abs :: CBlkCnt -> CBlkCnt # signum :: CBlkCnt -> CBlkCnt # fromInteger :: Integer -> CBlkCnt #
Num CBlkSize # |
Instance details Defined in System.Posix.Types Methods (+) :: CBlkSize -> CBlkSize -> CBlkSize # (-) :: CBlkSize -> CBlkSize -> CBlkSize # (*) :: CBlkSize -> CBlkSize -> CBlkSize # negate :: CBlkSize -> CBlkSize # abs :: CBlkSize -> CBlkSize # signum :: CBlkSize -> CBlkSize # fromInteger :: Integer -> CBlkSize #
Num CRLim # |
Instance details Defined in System.Posix.Types Methods (+) :: CRLim -> CRLim -> CRLim # (-) :: CRLim -> CRLim -> CRLim # (*) :: CRLim -> CRLim -> CRLim # negate :: CRLim -> CRLim # abs :: CRLim -> CRLim # signum :: CRLim -> CRLim # fromInteger :: Integer -> CRLim #
Num CTcflag # |
Instance details Defined in System.Posix.Types Methods (+) :: CTcflag -> CTcflag -> CTcflag # (-) :: CTcflag -> CTcflag -> CTcflag # (*) :: CTcflag -> CTcflag -> CTcflag # negate :: CTcflag -> CTcflag # abs :: CTcflag -> CTcflag # signum :: CTcflag -> CTcflag # fromInteger :: Integer -> CTcflag #
Num CSpeed # |
Instance details Defined in System.Posix.Types Methods (+) :: CSpeed -> CSpeed -> CSpeed # (-) :: CSpeed -> CSpeed -> CSpeed # (*) :: CSpeed -> CSpeed -> CSpeed # negate :: CSpeed -> CSpeed # abs :: CSpeed -> CSpeed # signum :: CSpeed -> CSpeed # fromInteger :: Integer -> CSpeed #
Num CCc # |
Instance details Defined in System.Posix.Types Methods (+) :: CCc -> CCc -> CCc # (-) :: CCc -> CCc -> CCc # (*) :: CCc -> CCc -> CCc # negate :: CCc -> CCc # abs :: CCc -> CCc # signum :: CCc -> CCc # fromInteger :: Integer -> CCc #
Num CUid # |
Instance details Defined in System.Posix.Types Methods (+) :: CUid -> CUid -> CUid # (-) :: CUid -> CUid -> CUid # (*) :: CUid -> CUid -> CUid # negate :: CUid -> CUid # abs :: CUid -> CUid # signum :: CUid -> CUid # fromInteger :: Integer -> CUid #
Num CNlink # |
Instance details Defined in System.Posix.Types Methods (+) :: CNlink -> CNlink -> CNlink # (-) :: CNlink -> CNlink -> CNlink # (*) :: CNlink -> CNlink -> CNlink # negate :: CNlink -> CNlink # abs :: CNlink -> CNlink # signum :: CNlink -> CNlink # fromInteger :: Integer -> CNlink #
Num CGid # |
Instance details Defined in System.Posix.Types Methods (+) :: CGid -> CGid -> CGid # (-) :: CGid -> CGid -> CGid # (*) :: CGid -> CGid -> CGid # negate :: CGid -> CGid # abs :: CGid -> CGid # signum :: CGid -> CGid # fromInteger :: Integer -> CGid #
Num CSsize # |
Instance details Defined in System.Posix.Types Methods (+) :: CSsize -> CSsize -> CSsize # (-) :: CSsize -> CSsize -> CSsize # (*) :: CSsize -> CSsize -> CSsize # negate :: CSsize -> CSsize # abs :: CSsize -> CSsize # signum :: CSsize -> CSsize # fromInteger :: Integer -> CSsize #
Num CPid # |
Instance details Defined in System.Posix.Types Methods (+) :: CPid -> CPid -> CPid # (-) :: CPid -> CPid -> CPid # (*) :: CPid -> CPid -> CPid # negate :: CPid -> CPid # abs :: CPid -> CPid # signum :: CPid -> CPid # fromInteger :: Integer -> CPid #
Num COff # |
Instance details Defined in System.Posix.Types Methods (+) :: COff -> COff -> COff # (-) :: COff -> COff -> COff # (*) :: COff -> COff -> COff # negate :: COff -> COff # abs :: COff -> COff # signum :: COff -> COff # fromInteger :: Integer -> COff #
Num CMode # |
Instance details Defined in System.Posix.Types Methods (+) :: CMode -> CMode -> CMode # (-) :: CMode -> CMode -> CMode # (*) :: CMode -> CMode -> CMode # negate :: CMode -> CMode # abs :: CMode -> CMode # signum :: CMode -> CMode # fromInteger :: Integer -> CMode #
Num CIno # |
Instance details Defined in System.Posix.Types Methods (+) :: CIno -> CIno -> CIno # (-) :: CIno -> CIno -> CIno # (*) :: CIno -> CIno -> CIno # negate :: CIno -> CIno # abs :: CIno -> CIno # signum :: CIno -> CIno # fromInteger :: Integer -> CIno #
Num CDev # |
Instance details Defined in System.Posix.Types Methods (+) :: CDev -> CDev -> CDev # (-) :: CDev -> CDev -> CDev # (*) :: CDev -> CDev -> CDev # negate :: CDev -> CDev # abs :: CDev -> CDev # signum :: CDev -> CDev # fromInteger :: Integer -> CDev #
Integral a => Num (Ratio a) # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods (+) :: Ratio a -> Ratio a -> Ratio a # (-) :: Ratio a -> Ratio a -> Ratio a # (*) :: Ratio a -> Ratio a -> Ratio a # negate :: Ratio a -> Ratio a # abs :: Ratio a -> Ratio a # signum :: Ratio a -> Ratio a # fromInteger :: Integer -> Ratio a #
Num a => Num (Down a) # | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (+) :: Down a -> Down a -> Down a # (-) :: Down a -> Down a -> Down a # (*) :: Down a -> Down a -> Down a # negate :: Down a -> Down a # abs :: Down a -> Down a # signum :: Down a -> Down a # fromInteger :: Integer -> Down a #
Num a => Num (Product a) # |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Product a -> Product a -> Product a # (-) :: Product a -> Product a -> Product a # (*) :: Product a -> Product a -> Product a # negate :: Product a -> Product a # abs :: Product a -> Product a # signum :: Product a -> Product a # fromInteger :: Integer -> Product a #
Num a => Num (Sum a) # |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Sum a -> Sum a -> Sum a # (-) :: Sum a -> Sum a -> Sum a # (*) :: Sum a -> Sum a -> Sum a # negate :: Sum a -> Sum a # abs :: Sum a -> Sum a # signum :: Sum a -> Sum a # fromInteger :: Integer -> Sum a #
Num a => Num (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods (+) :: Identity a -> Identity a -> Identity a # (-) :: Identity a -> Identity a -> Identity a # (*) :: Identity a -> Identity a -> Identity a # negate :: Identity a -> Identity a # abs :: Identity a -> Identity a # signum :: Identity a -> Identity a # fromInteger :: Integer -> Identity a #
Num a => Num (Max a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (+) :: Max a -> Max a -> Max a # (-) :: Max a -> Max a -> Max a # (*) :: Max a -> Max a -> Max a # negate :: Max a -> Max a # abs :: Max a -> Max a # signum :: Max a -> Max a # fromInteger :: Integer -> Max a #
Num a => Num (Min a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (+) :: Min a -> Min a -> Min a # (-) :: Min a -> Min a -> Min a # (*) :: Min a -> Min a -> Min a # negate :: Min a -> Min a # abs :: Min a -> Min a # signum :: Min a -> Min a # fromInteger :: Integer -> Min a #
HasResolution a => Num (Fixed a) # | Since: base-2.1
Instance details Defined in Data.Fixed Methods (+) :: Fixed a -> Fixed a -> Fixed a # (-) :: Fixed a -> Fixed a -> Fixed a # (*) :: Fixed a -> Fixed a -> Fixed a # negate :: Fixed a -> Fixed a # abs :: Fixed a -> Fixed a # signum :: Fixed a -> Fixed a # fromInteger :: Integer -> Fixed a #
RealFloat a => Num (Complex a) # | Since: base-2.1
Instance details Defined in Data.Complex Methods (+) :: Complex a -> Complex a -> Complex a # (-) :: Complex a -> Complex a -> Complex a # (*) :: Complex a -> Complex a -> Complex a # negate :: Complex a -> Complex a # abs :: Complex a -> Complex a # signum :: Complex a -> Complex a # fromInteger :: Integer -> Complex a #
Num (f a) => Num (Alt f a) # |
Instance details Defined in Data.Semigroup.Internal Methods (+) :: Alt f a -> Alt f a -> Alt f a # (-) :: Alt f a -> Alt f a -> Alt f a # (*) :: Alt f a -> Alt f a -> Alt f a # negate :: Alt f a -> Alt f a # abs :: Alt f a -> Alt f a # signum :: Alt f a -> Alt f a # fromInteger :: Integer -> Alt f a #
Num a => Num (Const a b) # |
Instance details Defined in Data.Functor.Const Methods (+) :: Const a b -> Const a b -> Const a b # (-) :: Const a b -> Const a b -> Const a b # (*) :: Const a b -> Const a b -> Const a b # negate :: Const a b -> Const a b # abs :: Const a b -> Const a b # signum :: Const a b -> Const a b # fromInteger :: Integer -> Const a b #

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

Minimal complete definition

toRational

Methods

toRational :: a -> Rational #

the rational equivalent of its real argument with full precision

Instances

Real Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods toRational :: Double -> Rational #
Real Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods toRational :: Float -> Rational #
Real Int # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Int -> Rational #
Real Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int8 -> Rational #
Real Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int16 -> Rational #
Real Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int32 -> Rational #
Real Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods toRational :: Int64 -> Rational #
Real Integer # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Integer -> Rational #
Real Natural # | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods toRational :: Natural -> Rational #
Real Word # | Since: base-2.1
Instance details Defined in GHC.Real Methods toRational :: Word -> Rational #
Real Word8 # | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word8 -> Rational #
Real Word16 # | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word16 -> Rational #
Real Word32 # | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word32 -> Rational #
Real Word64 # | Since: base-2.1
Instance details Defined in GHC.Word Methods toRational :: Word64 -> Rational #
Real IntPtr # |
Instance details Defined in Foreign.Ptr Methods toRational :: IntPtr -> Rational #
Real WordPtr # |
Instance details Defined in Foreign.Ptr Methods toRational :: WordPtr -> Rational #
Real CUIntMax # |
Instance details Defined in Foreign.C.Types Methods toRational :: CUIntMax -> Rational #
Real CIntMax # |
Instance details Defined in Foreign.C.Types Methods toRational :: CIntMax -> Rational #
Real CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods toRational :: CUIntPtr -> Rational #
Real CIntPtr # |
Instance details Defined in Foreign.C.Types Methods toRational :: CIntPtr -> Rational #
Real CSUSeconds # |
Instance details Defined in Foreign.C.Types Methods toRational :: CSUSeconds -> Rational #
Real CUSeconds # |
Instance details Defined in Foreign.C.Types Methods toRational :: CUSeconds -> Rational #
Real CTime # |
Instance details Defined in Foreign.C.Types Methods toRational :: CTime -> Rational #
Real CClock # |
Instance details Defined in Foreign.C.Types Methods toRational :: CClock -> Rational #
Real CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods toRational :: CSigAtomic -> Rational #
Real CWchar # |
Instance details Defined in Foreign.C.Types Methods toRational :: CWchar -> Rational #
Real CSize # |
Instance details Defined in Foreign.C.Types Methods toRational :: CSize -> Rational #
Real CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods toRational :: CPtrdiff -> Rational #
Real CDouble # |
Instance details Defined in Foreign.C.Types Methods toRational :: CDouble -> Rational #
Real CFloat # |
Instance details Defined in Foreign.C.Types Methods toRational :: CFloat -> Rational #
Real CBool # |
Instance details Defined in Foreign.C.Types Methods toRational :: CBool -> Rational #
Real CULLong # |
Instance details Defined in Foreign.C.Types Methods toRational :: CULLong -> Rational #
Real CLLong # |
Instance details Defined in Foreign.C.Types Methods toRational :: CLLong -> Rational #
Real CULong # |
Instance details Defined in Foreign.C.Types Methods toRational :: CULong -> Rational #
Real CLong # |
Instance details Defined in Foreign.C.Types Methods toRational :: CLong -> Rational #
Real CUInt # |
Instance details Defined in Foreign.C.Types Methods toRational :: CUInt -> Rational #
Real CInt # |
Instance details Defined in Foreign.C.Types Methods toRational :: CInt -> Rational #
Real CUShort # |
Instance details Defined in Foreign.C.Types Methods toRational :: CUShort -> Rational #
Real CShort # |
Instance details Defined in Foreign.C.Types Methods toRational :: CShort -> Rational #
Real CUChar # |
Instance details Defined in Foreign.C.Types Methods toRational :: CUChar -> Rational #
Real CSChar # |
Instance details Defined in Foreign.C.Types Methods toRational :: CSChar -> Rational #
Real CChar # |
Instance details Defined in Foreign.C.Types Methods toRational :: CChar -> Rational #
Real Fd # |
Instance details Defined in System.Posix.Types Methods toRational :: Fd -> Rational #
Real CKey # |
Instance details Defined in System.Posix.Types Methods toRational :: CKey -> Rational #
Real CId # |
Instance details Defined in System.Posix.Types Methods toRational :: CId -> Rational #
Real CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods toRational :: CFsFilCnt -> Rational #
Real CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods toRational :: CFsBlkCnt -> Rational #
Real CClockId # |
Instance details Defined in System.Posix.Types Methods toRational :: CClockId -> Rational #
Real CBlkCnt # |
Instance details Defined in System.Posix.Types Methods toRational :: CBlkCnt -> Rational #
Real CBlkSize # |
Instance details Defined in System.Posix.Types Methods toRational :: CBlkSize -> Rational #
Real CRLim # |
Instance details Defined in System.Posix.Types Methods toRational :: CRLim -> Rational #
Real CTcflag # |
Instance details Defined in System.Posix.Types Methods toRational :: CTcflag -> Rational #
Real CSpeed # |
Instance details Defined in System.Posix.Types Methods toRational :: CSpeed -> Rational #
Real CCc # |
Instance details Defined in System.Posix.Types Methods toRational :: CCc -> Rational #
Real CUid # |
Instance details Defined in System.Posix.Types Methods toRational :: CUid -> Rational #
Real CNlink # |
Instance details Defined in System.Posix.Types Methods toRational :: CNlink -> Rational #
Real CGid # |
Instance details Defined in System.Posix.Types Methods toRational :: CGid -> Rational #
Real CSsize # |
Instance details Defined in System.Posix.Types Methods toRational :: CSsize -> Rational #
Real CPid # |
Instance details Defined in System.Posix.Types Methods toRational :: CPid -> Rational #
Real COff # |
Instance details Defined in System.Posix.Types Methods toRational :: COff -> Rational #
Real CMode # |
Instance details Defined in System.Posix.Types Methods toRational :: CMode -> Rational #
Real CIno # |
Instance details Defined in System.Posix.Types Methods toRational :: CIno -> Rational #
Real CDev # |
Instance details Defined in System.Posix.Types Methods toRational :: CDev -> Rational #
Integral a => Real (Ratio a) # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods toRational :: Ratio a -> Rational #
Real a => Real (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods toRational :: Identity a -> Rational #
HasResolution a => Real (Fixed a) # | Since: base-2.1
Instance details Defined in Data.Fixed Methods toRational :: Fixed a -> Rational #
Real a => Real (Const a b) # |
Instance details Defined in Data.Functor.Const Methods toRational :: Const a b -> Rational #

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

Integral numbers, supporting integer division.

Minimal complete definition

quotRem, toInteger

Methods

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

integer division truncated toward zero

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

integer remainder, satisfying

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

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

integer division truncated toward negative infinity

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

integer modulus, satisfying

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

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

simultaneous `quot` and `rem`

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

simultaneous `div` and `mod`

toInteger :: a -> Integer #

conversion to `Integer`

Instances

Integral Int # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods quot :: Int -> Int -> Int # rem :: Int -> Int -> Int # div :: Int -> Int -> Int # mod :: Int -> Int -> Int # quotRem :: Int -> Int -> (Int, Int) # divMod :: Int -> Int -> (Int, Int) # toInteger :: Int -> Integer #
Integral Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int8 -> Int8 -> Int8 # rem :: Int8 -> Int8 -> Int8 # div :: Int8 -> Int8 -> Int8 # mod :: Int8 -> Int8 -> Int8 # quotRem :: Int8 -> Int8 -> (Int8, Int8) # divMod :: Int8 -> Int8 -> (Int8, Int8) # toInteger :: Int8 -> Integer #
Integral Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int16 -> Int16 -> Int16 # rem :: Int16 -> Int16 -> Int16 # div :: Int16 -> Int16 -> Int16 # mod :: Int16 -> Int16 -> Int16 # quotRem :: Int16 -> Int16 -> (Int16, Int16) # divMod :: Int16 -> Int16 -> (Int16, Int16) # toInteger :: Int16 -> Integer #
Integral Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int32 -> Int32 -> Int32 # rem :: Int32 -> Int32 -> Int32 # div :: Int32 -> Int32 -> Int32 # mod :: Int32 -> Int32 -> Int32 # quotRem :: Int32 -> Int32 -> (Int32, Int32) # divMod :: Int32 -> Int32 -> (Int32, Int32) # toInteger :: Int32 -> Integer #
Integral Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods quot :: Int64 -> Int64 -> Int64 # rem :: Int64 -> Int64 -> Int64 # div :: Int64 -> Int64 -> Int64 # mod :: Int64 -> Int64 -> Int64 # quotRem :: Int64 -> Int64 -> (Int64, Int64) # divMod :: Int64 -> Int64 -> (Int64, Int64) # toInteger :: Int64 -> Integer #
Integral Integer # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods quot :: Integer -> Integer -> Integer # rem :: Integer -> Integer -> Integer # div :: Integer -> Integer -> Integer # mod :: Integer -> Integer -> Integer # quotRem :: Integer -> Integer -> (Integer, Integer) # divMod :: Integer -> Integer -> (Integer, Integer) # toInteger :: Integer -> Integer #
Integral Natural # | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods quot :: Natural -> Natural -> Natural # rem :: Natural -> Natural -> Natural # div :: Natural -> Natural -> Natural # mod :: Natural -> Natural -> Natural # quotRem :: Natural -> Natural -> (Natural, Natural) # divMod :: Natural -> Natural -> (Natural, Natural) # toInteger :: Natural -> Integer #
Integral Word # | Since: base-2.1
Instance details Defined in GHC.Real Methods quot :: Word -> Word -> Word # rem :: Word -> Word -> Word # div :: Word -> Word -> Word # mod :: Word -> Word -> Word # quotRem :: Word -> Word -> (Word, Word) # divMod :: Word -> Word -> (Word, Word) # toInteger :: Word -> Integer #
Integral Word8 # | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word8 -> Word8 -> Word8 # rem :: Word8 -> Word8 -> Word8 # div :: Word8 -> Word8 -> Word8 # mod :: Word8 -> Word8 -> Word8 # quotRem :: Word8 -> Word8 -> (Word8, Word8) # divMod :: Word8 -> Word8 -> (Word8, Word8) # toInteger :: Word8 -> Integer #
Integral Word16 # | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word16 -> Word16 -> Word16 # rem :: Word16 -> Word16 -> Word16 # div :: Word16 -> Word16 -> Word16 # mod :: Word16 -> Word16 -> Word16 # quotRem :: Word16 -> Word16 -> (Word16, Word16) # divMod :: Word16 -> Word16 -> (Word16, Word16) # toInteger :: Word16 -> Integer #
Integral Word32 # | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word32 -> Word32 -> Word32 # rem :: Word32 -> Word32 -> Word32 # div :: Word32 -> Word32 -> Word32 # mod :: Word32 -> Word32 -> Word32 # quotRem :: Word32 -> Word32 -> (Word32, Word32) # divMod :: Word32 -> Word32 -> (Word32, Word32) # toInteger :: Word32 -> Integer #
Integral Word64 # | Since: base-2.1
Instance details Defined in GHC.Word Methods quot :: Word64 -> Word64 -> Word64 # rem :: Word64 -> Word64 -> Word64 # div :: Word64 -> Word64 -> Word64 # mod :: Word64 -> Word64 -> Word64 # quotRem :: Word64 -> Word64 -> (Word64, Word64) # divMod :: Word64 -> Word64 -> (Word64, Word64) # toInteger :: Word64 -> Integer #
Integral IntPtr # |
Instance details Defined in Foreign.Ptr Methods quot :: IntPtr -> IntPtr -> IntPtr # rem :: IntPtr -> IntPtr -> IntPtr # div :: IntPtr -> IntPtr -> IntPtr # mod :: IntPtr -> IntPtr -> IntPtr # quotRem :: IntPtr -> IntPtr -> (IntPtr, IntPtr) # divMod :: IntPtr -> IntPtr -> (IntPtr, IntPtr) # toInteger :: IntPtr -> Integer #
Integral WordPtr # |
Instance details Defined in Foreign.Ptr Methods quot :: WordPtr -> WordPtr -> WordPtr # rem :: WordPtr -> WordPtr -> WordPtr # div :: WordPtr -> WordPtr -> WordPtr # mod :: WordPtr -> WordPtr -> WordPtr # quotRem :: WordPtr -> WordPtr -> (WordPtr, WordPtr) # divMod :: WordPtr -> WordPtr -> (WordPtr, WordPtr) # toInteger :: WordPtr -> Integer #
Integral CUIntMax # |
Instance details Defined in Foreign.C.Types Methods quot :: CUIntMax -> CUIntMax -> CUIntMax # rem :: CUIntMax -> CUIntMax -> CUIntMax # div :: CUIntMax -> CUIntMax -> CUIntMax # mod :: CUIntMax -> CUIntMax -> CUIntMax # quotRem :: CUIntMax -> CUIntMax -> (CUIntMax, CUIntMax) # divMod :: CUIntMax -> CUIntMax -> (CUIntMax, CUIntMax) # toInteger :: CUIntMax -> Integer #
Integral CIntMax # |
Instance details Defined in Foreign.C.Types Methods quot :: CIntMax -> CIntMax -> CIntMax # rem :: CIntMax -> CIntMax -> CIntMax # div :: CIntMax -> CIntMax -> CIntMax # mod :: CIntMax -> CIntMax -> CIntMax # quotRem :: CIntMax -> CIntMax -> (CIntMax, CIntMax) # divMod :: CIntMax -> CIntMax -> (CIntMax, CIntMax) # toInteger :: CIntMax -> Integer #
Integral CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods quot :: CUIntPtr -> CUIntPtr -> CUIntPtr # rem :: CUIntPtr -> CUIntPtr -> CUIntPtr # div :: CUIntPtr -> CUIntPtr -> CUIntPtr # mod :: CUIntPtr -> CUIntPtr -> CUIntPtr # quotRem :: CUIntPtr -> CUIntPtr -> (CUIntPtr, CUIntPtr) # divMod :: CUIntPtr -> CUIntPtr -> (CUIntPtr, CUIntPtr) # toInteger :: CUIntPtr -> Integer #
Integral CIntPtr # |
Instance details Defined in Foreign.C.Types Methods quot :: CIntPtr -> CIntPtr -> CIntPtr # rem :: CIntPtr -> CIntPtr -> CIntPtr # div :: CIntPtr -> CIntPtr -> CIntPtr # mod :: CIntPtr -> CIntPtr -> CIntPtr # quotRem :: CIntPtr -> CIntPtr -> (CIntPtr, CIntPtr) # divMod :: CIntPtr -> CIntPtr -> (CIntPtr, CIntPtr) # toInteger :: CIntPtr -> Integer #
Integral CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods quot :: CSigAtomic -> CSigAtomic -> CSigAtomic # rem :: CSigAtomic -> CSigAtomic -> CSigAtomic # div :: CSigAtomic -> CSigAtomic -> CSigAtomic # mod :: CSigAtomic -> CSigAtomic -> CSigAtomic # quotRem :: CSigAtomic -> CSigAtomic -> (CSigAtomic, CSigAtomic) # divMod :: CSigAtomic -> CSigAtomic -> (CSigAtomic, CSigAtomic) # toInteger :: CSigAtomic -> Integer #
Integral CWchar # |
Instance details Defined in Foreign.C.Types Methods quot :: CWchar -> CWchar -> CWchar # rem :: CWchar -> CWchar -> CWchar # div :: CWchar -> CWchar -> CWchar # mod :: CWchar -> CWchar -> CWchar # quotRem :: CWchar -> CWchar -> (CWchar, CWchar) # divMod :: CWchar -> CWchar -> (CWchar, CWchar) # toInteger :: CWchar -> Integer #
Integral CSize # |
Instance details Defined in Foreign.C.Types Methods quot :: CSize -> CSize -> CSize # rem :: CSize -> CSize -> CSize # div :: CSize -> CSize -> CSize # mod :: CSize -> CSize -> CSize # quotRem :: CSize -> CSize -> (CSize, CSize) # divMod :: CSize -> CSize -> (CSize, CSize) # toInteger :: CSize -> Integer #
Integral CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods quot :: CPtrdiff -> CPtrdiff -> CPtrdiff # rem :: CPtrdiff -> CPtrdiff -> CPtrdiff # div :: CPtrdiff -> CPtrdiff -> CPtrdiff # mod :: CPtrdiff -> CPtrdiff -> CPtrdiff # quotRem :: CPtrdiff -> CPtrdiff -> (CPtrdiff, CPtrdiff) # divMod :: CPtrdiff -> CPtrdiff -> (CPtrdiff, CPtrdiff) # toInteger :: CPtrdiff -> Integer #
Integral CBool # |
Instance details Defined in Foreign.C.Types Methods quot :: CBool -> CBool -> CBool # rem :: CBool -> CBool -> CBool # div :: CBool -> CBool -> CBool # mod :: CBool -> CBool -> CBool # quotRem :: CBool -> CBool -> (CBool, CBool) # divMod :: CBool -> CBool -> (CBool, CBool) # toInteger :: CBool -> Integer #
Integral CULLong # |
Instance details Defined in Foreign.C.Types Methods quot :: CULLong -> CULLong -> CULLong # rem :: CULLong -> CULLong -> CULLong # div :: CULLong -> CULLong -> CULLong # mod :: CULLong -> CULLong -> CULLong # quotRem :: CULLong -> CULLong -> (CULLong, CULLong) # divMod :: CULLong -> CULLong -> (CULLong, CULLong) # toInteger :: CULLong -> Integer #
Integral CLLong # |
Instance details Defined in Foreign.C.Types Methods quot :: CLLong -> CLLong -> CLLong # rem :: CLLong -> CLLong -> CLLong # div :: CLLong -> CLLong -> CLLong # mod :: CLLong -> CLLong -> CLLong # quotRem :: CLLong -> CLLong -> (CLLong, CLLong) # divMod :: CLLong -> CLLong -> (CLLong, CLLong) # toInteger :: CLLong -> Integer #
Integral CULong # |
Instance details Defined in Foreign.C.Types Methods quot :: CULong -> CULong -> CULong # rem :: CULong -> CULong -> CULong # div :: CULong -> CULong -> CULong # mod :: CULong -> CULong -> CULong # quotRem :: CULong -> CULong -> (CULong, CULong) # divMod :: CULong -> CULong -> (CULong, CULong) # toInteger :: CULong -> Integer #
Integral CLong # |
Instance details Defined in Foreign.C.Types Methods quot :: CLong -> CLong -> CLong # rem :: CLong -> CLong -> CLong # div :: CLong -> CLong -> CLong # mod :: CLong -> CLong -> CLong # quotRem :: CLong -> CLong -> (CLong, CLong) # divMod :: CLong -> CLong -> (CLong, CLong) # toInteger :: CLong -> Integer #
Integral CUInt # |
Instance details Defined in Foreign.C.Types Methods quot :: CUInt -> CUInt -> CUInt # rem :: CUInt -> CUInt -> CUInt # div :: CUInt -> CUInt -> CUInt # mod :: CUInt -> CUInt -> CUInt # quotRem :: CUInt -> CUInt -> (CUInt, CUInt) # divMod :: CUInt -> CUInt -> (CUInt, CUInt) # toInteger :: CUInt -> Integer #
Integral CInt # |
Instance details Defined in Foreign.C.Types Methods quot :: CInt -> CInt -> CInt # rem :: CInt -> CInt -> CInt # div :: CInt -> CInt -> CInt # mod :: CInt -> CInt -> CInt # quotRem :: CInt -> CInt -> (CInt, CInt) # divMod :: CInt -> CInt -> (CInt, CInt) # toInteger :: CInt -> Integer #
Integral CUShort # |
Instance details Defined in Foreign.C.Types Methods quot :: CUShort -> CUShort -> CUShort # rem :: CUShort -> CUShort -> CUShort # div :: CUShort -> CUShort -> CUShort # mod :: CUShort -> CUShort -> CUShort # quotRem :: CUShort -> CUShort -> (CUShort, CUShort) # divMod :: CUShort -> CUShort -> (CUShort, CUShort) # toInteger :: CUShort -> Integer #
Integral CShort # |
Instance details Defined in Foreign.C.Types Methods quot :: CShort -> CShort -> CShort # rem :: CShort -> CShort -> CShort # div :: CShort -> CShort -> CShort # mod :: CShort -> CShort -> CShort # quotRem :: CShort -> CShort -> (CShort, CShort) # divMod :: CShort -> CShort -> (CShort, CShort) # toInteger :: CShort -> Integer #
Integral CUChar # |
Instance details Defined in Foreign.C.Types Methods quot :: CUChar -> CUChar -> CUChar # rem :: CUChar -> CUChar -> CUChar # div :: CUChar -> CUChar -> CUChar # mod :: CUChar -> CUChar -> CUChar # quotRem :: CUChar -> CUChar -> (CUChar, CUChar) # divMod :: CUChar -> CUChar -> (CUChar, CUChar) # toInteger :: CUChar -> Integer #
Integral CSChar # |
Instance details Defined in Foreign.C.Types Methods quot :: CSChar -> CSChar -> CSChar # rem :: CSChar -> CSChar -> CSChar # div :: CSChar -> CSChar -> CSChar # mod :: CSChar -> CSChar -> CSChar # quotRem :: CSChar -> CSChar -> (CSChar, CSChar) # divMod :: CSChar -> CSChar -> (CSChar, CSChar) # toInteger :: CSChar -> Integer #
Integral CChar # |
Instance details Defined in Foreign.C.Types Methods quot :: CChar -> CChar -> CChar # rem :: CChar -> CChar -> CChar # div :: CChar -> CChar -> CChar # mod :: CChar -> CChar -> CChar # quotRem :: CChar -> CChar -> (CChar, CChar) # divMod :: CChar -> CChar -> (CChar, CChar) # toInteger :: CChar -> Integer #
Integral Fd # |
Instance details Defined in System.Posix.Types Methods quot :: Fd -> Fd -> Fd # rem :: Fd -> Fd -> Fd # div :: Fd -> Fd -> Fd # mod :: Fd -> Fd -> Fd # quotRem :: Fd -> Fd -> (Fd, Fd) # divMod :: Fd -> Fd -> (Fd, Fd) # toInteger :: Fd -> Integer #
Integral CKey # |
Instance details Defined in System.Posix.Types Methods quot :: CKey -> CKey -> CKey # rem :: CKey -> CKey -> CKey # div :: CKey -> CKey -> CKey # mod :: CKey -> CKey -> CKey # quotRem :: CKey -> CKey -> (CKey, CKey) # divMod :: CKey -> CKey -> (CKey, CKey) # toInteger :: CKey -> Integer #
Integral CId # |
Instance details Defined in System.Posix.Types Methods quot :: CId -> CId -> CId # rem :: CId -> CId -> CId # div :: CId -> CId -> CId # mod :: CId -> CId -> CId # quotRem :: CId -> CId -> (CId, CId) # divMod :: CId -> CId -> (CId, CId) # toInteger :: CId -> Integer #
Integral CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods quot :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # rem :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # div :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # mod :: CFsFilCnt -> CFsFilCnt -> CFsFilCnt # quotRem :: CFsFilCnt -> CFsFilCnt -> (CFsFilCnt, CFsFilCnt) # divMod :: CFsFilCnt -> CFsFilCnt -> (CFsFilCnt, CFsFilCnt) # toInteger :: CFsFilCnt -> Integer #
Integral CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods quot :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # rem :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # div :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # mod :: CFsBlkCnt -> CFsBlkCnt -> CFsBlkCnt # quotRem :: CFsBlkCnt -> CFsBlkCnt -> (CFsBlkCnt, CFsBlkCnt) # divMod :: CFsBlkCnt -> CFsBlkCnt -> (CFsBlkCnt, CFsBlkCnt) # toInteger :: CFsBlkCnt -> Integer #
Integral CClockId # |
Instance details Defined in System.Posix.Types Methods quot :: CClockId -> CClockId -> CClockId # rem :: CClockId -> CClockId -> CClockId # div :: CClockId -> CClockId -> CClockId # mod :: CClockId -> CClockId -> CClockId # quotRem :: CClockId -> CClockId -> (CClockId, CClockId) # divMod :: CClockId -> CClockId -> (CClockId, CClockId) # toInteger :: CClockId -> Integer #
Integral CBlkCnt # |
Instance details Defined in System.Posix.Types Methods quot :: CBlkCnt -> CBlkCnt -> CBlkCnt # rem :: CBlkCnt -> CBlkCnt -> CBlkCnt # div :: CBlkCnt -> CBlkCnt -> CBlkCnt # mod :: CBlkCnt -> CBlkCnt -> CBlkCnt # quotRem :: CBlkCnt -> CBlkCnt -> (CBlkCnt, CBlkCnt) # divMod :: CBlkCnt -> CBlkCnt -> (CBlkCnt, CBlkCnt) # toInteger :: CBlkCnt -> Integer #
Integral CBlkSize # |
Instance details Defined in System.Posix.Types Methods quot :: CBlkSize -> CBlkSize -> CBlkSize # rem :: CBlkSize -> CBlkSize -> CBlkSize # div :: CBlkSize -> CBlkSize -> CBlkSize # mod :: CBlkSize -> CBlkSize -> CBlkSize # quotRem :: CBlkSize -> CBlkSize -> (CBlkSize, CBlkSize) # divMod :: CBlkSize -> CBlkSize -> (CBlkSize, CBlkSize) # toInteger :: CBlkSize -> Integer #
Integral CRLim # |
Instance details Defined in System.Posix.Types Methods quot :: CRLim -> CRLim -> CRLim # rem :: CRLim -> CRLim -> CRLim # div :: CRLim -> CRLim -> CRLim # mod :: CRLim -> CRLim -> CRLim # quotRem :: CRLim -> CRLim -> (CRLim, CRLim) # divMod :: CRLim -> CRLim -> (CRLim, CRLim) # toInteger :: CRLim -> Integer #
Integral CTcflag # |
Instance details Defined in System.Posix.Types Methods quot :: CTcflag -> CTcflag -> CTcflag # rem :: CTcflag -> CTcflag -> CTcflag # div :: CTcflag -> CTcflag -> CTcflag # mod :: CTcflag -> CTcflag -> CTcflag # quotRem :: CTcflag -> CTcflag -> (CTcflag, CTcflag) # divMod :: CTcflag -> CTcflag -> (CTcflag, CTcflag) # toInteger :: CTcflag -> Integer #
Integral CUid # |
Instance details Defined in System.Posix.Types Methods quot :: CUid -> CUid -> CUid # rem :: CUid -> CUid -> CUid # div :: CUid -> CUid -> CUid # mod :: CUid -> CUid -> CUid # quotRem :: CUid -> CUid -> (CUid, CUid) # divMod :: CUid -> CUid -> (CUid, CUid) # toInteger :: CUid -> Integer #
Integral CNlink # |
Instance details Defined in System.Posix.Types Methods quot :: CNlink -> CNlink -> CNlink # rem :: CNlink -> CNlink -> CNlink # div :: CNlink -> CNlink -> CNlink # mod :: CNlink -> CNlink -> CNlink # quotRem :: CNlink -> CNlink -> (CNlink, CNlink) # divMod :: CNlink -> CNlink -> (CNlink, CNlink) # toInteger :: CNlink -> Integer #
Integral CGid # |
Instance details Defined in System.Posix.Types Methods quot :: CGid -> CGid -> CGid # rem :: CGid -> CGid -> CGid # div :: CGid -> CGid -> CGid # mod :: CGid -> CGid -> CGid # quotRem :: CGid -> CGid -> (CGid, CGid) # divMod :: CGid -> CGid -> (CGid, CGid) # toInteger :: CGid -> Integer #
Integral CSsize # |
Instance details Defined in System.Posix.Types Methods quot :: CSsize -> CSsize -> CSsize # rem :: CSsize -> CSsize -> CSsize # div :: CSsize -> CSsize -> CSsize # mod :: CSsize -> CSsize -> CSsize # quotRem :: CSsize -> CSsize -> (CSsize, CSsize) # divMod :: CSsize -> CSsize -> (CSsize, CSsize) # toInteger :: CSsize -> Integer #
Integral CPid # |
Instance details Defined in System.Posix.Types Methods quot :: CPid -> CPid -> CPid # rem :: CPid -> CPid -> CPid # div :: CPid -> CPid -> CPid # mod :: CPid -> CPid -> CPid # quotRem :: CPid -> CPid -> (CPid, CPid) # divMod :: CPid -> CPid -> (CPid, CPid) # toInteger :: CPid -> Integer #
Integral COff # |
Instance details Defined in System.Posix.Types Methods quot :: COff -> COff -> COff # rem :: COff -> COff -> COff # div :: COff -> COff -> COff # mod :: COff -> COff -> COff # quotRem :: COff -> COff -> (COff, COff) # divMod :: COff -> COff -> (COff, COff) # toInteger :: COff -> Integer #
Integral CMode # |
Instance details Defined in System.Posix.Types Methods quot :: CMode -> CMode -> CMode # rem :: CMode -> CMode -> CMode # div :: CMode -> CMode -> CMode # mod :: CMode -> CMode -> CMode # quotRem :: CMode -> CMode -> (CMode, CMode) # divMod :: CMode -> CMode -> (CMode, CMode) # toInteger :: CMode -> Integer #
Integral CIno # |
Instance details Defined in System.Posix.Types Methods quot :: CIno -> CIno -> CIno # rem :: CIno -> CIno -> CIno # div :: CIno -> CIno -> CIno # mod :: CIno -> CIno -> CIno # quotRem :: CIno -> CIno -> (CIno, CIno) # divMod :: CIno -> CIno -> (CIno, CIno) # toInteger :: CIno -> Integer #
Integral CDev # |
Instance details Defined in System.Posix.Types Methods quot :: CDev -> CDev -> CDev # rem :: CDev -> CDev -> CDev # div :: CDev -> CDev -> CDev # mod :: CDev -> CDev -> CDev # quotRem :: CDev -> CDev -> (CDev, CDev) # divMod :: CDev -> CDev -> (CDev, CDev) # toInteger :: CDev -> Integer #
Integral a => Integral (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods quot :: Identity a -> Identity a -> Identity a # rem :: Identity a -> Identity a -> Identity a # div :: Identity a -> Identity a -> Identity a # mod :: Identity a -> Identity a -> Identity a # quotRem :: Identity a -> Identity a -> (Identity a, Identity a) # divMod :: Identity a -> Identity a -> (Identity a, Identity a) # toInteger :: Identity a -> Integer #
Integral a => Integral (Const a b) # |
Instance details Defined in Data.Functor.Const Methods quot :: Const a b -> Const a b -> Const a b # rem :: Const a b -> Const a b -> Const a b # div :: Const a b -> Const a b -> Const a b # mod :: Const a b -> Const a b -> Const a b # quotRem :: Const a b -> Const a b -> (Const a b, Const a b) # divMod :: Const a b -> Const a b -> (Const a b, Const a b) # toInteger :: Const a b -> Integer #

class Num a => Fractional a where #

Fractional numbers, supporting real division.

Minimal complete definition

fromRational, (recip | (/))

Methods

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

fractional division

recip :: a -> a #

reciprocal fraction

fromRational :: Rational -> a #

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 # | Since: base-2.1
Instance details Defined in GHC.Float Methods (/) :: Double -> Double -> Double # recip :: Double -> Double # fromRational :: Rational -> Double #
Fractional Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods (/) :: Float -> Float -> Float # recip :: Float -> Float # fromRational :: Rational -> Float #
Fractional CDouble # |
Instance details Defined in Foreign.C.Types Methods (/) :: CDouble -> CDouble -> CDouble # recip :: CDouble -> CDouble # fromRational :: Rational -> CDouble #
Fractional CFloat # |
Instance details Defined in Foreign.C.Types Methods (/) :: CFloat -> CFloat -> CFloat # recip :: CFloat -> CFloat # fromRational :: Rational -> CFloat #
Integral a => Fractional (Ratio a) # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods (/) :: Ratio a -> Ratio a -> Ratio a # recip :: Ratio a -> Ratio a # fromRational :: Rational -> Ratio a #
Fractional a => Fractional (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods (/) :: Identity a -> Identity a -> Identity a # recip :: Identity a -> Identity a # fromRational :: Rational -> Identity a #
HasResolution a => Fractional (Fixed a) # | Since: base-2.1
Instance details Defined in Data.Fixed Methods (/) :: Fixed a -> Fixed a -> Fixed a # recip :: Fixed a -> Fixed a # fromRational :: Rational -> Fixed a #
RealFloat a => Fractional (Complex a) # | Since: base-2.1
Instance details Defined in Data.Complex Methods (/) :: Complex a -> Complex a -> Complex a # recip :: Complex a -> Complex a # fromRational :: Rational -> Complex a #
Fractional a => Fractional (Const a b) # |
Instance details Defined in Data.Functor.Const Methods (/) :: Const a b -> Const a b -> Const a b # recip :: Const a b -> Const a b # fromRational :: Rational -> Const a b #

class Fractional a => Floating a where #

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 #

exp :: a -> a #

log :: a -> a #

sqrt :: a -> a #

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

logBase :: a -> a -> a #

sin :: a -> a #

cos :: a -> a #

tan :: a -> a #

asin :: a -> a #

acos :: a -> a #

atan :: a -> a #

sinh :: a -> a #

cosh :: a -> a #

tanh :: a -> a #

asinh :: a -> a #

acosh :: a -> a #

atanh :: a -> a #

Instances

Floating Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Double # exp :: Double -> Double # log :: Double -> Double # sqrt :: Double -> Double # (**) :: Double -> Double -> Double # logBase :: Double -> Double -> Double # sin :: Double -> Double # cos :: Double -> Double # tan :: Double -> Double # asin :: Double -> Double # acos :: Double -> Double # atan :: Double -> Double # sinh :: Double -> Double # cosh :: Double -> Double # tanh :: Double -> Double # asinh :: Double -> Double # acosh :: Double -> Double # atanh :: Double -> Double # log1p :: Double -> Double # expm1 :: Double -> Double # log1pexp :: Double -> Double # log1mexp :: Double -> Double #
Floating Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods pi :: Float # exp :: Float -> Float # log :: Float -> Float # sqrt :: Float -> Float # (**) :: Float -> Float -> Float # logBase :: Float -> Float -> Float # sin :: Float -> Float # cos :: Float -> Float # tan :: Float -> Float # asin :: Float -> Float # acos :: Float -> Float # atan :: Float -> Float # sinh :: Float -> Float # cosh :: Float -> Float # tanh :: Float -> Float # asinh :: Float -> Float # acosh :: Float -> Float # atanh :: Float -> Float # log1p :: Float -> Float # expm1 :: Float -> Float # log1pexp :: Float -> Float # log1mexp :: Float -> Float #
Floating CDouble # |
Instance details Defined in Foreign.C.Types Methods pi :: CDouble # exp :: CDouble -> CDouble # log :: CDouble -> CDouble # sqrt :: CDouble -> CDouble # (**) :: CDouble -> CDouble -> CDouble # logBase :: CDouble -> CDouble -> CDouble # sin :: CDouble -> CDouble # cos :: CDouble -> CDouble # tan :: CDouble -> CDouble # asin :: CDouble -> CDouble # acos :: CDouble -> CDouble # atan :: CDouble -> CDouble # sinh :: CDouble -> CDouble # cosh :: CDouble -> CDouble # tanh :: CDouble -> CDouble # asinh :: CDouble -> CDouble # acosh :: CDouble -> CDouble # atanh :: CDouble -> CDouble # log1p :: CDouble -> CDouble # expm1 :: CDouble -> CDouble # log1pexp :: CDouble -> CDouble # log1mexp :: CDouble -> CDouble #
Floating CFloat # |
Instance details Defined in Foreign.C.Types Methods pi :: CFloat # exp :: CFloat -> CFloat # log :: CFloat -> CFloat # sqrt :: CFloat -> CFloat # (**) :: CFloat -> CFloat -> CFloat # logBase :: CFloat -> CFloat -> CFloat # sin :: CFloat -> CFloat # cos :: CFloat -> CFloat # tan :: CFloat -> CFloat # asin :: CFloat -> CFloat # acos :: CFloat -> CFloat # atan :: CFloat -> CFloat # sinh :: CFloat -> CFloat # cosh :: CFloat -> CFloat # tanh :: CFloat -> CFloat # asinh :: CFloat -> CFloat # acosh :: CFloat -> CFloat # atanh :: CFloat -> CFloat # log1p :: CFloat -> CFloat # expm1 :: CFloat -> CFloat # log1pexp :: CFloat -> CFloat # log1mexp :: CFloat -> CFloat #
Floating a => Floating (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods pi :: Identity a # exp :: Identity a -> Identity a # log :: Identity a -> Identity a # sqrt :: Identity a -> Identity a # (**) :: Identity a -> Identity a -> Identity a # logBase :: Identity a -> Identity a -> Identity a # sin :: Identity a -> Identity a # cos :: Identity a -> Identity a # tan :: Identity a -> Identity a # asin :: Identity a -> Identity a # acos :: Identity a -> Identity a # atan :: Identity a -> Identity a # sinh :: Identity a -> Identity a # cosh :: Identity a -> Identity a # tanh :: Identity a -> Identity a # asinh :: Identity a -> Identity a # acosh :: Identity a -> Identity a # atanh :: Identity a -> Identity a # log1p :: Identity a -> Identity a # expm1 :: Identity a -> Identity a # log1pexp :: Identity a -> Identity a # log1mexp :: Identity a -> Identity a #
RealFloat a => Floating (Complex a) # | Since: base-2.1
Instance details Defined in Data.Complex Methods pi :: Complex a # exp :: Complex a -> Complex a # log :: Complex a -> Complex a # sqrt :: Complex a -> Complex a # (**) :: Complex a -> Complex a -> Complex a # logBase :: Complex a -> Complex a -> Complex a # sin :: Complex a -> Complex a # cos :: Complex a -> Complex a # tan :: Complex a -> Complex a # asin :: Complex a -> Complex a # acos :: Complex a -> Complex a # atan :: Complex a -> Complex a # sinh :: Complex a -> Complex a # cosh :: Complex a -> Complex a # tanh :: Complex a -> Complex a # asinh :: Complex a -> Complex a # acosh :: Complex a -> Complex a # atanh :: Complex a -> Complex a # log1p :: Complex a -> Complex a # expm1 :: Complex a -> Complex a # log1pexp :: Complex a -> Complex a # log1mexp :: Complex a -> Complex a #
Floating a => Floating (Const a b) # |
Instance details Defined in Data.Functor.Const Methods pi :: Const a b # exp :: Const a b -> Const a b # log :: Const a b -> Const a b # sqrt :: Const a b -> Const a b # (**) :: Const a b -> Const a b -> Const a b # logBase :: Const a b -> Const a b -> Const a b # sin :: Const a b -> Const a b # cos :: Const a b -> Const a b # tan :: Const a b -> Const a b # asin :: Const a b -> Const a b # acos :: Const a b -> Const a b # atan :: Const a b -> Const a b # sinh :: Const a b -> Const a b # cosh :: Const a b -> Const a b # tanh :: Const a b -> Const a b # asinh :: Const a b -> Const a b # acosh :: Const a b -> Const a b # atanh :: Const a b -> Const a b # log1p :: Const a b -> Const a b # expm1 :: Const a b -> Const a b # log1pexp :: Const a b -> Const a b # log1mexp :: Const a b -> Const a b #

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

Extracting components of fractions.

Minimal complete definition

properFraction

Methods

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

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 #

``truncate` x` returns the integer nearest `x` between zero and `x`

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

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

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

``ceiling` x` returns the least integer not less than `x`

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

``floor` x` returns the greatest integer not greater than `x`

Instances

RealFrac Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods properFraction :: Integral b => Double -> (b, Double) # truncate :: Integral b => Double -> b # round :: Integral b => Double -> b # ceiling :: Integral b => Double -> b # floor :: Integral b => Double -> b #
RealFrac Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods properFraction :: Integral b => Float -> (b, Float) # truncate :: Integral b => Float -> b # round :: Integral b => Float -> b # ceiling :: Integral b => Float -> b # floor :: Integral b => Float -> b #
RealFrac CDouble # |
Instance details Defined in Foreign.C.Types Methods properFraction :: Integral b => CDouble -> (b, CDouble) # truncate :: Integral b => CDouble -> b # round :: Integral b => CDouble -> b # ceiling :: Integral b => CDouble -> b # floor :: Integral b => CDouble -> b #
RealFrac CFloat # |
Instance details Defined in Foreign.C.Types Methods properFraction :: Integral b => CFloat -> (b, CFloat) # truncate :: Integral b => CFloat -> b # round :: Integral b => CFloat -> b # ceiling :: Integral b => CFloat -> b # floor :: Integral b => CFloat -> b #
Integral a => RealFrac (Ratio a) # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods properFraction :: Integral b => Ratio a -> (b, Ratio a) # truncate :: Integral b => Ratio a -> b # round :: Integral b => Ratio a -> b # ceiling :: Integral b => Ratio a -> b # floor :: Integral b => Ratio a -> b #
RealFrac a => RealFrac (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods properFraction :: Integral b => Identity a -> (b, Identity a) # truncate :: Integral b => Identity a -> b # round :: Integral b => Identity a -> b # ceiling :: Integral b => Identity a -> b # floor :: Integral b => Identity a -> b #
HasResolution a => RealFrac (Fixed a) # | Since: base-2.1
Instance details Defined in Data.Fixed Methods properFraction :: Integral b => Fixed a -> (b, Fixed a) # truncate :: Integral b => Fixed a -> b # round :: Integral b => Fixed a -> b # ceiling :: Integral b => Fixed a -> b # floor :: Integral b => Fixed a -> b #
RealFrac a => RealFrac (Const a b) # |
Instance details Defined in Data.Functor.Const Methods properFraction :: Integral b0 => Const a b -> (b0, Const a b) # truncate :: Integral b0 => Const a b -> b0 # round :: Integral b0 => Const a b -> b0 # ceiling :: Integral b0 => Const a b -> b0 # floor :: Integral b0 => Const a b -> b0 #

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

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

Minimal complete definition

floatRadix, floatDigits, floatRange, decodeFloat, encodeFloat, isNaN, isInfinite, isDenormalized, isNegativeZero, isIEEE

Methods

floatRadix :: a -> Integer #

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

floatDigits :: a -> Int #

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

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

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

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

The function `decodeFloat` applied to a real floating-point number returns the significand expressed as an `Integer` and an appropriately scaled exponent (an `Int`). If ``decodeFloat` x` yields `(m,n)`, then `x` is equal in value to `m*b^^n`, where `b` is the floating-point radix, and furthermore, either `m` and `n` are both zero or else `b^(d-1) <= `abs` m < b^d`, where `d` is the value of ``floatDigits` x`. In particular, ``decodeFloat` 0 = (0,0)`. If the type contains a negative zero, also ``decodeFloat` (-0.0) = (0,0)`. The result of ``decodeFloat` x` is unspecified if either of ``isNaN` x` or ``isInfinite` x` is `True`.

encodeFloat :: Integer -> Int -> a #

`encodeFloat` performs the inverse of `decodeFloat` in the sense that for finite `x` with the exception of `-0.0`, ``uncurry` `encodeFloat` (`decodeFloat` x) = x`. ``encodeFloat` m n` is one of the two closest representable floating-point numbers to `m*b^^n` (or `±Infinity` if overflow occurs); usually the closer, but if `m` contains too many bits, the result may be rounded in the wrong direction.

exponent :: a -> Int #

`exponent` corresponds to the second component of `decodeFloat`. ``exponent` 0 = 0` and for finite nonzero `x`, ``exponent` x = snd (`decodeFloat` x) + `floatDigits` x`. If `x` is a finite floating-point number, it is equal in value to ``significand` x * b ^^ `exponent` x`, where `b` is the floating-point radix. The behaviour is unspecified on infinite or `NaN` values.

significand :: a -> a #

The first component of `decodeFloat`, scaled to lie in the open interval (`-1`,`1`), either `0.0` or of absolute value `>= 1/b`, where `b` is the floating-point radix. The behaviour is unspecified on infinite or `NaN` values.

scaleFloat :: Int -> a -> a #

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

isNaN :: a -> Bool #

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

isInfinite :: a -> Bool #

`True` if the argument is an IEEE infinity or negative infinity

isDenormalized :: a -> Bool #

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

isNegativeZero :: a -> Bool #

`True` if the argument is an IEEE negative zero

isIEEE :: a -> Bool #

`True` if the argument is an IEEE floating point number

atan2 :: a -> a -> a #

a version of arctangent taking two real floating-point arguments. For real floating `x` and `y`, ``atan2` y x` computes the angle (from the positive x-axis) of the vector from the origin to the point `(x,y)`. ``atan2` y x` returns a value in the range [`-pi`, `pi`]. It follows the Common Lisp semantics for the origin when signed zeroes are supported. ``atan2` y 1`, with `y` in a type that is `RealFloat`, should return the same value as ``atan` y`. A default definition of `atan2` is provided, but implementors can provide a more accurate implementation.

Instances

RealFloat Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Double -> Integer # floatDigits :: Double -> Int # floatRange :: Double -> (Int, Int) # decodeFloat :: Double -> (Integer, Int) # encodeFloat :: Integer -> Int -> Double # exponent :: Double -> Int # significand :: Double -> Double # scaleFloat :: Int -> Double -> Double # isNaN :: Double -> Bool # isInfinite :: Double -> Bool # isDenormalized :: Double -> Bool # isNegativeZero :: Double -> Bool # isIEEE :: Double -> Bool # atan2 :: Double -> Double -> Double #
RealFloat Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods floatRadix :: Float -> Integer # floatDigits :: Float -> Int # floatRange :: Float -> (Int, Int) # decodeFloat :: Float -> (Integer, Int) # encodeFloat :: Integer -> Int -> Float # exponent :: Float -> Int # significand :: Float -> Float # scaleFloat :: Int -> Float -> Float # isNaN :: Float -> Bool # isInfinite :: Float -> Bool # isDenormalized :: Float -> Bool # isNegativeZero :: Float -> Bool # isIEEE :: Float -> Bool # atan2 :: Float -> Float -> Float #
RealFloat CDouble # |
Instance details Defined in Foreign.C.Types Methods floatRadix :: CDouble -> Integer # floatDigits :: CDouble -> Int # floatRange :: CDouble -> (Int, Int) # decodeFloat :: CDouble -> (Integer, Int) # encodeFloat :: Integer -> Int -> CDouble # exponent :: CDouble -> Int # significand :: CDouble -> CDouble # scaleFloat :: Int -> CDouble -> CDouble # isNaN :: CDouble -> Bool # isInfinite :: CDouble -> Bool # isDenormalized :: CDouble -> Bool # isNegativeZero :: CDouble -> Bool # isIEEE :: CDouble -> Bool # atan2 :: CDouble -> CDouble -> CDouble #
RealFloat CFloat # |
Instance details Defined in Foreign.C.Types Methods floatRadix :: CFloat -> Integer # floatDigits :: CFloat -> Int # floatRange :: CFloat -> (Int, Int) # decodeFloat :: CFloat -> (Integer, Int) # encodeFloat :: Integer -> Int -> CFloat # exponent :: CFloat -> Int # significand :: CFloat -> CFloat # scaleFloat :: Int -> CFloat -> CFloat # isNaN :: CFloat -> Bool # isInfinite :: CFloat -> Bool # isDenormalized :: CFloat -> Bool # isNegativeZero :: CFloat -> Bool # isIEEE :: CFloat -> Bool # atan2 :: CFloat -> CFloat -> CFloat #
RealFloat a => RealFloat (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods floatRadix :: Identity a -> Integer # floatDigits :: Identity a -> Int # floatRange :: Identity a -> (Int, Int) # decodeFloat :: Identity a -> (Integer, Int) # encodeFloat :: Integer -> Int -> Identity a # exponent :: Identity a -> Int # significand :: Identity a -> Identity a # scaleFloat :: Int -> Identity a -> Identity a # isNaN :: Identity a -> Bool # isInfinite :: Identity a -> Bool # isDenormalized :: Identity a -> Bool # isNegativeZero :: Identity a -> Bool # isIEEE :: Identity a -> Bool # atan2 :: Identity a -> Identity a -> Identity a #
RealFloat a => RealFloat (Const a b) # |
Instance details Defined in Data.Functor.Const Methods floatRadix :: Const a b -> Integer # floatDigits :: Const a b -> Int # floatRange :: Const a b -> (Int, Int) # decodeFloat :: Const a b -> (Integer, Int) # encodeFloat :: Integer -> Int -> Const a b # exponent :: Const a b -> Int # significand :: Const a b -> Const a b # scaleFloat :: Int -> Const a b -> Const a b # isNaN :: Const a b -> Bool # isInfinite :: Const a b -> Bool # isDenormalized :: Const a b -> Bool # isNegativeZero :: Const a b -> Bool # isIEEE :: Const a b -> Bool # atan2 :: Const a b -> Const a b -> Const a b #

### Numeric functions

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

the same as ``flip` (`-`)`.

Because `-` is treated specially in the Haskell grammar, `(-` e`)` is not a section, but an application of prefix negation. However, `(`subtract`` exp`)` is equivalent to the disallowed section.

even :: Integral a => a -> Bool #

odd :: Integral a => a -> Bool #

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

``gcd` x y` is the non-negative factor of both `x` and `y` of which every common factor of `x` and `y` is also a factor; for example ``gcd` 4 2 = 2`, ``gcd` (-4) 6 = 2`, ``gcd` 0 4` = `4`. ``gcd` 0 0` = `0`. (That is, the common divisor that is "greatest" in the divisibility preordering.)

Note: Since for signed fixed-width integer types, ``abs` `minBound` < 0`, the result may be negative if one of the arguments is ``minBound`` (and necessarily is if the other is `0` or ``minBound``) for such types.

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

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

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

raise a number to a non-negative integral power

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

raise a number to an integral power

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

general coercion from integral types

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

general coercion to fractional types

## Semigroups and Monoids

class Semigroup a where #

The class of semigroups (types with an associative binary operation).

Instances should satisfy the associativity law:

-     x <> (y <> z) = (x <> y) <> z

Since: base-4.9.0.0

Minimal complete definition

(<>)

Methods

(<>) :: a -> a -> a infixr 6 #

An associative operation.

Instances

Semigroup Ordering # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Ordering -> Ordering -> Ordering # sconcat :: NonEmpty Ordering -> Ordering # stimes :: Integral b => b -> Ordering -> Ordering #
Semigroup () # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: () -> () -> () # sconcat :: NonEmpty () -> () # stimes :: Integral b => b -> () -> () #
Semigroup Any # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Any -> Any -> Any # sconcat :: NonEmpty Any -> Any # stimes :: Integral b => b -> Any -> Any #
Semigroup All # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: All -> All -> All # sconcat :: NonEmpty All -> All # stimes :: Integral b => b -> All -> All #
Semigroup Lifetime # | Since: base-4.10.0.0
Instance details Defined in GHC.Event.Internal Methods (<>) :: Lifetime -> Lifetime -> Lifetime # sconcat :: NonEmpty Lifetime -> Lifetime # stimes :: Integral b => b -> Lifetime -> Lifetime #
Semigroup Event # | Since: base-4.10.0.0
Instance details Defined in GHC.Event.Internal Methods (<>) :: Event -> Event -> Event # sconcat :: NonEmpty Event -> Event # stimes :: Integral b => b -> Event -> Event #
Semigroup Void # | Since: base-4.9.0.0
Instance details Defined in Data.Void Methods (<>) :: Void -> Void -> Void # sconcat :: NonEmpty Void -> Void # stimes :: Integral b => b -> Void -> Void #
Semigroup [a] # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: [a] -> [a] -> [a] # sconcat :: NonEmpty [a] -> [a] # stimes :: Integral b => b -> [a] -> [a] #
Semigroup a => Semigroup (Maybe a) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: Maybe a -> Maybe a -> Maybe a # sconcat :: NonEmpty (Maybe a) -> Maybe a # stimes :: Integral b => b -> Maybe a -> Maybe a #
Semigroup a => Semigroup (IO a) # | Since: base-4.10.0.0
Instance details Defined in GHC.Base Methods (<>) :: IO a -> IO a -> IO a # sconcat :: NonEmpty (IO a) -> IO a # stimes :: Integral b => b -> IO a -> IO a #
Semigroup (NonEmpty a) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: NonEmpty a -> NonEmpty a -> NonEmpty a # sconcat :: NonEmpty (NonEmpty a) -> NonEmpty a # stimes :: Integral b => b -> NonEmpty a -> NonEmpty a #
Semigroup a => Semigroup (Down a) # | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (<>) :: Down a -> Down a -> Down a # sconcat :: NonEmpty (Down a) -> Down a # stimes :: Integral b => b -> Down a -> Down a #
Num a => Semigroup (Product a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Product a -> Product a -> Product a # sconcat :: NonEmpty (Product a) -> Product a # stimes :: Integral b => b -> Product a -> Product a #
Num a => Semigroup (Sum a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Sum a -> Sum a -> Sum a # sconcat :: NonEmpty (Sum a) -> Sum a # stimes :: Integral b => b -> Sum a -> Sum a #
Semigroup (Endo a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Endo a -> Endo a -> Endo a # sconcat :: NonEmpty (Endo a) -> Endo a # stimes :: Integral b => b -> Endo a -> Endo a #
Semigroup a => Semigroup (Dual a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Dual a -> Dual a -> Dual a # sconcat :: NonEmpty (Dual a) -> Dual a # stimes :: Integral b => b -> Dual a -> Dual a #
Semigroup (Last a) # | Since: base-4.9.0.0
Instance details Defined in Data.Monoid Methods (<>) :: Last a -> Last a -> Last a # sconcat :: NonEmpty (Last a) -> Last a # stimes :: Integral b => b -> Last a -> Last a #
Semigroup (First a) # | Since: base-4.9.0.0
Instance details Defined in Data.Monoid Methods (<>) :: First a -> First a -> First a # sconcat :: NonEmpty (First a) -> First a # stimes :: Integral b => b -> First a -> First a #
Semigroup a => Semigroup (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods (<>) :: Identity a -> Identity a -> Identity a # sconcat :: NonEmpty (Identity a) -> Identity a # stimes :: Integral b => b -> Identity a -> Identity a #
Semigroup a => Semigroup (Option a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Option a -> Option a -> Option a # sconcat :: NonEmpty (Option a) -> Option a # stimes :: Integral b => b -> Option a -> Option a #
Monoid m => Semigroup (WrappedMonoid m) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # sconcat :: NonEmpty (WrappedMonoid m) -> WrappedMonoid m # stimes :: Integral b => b -> WrappedMonoid m -> WrappedMonoid m #
Semigroup (Last a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Last a -> Last a -> Last a # sconcat :: NonEmpty (Last a) -> Last a # stimes :: Integral b => b -> Last a -> Last a #
Semigroup (First a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: First a -> First a -> First a # sconcat :: NonEmpty (First a) -> First a # stimes :: Integral b => b -> First a -> First a #
Ord a => Semigroup (Max a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Max a -> Max a -> Max a # sconcat :: NonEmpty (Max a) -> Max a # stimes :: Integral b => b -> Max a -> Max a #
Ord a => Semigroup (Min a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (<>) :: Min a -> Min a -> Min a # sconcat :: NonEmpty (Min a) -> Min a # stimes :: Integral b => b -> Min a -> Min a #
Semigroup b => Semigroup (a -> b) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a -> b) -> (a -> b) -> a -> b # sconcat :: NonEmpty (a -> b) -> a -> b # stimes :: Integral b0 => b0 -> (a -> b) -> a -> b #
Semigroup (Either a b) # | Since: base-4.9.0.0
Instance details Defined in Data.Either Methods (<>) :: Either a b -> Either a b -> Either a b # sconcat :: NonEmpty (Either a b) -> Either a b # stimes :: Integral b0 => b0 -> Either a b -> Either a b #
(Semigroup a, Semigroup b) => Semigroup (a, b) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a, b) -> (a, b) -> (a, b) # sconcat :: NonEmpty (a, b) -> (a, b) # stimes :: Integral b0 => b0 -> (a, b) -> (a, b) #
Semigroup a => Semigroup (ST s a) # | Since: base-4.11.0.0
Instance details Defined in GHC.ST Methods (<>) :: ST s a -> ST s a -> ST s a # sconcat :: NonEmpty (ST s a) -> ST s a # stimes :: Integral b => b -> ST s a -> ST s a #
Semigroup (Proxy s) # | Since: base-4.9.0.0
Instance details Defined in Data.Proxy Methods (<>) :: Proxy s -> Proxy s -> Proxy s # sconcat :: NonEmpty (Proxy s) -> Proxy s # stimes :: Integral b => b -> Proxy s -> Proxy s #
(Semigroup a, Semigroup b, Semigroup c) => Semigroup (a, b, c) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a, b, c) -> (a, b, c) -> (a, b, c) # sconcat :: NonEmpty (a, b, c) -> (a, b, c) # stimes :: Integral b0 => b0 -> (a, b, c) -> (a, b, c) #
Alternative f => Semigroup (Alt f a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup.Internal Methods (<>) :: Alt f a -> Alt f a -> Alt f a # sconcat :: NonEmpty (Alt f a) -> Alt f a # stimes :: Integral b => b -> Alt f a -> Alt f a #
Semigroup a => Semigroup (Const a b) # |
Instance details Defined in Data.Functor.Const Methods (<>) :: Const a b -> Const a b -> Const a b # sconcat :: NonEmpty (Const a b) -> Const a b # stimes :: Integral b0 => b0 -> Const a b -> Const a b #
(Semigroup a, Semigroup b, Semigroup c, Semigroup d) => Semigroup (a, b, c, d) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) # sconcat :: NonEmpty (a, b, c, d) -> (a, b, c, d) # stimes :: Integral b0 => b0 -> (a, b, c, d) -> (a, b, c, d) #
(Semigroup a, Semigroup b, Semigroup c, Semigroup d, Semigroup e) => Semigroup (a, b, c, d, e) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (<>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # sconcat :: NonEmpty (a, b, c, d, e) -> (a, b, c, d, e) # stimes :: Integral b0 => b0 -> (a, b, c, d, e) -> (a, b, c, d, e) #

class Semigroup a => Monoid a where #

The class of monoids (types with an associative binary operation that has an identity). Instances should satisfy the following laws:

-     x <> mempty = x

-     mempty <> x = x

- `x `<>` (y `<>` z) = (x `<>` y) `<>` z` (`Semigroup` law)

-     mconcat = foldr '(<>)' mempty

The method names refer to the monoid of lists under concatenation, but there are many other instances.

Some types can be viewed as a monoid in more than one way, e.g. both addition and multiplication on numbers. In such cases we often define `newtype`s and make those instances of `Monoid`, e.g. `Sum` and `Product`.

NOTE: `Semigroup` is a superclass of `Monoid` since base-4.11.0.0.

Minimal complete definition

mempty

Methods

mempty :: a #

Identity of `mappend`

mappend :: a -> a -> a #

An associative operation

NOTE: This method is redundant and has the default implementation ``mappend` = '(<>)'` since base-4.11.0.0.

mconcat :: [a] -> a #

Fold a list using the monoid.

For most types, the default definition for `mconcat` will be used, but the function is included in the class definition so that an optimized version can be provided for specific types.

Instances

Monoid Ordering # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Ordering # mappend :: Ordering -> Ordering -> Ordering # mconcat :: [Ordering] -> Ordering #
Monoid () # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: () # mappend :: () -> () -> () # mconcat :: [()] -> () #
Monoid Any # | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Any # mappend :: Any -> Any -> Any # mconcat :: [Any] -> Any #
Monoid All # | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: All # mappend :: All -> All -> All # mconcat :: [All] -> All #
Monoid Lifetime # | `mappend` takes the longer of two lifetimes. Since: base-4.8.0.0
Instance details Defined in GHC.Event.Internal Methods mempty :: Lifetime # mappend :: Lifetime -> Lifetime -> Lifetime # mconcat :: [Lifetime] -> Lifetime #
Monoid Event # | Since: base-4.3.1.0
Instance details Defined in GHC.Event.Internal Methods mempty :: Event # mappend :: Event -> Event -> Event # mconcat :: [Event] -> Event #
Monoid [a] # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: [a] # mappend :: [a] -> [a] -> [a] # mconcat :: [[a]] -> [a] #
Semigroup a => Monoid (Maybe a) # | Lift a semigroup into `Maybe` forming a `Monoid` according to http://en.wikipedia.org/wiki/Monoid: "Any semigroup `S` may be turned into a monoid simply by adjoining an element `e` not in `S` and defining `e*e = e` and `e*s = s = s*e` for all `s ∈ S`." Since 4.11.0: constraint on inner `a` value generalised from `Monoid` to `Semigroup`. Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: Maybe a # mappend :: Maybe a -> Maybe a -> Maybe a # mconcat :: [Maybe a] -> Maybe a #
Monoid a => Monoid (IO a) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mempty :: IO a # mappend :: IO a -> IO a -> IO a # mconcat :: [IO a] -> IO a #
Monoid a => Monoid (Down a) # | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods mempty :: Down a # mappend :: Down a -> Down a -> Down a # mconcat :: [Down a] -> Down a #
Num a => Monoid (Product a) # | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Product a # mappend :: Product a -> Product a -> Product a # mconcat :: [Product a] -> Product a #
Num a => Monoid (Sum a) # | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Sum a # mappend :: Sum a -> Sum a -> Sum a # mconcat :: [Sum a] -> Sum a #
Monoid (Endo a) # | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Endo a # mappend :: Endo a -> Endo a -> Endo a # mconcat :: [Endo a] -> Endo a #
Monoid a => Monoid (Dual a) # | Since: base-2.1
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Dual a # mappend :: Dual a -> Dual a -> Dual a # mconcat :: [Dual a] -> Dual a #
Monoid (Last a) # | Since: base-2.1
Instance details Defined in Data.Monoid Methods mempty :: Last a # mappend :: Last a -> Last a -> Last a # mconcat :: [Last a] -> Last a #
Monoid (First a) # | Since: base-2.1
Instance details Defined in Data.Monoid Methods mempty :: First a # mappend :: First a -> First a -> First a # mconcat :: [First a] -> First a #
Monoid a => Monoid (Identity a) # |
Instance details Defined in Data.Functor.Identity Methods mempty :: Identity a # mappend :: Identity a -> Identity a -> Identity a # mconcat :: [Identity a] -> Identity a #
Semigroup a => Monoid (Option a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Option a # mappend :: Option a -> Option a -> Option a # mconcat :: [Option a] -> Option a #
Monoid m => Monoid (WrappedMonoid m) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: WrappedMonoid m # mappend :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # mconcat :: [WrappedMonoid m] -> WrappedMonoid m #
(Ord a, Bounded a) => Monoid (Max a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Max a # mappend :: Max a -> Max a -> Max a # mconcat :: [Max a] -> Max a #
(Ord a, Bounded a) => Monoid (Min a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods mempty :: Min a # mappend :: Min a -> Min a -> Min a # mconcat :: [Min a] -> Min a #
Monoid b => Monoid (a -> b) # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: a -> b # mappend :: (a -> b) -> (a -> b) -> a -> b # mconcat :: [a -> b] -> a -> b #
(Monoid a, Monoid b) => Monoid (a, b) # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: (a, b) # mappend :: (a, b) -> (a, b) -> (a, b) # mconcat :: [(a, b)] -> (a, b) #
Monoid a => Monoid (ST s a) # | Since: base-4.11.0.0
Instance details Defined in GHC.ST Methods mempty :: ST s a # mappend :: ST s a -> ST s a -> ST s a # mconcat :: [ST s a] -> ST s a #
Monoid (Proxy s) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods mempty :: Proxy s # mappend :: Proxy s -> Proxy s -> Proxy s # mconcat :: [Proxy s] -> Proxy s #
(Monoid a, Monoid b, Monoid c) => Monoid (a, b, c) # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: (a, b, c) # mappend :: (a, b, c) -> (a, b, c) -> (a, b, c) # mconcat :: [(a, b, c)] -> (a, b, c) #
Alternative f => Monoid (Alt f a) # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods mempty :: Alt f a # mappend :: Alt f a -> Alt f a -> Alt f a # mconcat :: [Alt f a] -> Alt f a #
Monoid a => Monoid (Const a b) # |
Instance details Defined in Data.Functor.Const Methods mempty :: Const a b # mappend :: Const a b -> Const a b -> Const a b # mconcat :: [Const a b] -> Const a b #
(Monoid a, Monoid b, Monoid c, Monoid d) => Monoid (a, b, c, d) # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: (a, b, c, d) # mappend :: (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) # mconcat :: [(a, b, c, d)] -> (a, b, c, d) #
(Monoid a, Monoid b, Monoid c, Monoid d, Monoid e) => Monoid (a, b, c, d, e) # | Since: base-2.1
Instance details Defined in GHC.Base Methods mempty :: (a, b, c, d, e) # mappend :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # mconcat :: [(a, b, c, d, e)] -> (a, b, c, d, e) #

## Monads and functors

class Functor f where #

The `Functor` class is used for types that can be mapped over. Instances of `Functor` should satisfy the following laws:

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

The instances of `Functor` for lists, `Maybe` and `IO` satisfy these laws.

Minimal complete definition

fmap

Methods

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

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

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

Instances

Functor [] # | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> [a] -> [b] # (<$) :: a -> [b] -> [a] #
Functor Maybe # | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> Maybe a -> Maybe b # (<$) :: a -> Maybe b -> Maybe a #
Functor IO # | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> IO a -> IO b # (<$) :: a -> IO b -> IO a #
Functor Par1 # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> Par1 a -> Par1 b # (<$) :: a -> Par1 b -> Par1 a #
Functor NonEmpty # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> NonEmpty a -> NonEmpty b # (<$) :: a -> NonEmpty b -> NonEmpty a #
Functor ReadP # | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods fmap :: (a -> b) -> ReadP a -> ReadP b # (<$) :: a -> ReadP b -> ReadP a #
Functor ReadPrec # | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods fmap :: (a -> b) -> ReadPrec a -> ReadPrec b # (<$) :: a -> ReadPrec b -> ReadPrec a #
Functor Down # | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods fmap :: (a -> b) -> Down a -> Down b # (<$) :: a -> Down b -> Down a #
Functor Product # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Product a -> Product b # (<$) :: a -> Product b -> Product a #
Functor Sum # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Sum a -> Sum b # (<$) :: a -> Sum b -> Sum a #
Functor Dual # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Dual a -> Dual b # (<$) :: a -> Dual b -> Dual a #
Functor Last # |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
Functor First # |
Instance details Defined in Data.Monoid Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
Functor STM # | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods fmap :: (a -> b) -> STM a -> STM b # (<$) :: a -> STM b -> STM a #
Functor Handler # | Since: base-4.6.0.0
Instance details Defined in Control.Exception Methods fmap :: (a -> b) -> Handler a -> Handler b # (<$) :: a -> Handler b -> Handler a #
Functor Identity # | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fmap :: (a -> b) -> Identity a -> Identity b # (<$) :: a -> Identity b -> Identity a #
Functor ZipList # |
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> ZipList a -> ZipList b # (<$) :: a -> ZipList b -> ZipList a #
Functor ArgDescr # | Since: base-4.6.0.0
Instance details Defined in System.Console.GetOpt Methods fmap :: (a -> b) -> ArgDescr a -> ArgDescr b # (<$) :: a -> ArgDescr b -> ArgDescr a #
Functor OptDescr # | Since: base-4.6.0.0
Instance details Defined in System.Console.GetOpt Methods fmap :: (a -> b) -> OptDescr a -> OptDescr b # (<$) :: a -> OptDescr b -> OptDescr a #
Functor ArgOrder # | Since: base-4.6.0.0
Instance details Defined in System.Console.GetOpt Methods fmap :: (a -> b) -> ArgOrder a -> ArgOrder b # (<$) :: a -> ArgOrder b -> ArgOrder a #
Functor Option # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Option a -> Option b # (<$) :: a -> Option b -> Option a #
Functor Last # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Last a -> Last b # (<$) :: a -> Last b -> Last a #
Functor First # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> First a -> First b # (<$) :: a -> First b -> First a #
Functor Max # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Max a -> Max b # (<$) :: a -> Max b -> Max a #
Functor Min # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a -> b) -> Min a -> Min b # (<$) :: a -> Min b -> Min a #
Functor Complex # |
Instance details Defined in Data.Complex Methods fmap :: (a -> b) -> Complex a -> Complex b # (<$) :: a -> Complex b -> Complex a #
Functor (Either a) # | Since: base-3.0
Instance details Defined in Data.Either Methods fmap :: (a0 -> b) -> Either a a0 -> Either a b # (<$) :: a0 -> Either a b -> Either a a0 #
Functor (V1 :: * -> *) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> V1 a -> V1 b # (<$) :: a -> V1 b -> V1 a #
Functor (U1 :: * -> *) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> U1 a -> U1 b # (<$) :: a -> U1 b -> U1 a #
Functor ((,) a) # | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a0 -> b) -> (a, a0) -> (a, b) # (<$) :: a0 -> (a, b) -> (a, a0) #
Functor (ST s) # | Since: base-2.1
Instance details Defined in GHC.ST Methods fmap :: (a -> b) -> ST s a -> ST s b # (<$) :: a -> ST s b -> ST s a #
Functor (Proxy :: * -> *) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods fmap :: (a -> b) -> Proxy a -> Proxy b # (<$) :: a -> Proxy b -> Proxy a #
Arrow a => Functor (ArrowMonad a) # | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods fmap :: (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # (<$) :: a0 -> ArrowMonad a b -> ArrowMonad a a0 #
Monad m => Functor (WrappedMonad m) # | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a -> b) -> WrappedMonad m a -> WrappedMonad m b # (<$) :: a -> WrappedMonad m b -> WrappedMonad m a #
Functor (ST s) # | Since: base-2.1
Instance details Defined in Control.Monad.ST.Lazy.Imp Methods fmap :: (a -> b) -> ST s a -> ST s b # (<$) :: a -> ST s b -> ST s a #
Functor (Arg a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fmap :: (a0 -> b) -> Arg a a0 -> Arg a b # (<$) :: a0 -> Arg a b -> Arg a a0 #
Functor f => Functor (Rec1 f) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> Rec1 f a -> Rec1 f b # (<$) :: a -> Rec1 f b -> Rec1 f a #
Functor (URec Char :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Char a -> URec Char b # (<$) :: a -> URec Char b -> URec Char a #
Functor (URec Double :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Double a -> URec Double b # (<$) :: a -> URec Double b -> URec Double a #
Functor (URec Float :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Float a -> URec Float b # (<$) :: a -> URec Float b -> URec Float a #
Functor (URec Int :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Int a -> URec Int b # (<$) :: a -> URec Int b -> URec Int a #
Functor (URec Word :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec Word a -> URec Word b # (<$) :: a -> URec Word b -> URec Word a #
Functor (URec (Ptr ()) :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> URec (Ptr ()) a -> URec (Ptr ()) b # (<$) :: a -> URec (Ptr ()) b -> URec (Ptr ()) a #
Functor f => Functor (Alt f) # |
Instance details Defined in Data.Semigroup.Internal Methods fmap :: (a -> b) -> Alt f a -> Alt f b # (<$) :: a -> Alt f b -> Alt f a #
Functor (Const m :: * -> *) # | Since: base-2.1
Instance details Defined in Data.Functor.Const Methods fmap :: (a -> b) -> Const m a -> Const m b # (<$) :: a -> Const m b -> Const m a #
Arrow a => Functor (WrappedArrow a b) # | Since: base-2.1
Instance details Defined in Control.Applicative Methods fmap :: (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # (<$) :: a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
Functor ((->) r :: * -> *) # | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> (r -> a) -> r -> b # (<$) :: a -> (r -> b) -> r -> a #
Functor (K1 i c :: * -> *) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> K1 i c a -> K1 i c b # (<$) :: a -> K1 i c b -> K1 i c a #
(Functor f, Functor g) => Functor (f :+: g) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :+: g) a -> (f :+: g) b # (<$) :: a -> (f :+: g) b -> (f :+: g) a #
(Functor f, Functor g) => Functor (f :*: g) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :*: g) a -> (f :*: g) b # (<$) :: a -> (f :*: g) b -> (f :*: g) a #
(Functor f, Functor g) => Functor (Sum f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods fmap :: (a -> b) -> Sum f g a -> Sum f g b # (<$) :: a -> Sum f g b -> Sum f g a #
(Functor f, Functor g) => Functor (Product f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods fmap :: (a -> b) -> Product f g a -> Product f g b # (<$) :: a -> Product f g b -> Product f g a #
Functor f => Functor (M1 i c f) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> M1 i c f a -> M1 i c f b # (<$) :: a -> M1 i c f b -> M1 i c f a #
(Functor f, Functor g) => Functor (f :.: g) # |
Instance details Defined in GHC.Generics Methods fmap :: (a -> b) -> (f :.: g) a -> (f :.: g) b # (<$) :: a -> (f :.: g) b -> (f :.: g) a #
(Functor f, Functor g) => Functor (Compose f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods fmap :: (a -> b) -> Compose f g a -> Compose f g b # (<$) :: a -> Compose f g b -> Compose f g a #

(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 #

An infix synonym for `fmap`.

The name of this operator is an allusion to `$`. Note the similarities between their types:

     ($)  ::              (a -> b) ->   a ->   b
    (<$>) :: Functor f => (a -> b) -> f a -> f b

Whereas `$` is function application, `<$>` is function application lifted over a `Functor`.

#### Examples

Expand

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

    >>> show <$> Nothing
    Nothing
    >>> show <$> Just 3
    Just "3"

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

    >>> show <$> Left 17
    Left 17
    >>> show <$> Right 17
    Right "17"

Double each element of a list:

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

Apply `even` to the second element of a pair:

    >>> even <$> (2,2)
    (2,True)

class Functor f => Applicative f where #

A functor with application, providing operations to

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

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

    (<*>) = liftA2 id

    liftA2 f x y = f <$> x <*> y

Further, any definition must satisfy the following:

identity

      pure id <*> v = v

composition

      pure (.) <*> u <*> v <*> w = u <*> (v <*> w)

homomorphism

      pure f <*> pure x = pure (f x)

interchange

      u <*> pure y = pure ($ y) <*> u

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

-     u *> v = (id <$ u) <*> v

-     u <* v = liftA2 const u v

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

-     fmap f x = pure f <*> x

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

-     pure = return

-     (<*>) = ap

-     (*>) = (>>)

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

Minimal complete definition

pure, ((<*>) | liftA2)

Methods

pure :: a -> f a #

Lift a value.

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

Sequential application.

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

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

Sequence actions, discarding the value of the first argument.

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

Sequence actions, discarding the value of the second argument.

Instances

Applicative [] # | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> [a] # (<*>) :: [a -> b] -> [a] -> [b] # liftA2 :: (a -> b -> c) -> [a] -> [b] -> [c] # (*>) :: [a] -> [b] -> [b] # (<*) :: [a] -> [b] -> [a] #
Applicative Maybe # | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> Maybe a # (<*>) :: Maybe (a -> b) -> Maybe a -> Maybe b # liftA2 :: (a -> b -> c) -> Maybe a -> Maybe b -> Maybe c # (*>) :: Maybe a -> Maybe b -> Maybe b # (<*) :: Maybe a -> Maybe b -> Maybe a #
Applicative IO # | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> IO a # (<*>) :: IO (a -> b) -> IO a -> IO b # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c # (*>) :: IO a -> IO b -> IO b # (<*) :: IO a -> IO b -> IO a #
Applicative Par1 # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Par1 a # (<*>) :: Par1 (a -> b) -> Par1 a -> Par1 b # liftA2 :: (a -> b -> c) -> Par1 a -> Par1 b -> Par1 c # (*>) :: Par1 a -> Par1 b -> Par1 b # (<*) :: Par1 a -> Par1 b -> Par1 a #
Applicative NonEmpty # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods pure :: a -> NonEmpty a # (<*>) :: NonEmpty (a -> b) -> NonEmpty a -> NonEmpty b # liftA2 :: (a -> b -> c) -> NonEmpty a -> NonEmpty b -> NonEmpty c # (*>) :: NonEmpty a -> NonEmpty b -> NonEmpty b # (<*) :: NonEmpty a -> NonEmpty b -> NonEmpty a #
Applicative ReadP # | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadP Methods pure :: a -> ReadP a # (<*>) :: ReadP (a -> b) -> ReadP a -> ReadP b # liftA2 :: (a -> b -> c) -> ReadP a -> ReadP b -> ReadP c # (*>) :: ReadP a -> ReadP b -> ReadP b # (<*) :: ReadP a -> ReadP b -> ReadP a #
Applicative ReadPrec # | Since: base-4.6.0.0
Instance details Defined in Text.ParserCombinators.ReadPrec Methods pure :: a -> ReadPrec a # (<*>) :: ReadPrec (a -> b) -> ReadPrec a -> ReadPrec b # liftA2 :: (a -> b -> c) -> ReadPrec a -> ReadPrec b -> ReadPrec c # (*>) :: ReadPrec a -> ReadPrec b -> ReadPrec b # (<*) :: ReadPrec a -> ReadPrec b -> ReadPrec a #
Applicative Down # | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods pure :: a -> Down a # (<*>) :: Down (a -> b) -> Down a -> Down b # liftA2 :: (a -> b -> c) -> Down a -> Down b -> Down c # (*>) :: Down a -> Down b -> Down b # (<*) :: Down a -> Down b -> Down a #
Applicative Product # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Product a # (<*>) :: Product (a -> b) -> Product a -> Product b # liftA2 :: (a -> b -> c) -> Product a -> Product b -> Product c # (*>) :: Product a -> Product b -> Product b # (<*) :: Product a -> Product b -> Product a #
Applicative Sum # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Sum a # (<*>) :: Sum (a -> b) -> Sum a -> Sum b # liftA2 :: (a -> b -> c) -> Sum a -> Sum b -> Sum c # (*>) :: Sum a -> Sum b -> Sum b # (<*) :: Sum a -> Sum b -> Sum a #
Applicative Dual # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Dual a # (<*>) :: Dual (a -> b) -> Dual a -> Dual b # liftA2 :: (a -> b -> c) -> Dual a -> Dual b -> Dual c # (*>) :: Dual a -> Dual b -> Dual b # (<*) :: Dual a -> Dual b -> Dual a #
Applicative Last # |
Instance details Defined in Data.Monoid Methods pure :: a -> Last a # (<*>) :: Last (a -> b) -> Last a -> Last b # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c # (*>) :: Last a -> Last b -> Last b # (<*) :: Last a -> Last b -> Last a #
Applicative First # |
Instance details Defined in Data.Monoid Methods pure :: a -> First a # (<*>) :: First (a -> b) -> First a -> First b # liftA2 :: (a -> b -> c) -> First a -> First b -> First c # (*>) :: First a -> First b -> First b # (<*) :: First a -> First b -> First a #
Applicative STM # | Since: base-4.8.0.0
Instance details Defined in GHC.Conc.Sync Methods pure :: a -> STM a # (<*>) :: STM (a -> b) -> STM a -> STM b # liftA2 :: (a -> b -> c) -> STM a -> STM b -> STM c # (*>) :: STM a -> STM b -> STM b # (<*) :: STM a -> STM b -> STM a #
Applicative Identity # | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods pure :: a -> Identity a # (<*>) :: Identity (a -> b) -> Identity a -> Identity b # liftA2 :: (a -> b -> c) -> Identity a -> Identity b -> Identity c # (*>) :: Identity a -> Identity b -> Identity b # (<*) :: Identity a -> Identity b -> Identity a #
Applicative ZipList # |
    f '<$>' 'ZipList' xs1 '<*>' ... '<*>' 'ZipList' xsN
        = 'ZipList' (zipWithN f xs1 ... xsN)
where `zipWithN` refers to the `zipWith` function of the appropriate arity (`zipWith`, `zipWith3`, `zipWith4`, ...). For example:
    (\a b c -> stimes c [a, b]) <$> ZipList "abcd" <*> ZipList "567" <*> ZipList [1..]
        = ZipList (zipWith3 (\a b c -> stimes c [a, b]) "abcd" "567" [1..])
        = ZipList {getZipList = ["a5","b6b6","c7c7c7"]}
Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> ZipList a # (<*>) :: ZipList (a -> b) -> ZipList a -> ZipList b # liftA2 :: (a -> b -> c) -> ZipList a -> ZipList b -> ZipList c # (*>) :: ZipList a -> ZipList b -> ZipList b # (<*) :: ZipList a -> ZipList b -> ZipList a #
Applicative Option # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Option a # (<*>) :: Option (a -> b) -> Option a -> Option b # liftA2 :: (a -> b -> c) -> Option a -> Option b -> Option c # (*>) :: Option a -> Option b -> Option b # (<*) :: Option a -> Option b -> Option a #
Applicative Last # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Last a # (<*>) :: Last (a -> b) -> Last a -> Last b # liftA2 :: (a -> b -> c) -> Last a -> Last b -> Last c # (*>) :: Last a -> Last b -> Last b # (<*) :: Last a -> Last b -> Last a #
Applicative First # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> First a # (<*>) :: First (a -> b) -> First a -> First b # liftA2 :: (a -> b -> c) -> First a -> First b -> First c # (*>) :: First a -> First b -> First b # (<*) :: First a -> First b -> First a #
Applicative Max # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Max a # (<*>) :: Max (a -> b) -> Max a -> Max b # liftA2 :: (a -> b -> c) -> Max a -> Max b -> Max c # (*>) :: Max a -> Max b -> Max b # (<*) :: Max a -> Max b -> Max a #
Applicative Min # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods pure :: a -> Min a # (<*>) :: Min (a -> b) -> Min a -> Min b # liftA2 :: (a -> b -> c) -> Min a -> Min b -> Min c # (*>) :: Min a -> Min b -> Min b # (<*) :: Min a -> Min b -> Min a #
Applicative Complex # | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods pure :: a -> Complex a # (<*>) :: Complex (a -> b) -> Complex a -> Complex b # liftA2 :: (a -> b -> c) -> Complex a -> Complex b -> Complex c # (*>) :: Complex a -> Complex b -> Complex b # (<*) :: Complex a -> Complex b -> Complex a #
Applicative (Either e) # | Since: base-3.0
Instance details Defined in Data.Either Methods pure :: a -> Either e a # (<*>) :: Either e (a -> b) -> Either e a -> Either e b # liftA2 :: (a -> b -> c) -> Either e a -> Either e b -> Either e c # (*>) :: Either e a -> Either e b -> Either e b # (<*) :: Either e a -> Either e b -> Either e a #
Applicative (U1 :: * -> *) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> U1 a # (<*>) :: U1 (a -> b) -> U1 a -> U1 b # liftA2 :: (a -> b -> c) -> U1 a -> U1 b -> U1 c # (*>) :: U1 a -> U1 b -> U1 b # (<*) :: U1 a -> U1 b -> U1 a #
Monoid a => Applicative ((,) a) # | For tuples, the `Monoid` constraint on `a` determines how the first values merge. For example, `String`s concatenate:
    ("hello ", (+15)) <*> ("world!", 2002)
    ("hello world!",2017)
Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a0 -> (a, a0) # (<*>) :: (a, a0 -> b) -> (a, a0) -> (a, b) # liftA2 :: (a0 -> b -> c) -> (a, a0) -> (a, b) -> (a, c) # (*>) :: (a, a0) -> (a, b) -> (a, b) # (<*) :: (a, a0) -> (a, b) -> (a, a0) #
Applicative (ST s) # | Since: base-4.4.0.0
Instance details Defined in GHC.ST Methods pure :: a -> ST s a # (<*>) :: ST s (a -> b) -> ST s a -> ST s b # liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c # (*>) :: ST s a -> ST s b -> ST s b # (<*) :: ST s a -> ST s b -> ST s a #
Applicative (Proxy :: * -> *) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods pure :: a -> Proxy a # (<*>) :: Proxy (a -> b) -> Proxy a -> Proxy b # liftA2 :: (a -> b -> c) -> Proxy a -> Proxy b -> Proxy c # (*>) :: Proxy a -> Proxy b -> Proxy b # (<*) :: Proxy a -> Proxy b -> Proxy a #
Arrow a => Applicative (ArrowMonad a) # | Since: base-4.6.0.0
Instance details Defined in Control.Arrow Methods pure :: a0 -> ArrowMonad a a0 # (<*>) :: ArrowMonad a (a0 -> b) -> ArrowMonad a a0 -> ArrowMonad a b # liftA2 :: (a0 -> b -> c) -> ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a c # (*>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # (<*) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a a0 #
Monad m => Applicative (WrappedMonad m) # | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a -> WrappedMonad m a # (<*>) :: WrappedMonad m (a -> b) -> WrappedMonad m a -> WrappedMonad m b # liftA2 :: (a -> b -> c) -> WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m c # (*>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # (<*) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m a #
Applicative (ST s) # | Since: base-2.1
Instance details Defined in Control.Monad.ST.Lazy.Imp Methods pure :: a -> ST s a # (<*>) :: ST s (a -> b) -> ST s a -> ST s b # liftA2 :: (a -> b -> c) -> ST s a -> ST s b -> ST s c # (*>) :: ST s a -> ST s b -> ST s b # (<*) :: ST s a -> ST s b -> ST s a #
Applicative f => Applicative (Rec1 f) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> Rec1 f a # (<*>) :: Rec1 f (a -> b) -> Rec1 f a -> Rec1 f b # liftA2 :: (a -> b -> c) -> Rec1 f a -> Rec1 f b -> Rec1 f c # (*>) :: Rec1 f a -> Rec1 f b -> Rec1 f b # (<*) :: Rec1 f a -> Rec1 f b -> Rec1 f a #
Applicative f => Applicative (Alt f) # |
Instance details Defined in Data.Semigroup.Internal Methods pure :: a -> Alt f a # (<*>) :: Alt f (a -> b) -> Alt f a -> Alt f b # liftA2 :: (a -> b -> c) -> Alt f a -> Alt f b -> Alt f c # (*>) :: Alt f a -> Alt f b -> Alt f b # (<*) :: Alt f a -> Alt f b -> Alt f a #
Monoid m => Applicative (Const m :: * -> *) # | Since: base-2.0.1
Instance details Defined in Data.Functor.Const Methods pure :: a -> Const m a # (<*>) :: Const m (a -> b) -> Const m a -> Const m b # liftA2 :: (a -> b -> c) -> Const m a -> Const m b -> Const m c # (*>) :: Const m a -> Const m b -> Const m b # (<*) :: Const m a -> Const m b -> Const m a #
Arrow a => Applicative (WrappedArrow a b) # | Since: base-2.1
Instance details Defined in Control.Applicative Methods pure :: a0 -> WrappedArrow a b a0 # (<*>) :: WrappedArrow a b (a0 -> b0) -> WrappedArrow a b a0 -> WrappedArrow a b b0 # liftA2 :: (a0 -> b0 -> c) -> WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b c # (*>) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b b0 # (<*) :: WrappedArrow a b a0 -> WrappedArrow a b b0 -> WrappedArrow a b a0 #
Applicative ((->) a :: * -> *) # | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a0 -> a -> a0 # (<*>) :: (a -> a0 -> b) -> (a -> a0) -> a -> b # liftA2 :: (a0 -> b -> c) -> (a -> a0) -> (a -> b) -> a -> c # (*>) :: (a -> a0) -> (a -> b) -> a -> b # (<*) :: (a -> a0) -> (a -> b) -> a -> a0 #
(Applicative f, Applicative g) => Applicative (f :*: g) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :*: g) a # (<*>) :: (f :*: g) (a -> b) -> (f :*: g) a -> (f :*: g) b # liftA2 :: (a -> b -> c) -> (f :*: g) a -> (f :*: g) b -> (f :*: g) c # (*>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b # (<*) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) a #
(Applicative f, Applicative g) => Applicative (Product f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods pure :: a -> Product f g a # (<*>) :: Product f g (a -> b) -> Product f g a -> Product f g b # liftA2 :: (a -> b -> c) -> Product f g a -> Product f g b -> Product f g c # (*>) :: Product f g a -> Product f g b -> Product f g b # (<*) :: Product f g a -> Product f g b -> Product f g a #
Applicative f => Applicative (M1 i c f) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> M1 i c f a # (<*>) :: M1 i c f (a -> b) -> M1 i c f a -> M1 i c f b # liftA2 :: (a -> b -> c0) -> M1 i c f a -> M1 i c f b -> M1 i c f c0 # (*>) :: M1 i c f a -> M1 i c f b -> M1 i c f b # (<*) :: M1 i c f a -> M1 i c f b -> M1 i c f a #
(Applicative f, Applicative g) => Applicative (f :.: g) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods pure :: a -> (f :.: g) a # (<*>) :: (f :.: g) (a -> b) -> (f :.: g) a -> (f :.: g) b # liftA2 :: (a -> b -> c) -> (f :.: g) a -> (f :.: g) b -> (f :.: g) c # (*>) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) b # (<*) :: (f :.: g) a -> (f :.: g) b -> (f :.: g) a #
(Applicative f, Applicative g) => Applicative (Compose f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods pure :: a -> Compose f g a # (<*>) :: Compose f g (a -> b) -> Compose f g a -> Compose f g b # liftA2 :: (a -> b -> c) -> Compose f g a -> Compose f g b -> Compose f g c # (*>) :: Compose f g a -> Compose f g b -> Compose f g b # (<*) :: Compose f g a -> Compose f g b -> Compose f g a #

class Applicative m => Monad m where #

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

Instances of `Monad` should satisfy the following laws:

-     return a >>= k  =  k a

-     m >>= return  =  m

-     m >>= (\x -> k x >>= h)  =  (m >>= k) >>= h

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

-     pure = return

-     (<*>) = ap

The above laws imply:

-     fmap f xs  =  xs >>= return . f

-     (>>) = (*>)

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

The instances of `Monad` for lists, `Maybe` and `IO` defined in the Prelude satisfy these laws.

Minimal complete definition

(>>=)

Methods

(>>=) :: forall a b. m a -> (a -> m b) -> m b infixl 1 #

Sequentially compose two actions, passing any value produced by the first as an argument to the second.

(>>) :: forall a b. m a -> m b -> m b infixl 1 #

Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages.

return :: a -> m a #

Inject a value into the monadic type.

fail :: String -> m a #

Fail with a message. This operation is not part of the mathematical definition of a monad, but is invoked on pattern-match failure in a `do` expression.

As part of the MonadFail proposal (MFP), this function is moved to its own class `MonadFail` (see Control.Monad.Fail for more details). The definition here will be removed in a future release.

Instances

Monad [] # | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: [a] -> (a -> [b]) -> [b] # (>>) :: [a] -> [b] -> [b] # return :: a -> [a] # fail :: String -> [a] #
Monad Maybe # | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: Maybe a -> (a -> Maybe b) -> Maybe b # (>>) :: Maybe a -> Maybe b -> Maybe b # return :: a -> Maybe a # fail :: String -> Maybe a #
Monad IO # | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: IO a -> (a -> IO b) -> IO b # (>>) :: IO a -> IO b -> IO b # return :: a -> IO a # fail :: String -> IO a #
Monad Par1 # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: Par1 a -> (a -> Par1 b) -> Par1 b # (>>) :: Par1 a -> Par1 b -> Par1 b # return :: a -> Par1 a # fail :: String -> Par1 a #
Monad NonEmpty # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (>>=) :: NonEmpty a -> (a -> NonEmpty b) -> NonEmpty b # (>>) :: NonEmpty a -> NonEmpty b -> NonEmpty b # return :: a -> NonEmpty a # fail :: String -> NonEmpty a #
Monad ReadP # | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadP Methods (>>=) :: ReadP a -> (a -> ReadP b) -> ReadP b # (>>) :: ReadP a -> ReadP b -> ReadP b # return :: a -> ReadP a # fail :: String -> ReadP a #
Monad ReadPrec # | Since: base-2.1
Instance details Defined in Text.ParserCombinators.ReadPrec Methods (>>=) :: ReadPrec a -> (a -> ReadPrec b) -> ReadPrec b # (>>) :: ReadPrec a -> ReadPrec b -> ReadPrec b # return :: a -> ReadPrec a # fail :: String -> ReadPrec a #
Monad Down # | Since: base-4.11.0.0
Instance details Defined in Data.Ord Methods (>>=) :: Down a -> (a -> Down b) -> Down b # (>>) :: Down a -> Down b -> Down b # return :: a -> Down a # fail :: String -> Down a #
Monad Product # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Product a -> (a -> Product b) -> Product b # (>>) :: Product a -> Product b -> Product b # return :: a -> Product a # fail :: String -> Product a #
Monad Sum # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Sum a -> (a -> Sum b) -> Sum b # (>>) :: Sum a -> Sum b -> Sum b # return :: a -> Sum a # fail :: String -> Sum a #
Monad Dual # | Since: base-4.8.0.0
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Dual a -> (a -> Dual b) -> Dual b # (>>) :: Dual a -> Dual b -> Dual b # return :: a -> Dual a # fail :: String -> Dual a #
Monad Last # |
Instance details Defined in Data.Monoid Methods (>>=) :: Last a -> (a -> Last b) -> Last b # (>>) :: Last a -> Last b -> Last b # return :: a -> Last a # fail :: String -> Last a #
Monad First # |
Instance details Defined in Data.Monoid Methods (>>=) :: First a -> (a -> First b) -> First b # (>>) :: First a -> First b -> First b # return :: a -> First a # fail :: String -> First a #
Monad STM # | Since: base-4.3.0.0
Instance details Defined in GHC.Conc.Sync Methods (>>=) :: STM a -> (a -> STM b) -> STM b # (>>) :: STM a -> STM b -> STM b # return :: a -> STM a # fail :: String -> STM a #
Monad Identity # | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods (>>=) :: Identity a -> (a -> Identity b) -> Identity b # (>>) :: Identity a -> Identity b -> Identity b # return :: a -> Identity a # fail :: String -> Identity a #
Monad Option # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Option a -> (a -> Option b) -> Option b # (>>) :: Option a -> Option b -> Option b # return :: a -> Option a # fail :: String -> Option a #
Monad Last # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Last a -> (a -> Last b) -> Last b # (>>) :: Last a -> Last b -> Last b # return :: a -> Last a # fail :: String -> Last a #
Monad First # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: First a -> (a -> First b) -> First b # (>>) :: First a -> First b -> First b # return :: a -> First a # fail :: String -> First a #
Monad Max # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Max a -> (a -> Max b) -> Max b # (>>) :: Max a -> Max b -> Max b # return :: a -> Max a # fail :: String -> Max a #
Monad Min # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods (>>=) :: Min a -> (a -> Min b) -> Min b # (>>) :: Min a -> Min b -> Min b # return :: a -> Min a # fail :: String -> Min a #
Monad Complex # | Since: base-4.9.0.0
Instance details Defined in Data.Complex Methods (>>=) :: Complex a -> (a -> Complex b) -> Complex b # (>>) :: Complex a -> Complex b -> Complex b # return :: a -> Complex a # fail :: String -> Complex a #
Monad (Either e) # | Since: base-4.4.0.0
Instance details Defined in Data.Either Methods (>>=) :: Either e a -> (a -> Either e b) -> Either e b # (>>) :: Either e a -> Either e b -> Either e b # return :: a -> Either e a # fail :: String -> Either e a #
Monad (U1 :: * -> *) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: U1 a -> (a -> U1 b) -> U1 b # (>>) :: U1 a -> U1 b -> U1 b # return :: a -> U1 a # fail :: String -> U1 a #
Monoid a => Monad ((,) a) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods (>>=) :: (a, a0) -> (a0 -> (a, b)) -> (a, b) # (>>) :: (a, a0) -> (a, b) -> (a, b) # return :: a0 -> (a, a0) # fail :: String -> (a, a0) #
Monad (ST s) # | Since: base-2.1
Instance details Defined in GHC.ST Methods (>>=) :: ST s a -> (a -> ST s b) -> ST s b # (>>) :: ST s a -> ST s b -> ST s b # return :: a -> ST s a # fail :: String -> ST s a #
Monad (Proxy :: * -> *) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods (>>=) :: Proxy a -> (a -> Proxy b) -> Proxy b # (>>) :: Proxy a -> Proxy b -> Proxy b # return :: a -> Proxy a # fail :: String -> Proxy a #
ArrowApply a => Monad (ArrowMonad a) # | Since: base-2.1
Instance details Defined in Control.Arrow Methods (>>=) :: ArrowMonad a a0 -> (a0 -> ArrowMonad a b) -> ArrowMonad a b # (>>) :: ArrowMonad a a0 -> ArrowMonad a b -> ArrowMonad a b # return :: a0 -> ArrowMonad a a0 # fail :: String -> ArrowMonad a a0 #
Monad m => Monad (WrappedMonad m) # |
Instance details Defined in Control.Applicative Methods (>>=) :: WrappedMonad m a -> (a -> WrappedMonad m b) -> WrappedMonad m b # (>>) :: WrappedMonad m a -> WrappedMonad m b -> WrappedMonad m b # return :: a -> WrappedMonad m a # fail :: String -> WrappedMonad m a #
Monad (ST s) # | Since: base-2.1
Instance details Defined in Control.Monad.ST.Lazy.Imp Methods (>>=) :: ST s a -> (a -> ST s b) -> ST s b # (>>) :: ST s a -> ST s b -> ST s b # return :: a -> ST s a # fail :: String -> ST s a #
Monad f => Monad (Rec1 f) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: Rec1 f a -> (a -> Rec1 f b) -> Rec1 f b # (>>) :: Rec1 f a -> Rec1 f b -> Rec1 f b # return :: a -> Rec1 f a # fail :: String -> Rec1 f a #
Monad f => Monad (Alt f) # |
Instance details Defined in Data.Semigroup.Internal Methods (>>=) :: Alt f a -> (a -> Alt f b) -> Alt f b # (>>) :: Alt f a -> Alt f b -> Alt f b # return :: a -> Alt f a # fail :: String -> Alt f a #
Monad ((->) r :: * -> *) # | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: (r -> a) -> (a -> r -> b) -> r -> b # (>>) :: (r -> a) -> (r -> b) -> r -> b # return :: a -> r -> a # fail :: String -> r -> a #
(Monad f, Monad g) => Monad (f :*: g) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: (f :*: g) a -> (a -> (f :*: g) b) -> (f :*: g) b # (>>) :: (f :*: g) a -> (f :*: g) b -> (f :*: g) b # return :: a -> (f :*: g) a # fail :: String -> (f :*: g) a #
(Monad f, Monad g) => Monad (Product f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods (>>=) :: Product f g a -> (a -> Product f g b) -> Product f g b # (>>) :: Product f g a -> Product f g b -> Product f g b # return :: a -> Product f g a # fail :: String -> Product f g a #
Monad f => Monad (M1 i c f) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods (>>=) :: M1 i c f a -> (a -> M1 i c f b) -> M1 i c f b # (>>) :: M1 i c f a -> M1 i c f b -> M1 i c f b # return :: a -> M1 i c f a # fail :: String -> M1 i c f a #

mapM_ :: (Foldable t, Monad m) => (a -> m b) -> t a -> m () #

Map each element of a structure to a monadic action, evaluate these actions from left to right, and ignore the results. For a version that doesn't ignore the results see `mapM`.

As of base 4.8.0.0, `mapM_` is just `traverse_`, specialized to `Monad`.

sequence_ :: (Foldable t, Monad m) => t (m a) -> m () #

Evaluate each monadic action in the structure from left to right, and ignore the results. For a version that doesn't ignore the results see `sequence`.

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 #

Same as `>>=`, but with the arguments interchanged.

## Folds and traversals

class Foldable t where #

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 #

Map each element of the structure to a monoid, and combine the results.

foldr :: (a -> b -> b) -> b -> t a -> b #

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 #

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 #

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 #

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 #

Does the element occur in the structure?

maximum :: forall a. Ord a => t a -> a #

The largest element of a non-empty structure.

minimum :: forall a. Ord a => t a -> a #

The least element of a non-empty structure.

sum :: Num a => t a -> a #

The `sum` function computes the sum of the numbers of a structure.

product :: Num a => t a -> a #

The `product` function computes the product of the numbers of a structure.

Instances

Foldable [] # | Since: base-2.1
Instance details Defined in Data.Foldable Methods fold :: Monoid m => [m] -> m # foldMap :: Monoid m => (a -> m) -> [a] -> m # foldr :: (a -> b -> b) -> b -> [a] -> b # foldr' :: (a -> b -> b) -> b -> [a] -> b # foldl :: (b -> a -> b) -> b -> [a] -> b # foldl' :: (b -> a -> b) -> b -> [a] -> b # foldr1 :: (a -> a -> a) -> [a] -> a # foldl1 :: (a -> a -> a) -> [a] -> a # toList :: [a] -> [a] # null :: [a] -> Bool # length :: [a] -> Int # elem :: Eq a => a -> [a] -> Bool # maximum :: Ord a => [a] -> a # minimum :: Ord a => [a] -> a # sum :: Num a => [a] -> a # product :: Num a => [a] -> a #
Foldable Maybe # | Since: base-2.1
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Maybe m -> m # foldMap :: Monoid m => (a -> m) -> Maybe a -> m # foldr :: (a -> b -> b) -> b -> Maybe a -> b # foldr' :: (a -> b -> b) -> b -> Maybe a -> b # foldl :: (b -> a -> b) -> b -> Maybe a -> b # foldl' :: (b -> a -> b) -> b -> Maybe a -> b # foldr1 :: (a -> a -> a) -> Maybe a -> a # foldl1 :: (a -> a -> a) -> Maybe a -> a # toList :: Maybe a -> [a] # null :: Maybe a -> Bool # length :: Maybe a -> Int # elem :: Eq a => a -> Maybe a -> Bool # maximum :: Ord a => Maybe a -> a # minimum :: Ord a => Maybe a -> a # sum :: Num a => Maybe a -> a # product :: Num a => Maybe a -> a #
Foldable Par1 # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Par1 m -> m # foldMap :: Monoid m => (a -> m) -> Par1 a -> m # foldr :: (a -> b -> b) -> b -> Par1 a -> b # foldr' :: (a -> b -> b) -> b -> Par1 a -> b # foldl :: (b -> a -> b) -> b -> Par1 a -> b # foldl' :: (b -> a -> b) -> b -> Par1 a -> b # foldr1 :: (a -> a -> a) -> Par1 a -> a # foldl1 :: (a -> a -> a) -> Par1 a -> a # toList :: Par1 a -> [a] # null :: Par1 a -> Bool # length :: Par1 a -> Int # elem :: Eq a => a -> Par1 a -> Bool # maximum :: Ord a => Par1 a -> a # minimum :: Ord a => Par1 a -> a # sum :: Num a => Par1 a -> a # product :: Num a => Par1 a -> a #
Foldable NonEmpty # | Since: base-4.9.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => NonEmpty m -> m # foldMap :: Monoid m => (a -> m) -> NonEmpty a -> m # foldr :: (a -> b -> b) -> b -> NonEmpty a -> b # foldr' :: (a -> b -> b) -> b -> NonEmpty a -> b # foldl :: (b -> a -> b) -> b -> NonEmpty a -> b # foldl' :: (b -> a -> b) -> b -> NonEmpty a -> b # foldr1 :: (a -> a -> a) -> NonEmpty a -> a # foldl1 :: (a -> a -> a) -> NonEmpty a -> a # toList :: NonEmpty a -> [a] # null :: NonEmpty a -> Bool # length :: NonEmpty a -> Int # elem :: Eq a => a -> NonEmpty a -> Bool # maximum :: Ord a => NonEmpty a -> a # minimum :: Ord a => NonEmpty a -> a # sum :: Num a => NonEmpty a -> a # product :: Num a => NonEmpty a -> a #
Foldable Product # | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Product m -> m # foldMap :: Monoid m => (a -> m) -> Product a -> m # foldr :: (a -> b -> b) -> b -> Product a -> b # foldr' :: (a -> b -> b) -> b -> Product a -> b # foldl :: (b -> a -> b) -> b -> Product a -> b # foldl' :: (b -> a -> b) -> b -> Product a -> b # foldr1 :: (a -> a -> a) -> Product a -> a # foldl1 :: (a -> a -> a) -> Product a -> a # toList :: Product a -> [a] # null :: Product a -> Bool # length :: Product a -> Int # elem :: Eq a => a -> Product a -> Bool # maximum :: Ord a => Product a -> a # minimum :: Ord a => Product a -> a # sum :: Num a => Product a -> a # product :: Num a => Product a -> a #
Foldable Sum # | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Sum m -> m # foldMap :: Monoid m => (a -> m) -> Sum a -> m # foldr :: (a -> b -> b) -> b -> Sum a -> b # foldr' :: (a -> b -> b) -> b -> Sum a -> b # foldl :: (b -> a -> b) -> b -> Sum a -> b # foldl' :: (b -> a -> b) -> b -> Sum a -> b # foldr1 :: (a -> a -> a) -> Sum a -> a # foldl1 :: (a -> a -> a) -> Sum a -> a # toList :: Sum a -> [a] # null :: Sum a -> Bool # length :: Sum a -> Int # elem :: Eq a => a -> Sum a -> Bool # maximum :: Ord a => Sum a -> a # minimum :: Ord a => Sum a -> a # sum :: Num a => Sum a -> a # product :: Num a => Sum a -> a #
Foldable Dual # | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Dual m -> m # foldMap :: Monoid m => (a -> m) -> Dual a -> m # foldr :: (a -> b -> b) -> b -> Dual a -> b # foldr' :: (a -> b -> b) -> b -> Dual a -> b # foldl :: (b -> a -> b) -> b -> Dual a -> b # foldl' :: (b -> a -> b) -> b -> Dual a -> b # foldr1 :: (a -> a -> a) -> Dual a -> a # foldl1 :: (a -> a -> a) -> Dual a -> a # toList :: Dual a -> [a] # null :: Dual a -> Bool # length :: Dual a -> Int # elem :: Eq a => a -> Dual a -> Bool # maximum :: Ord a => Dual a -> a # minimum :: Ord a => Dual a -> a # sum :: Num a => Dual a -> a # product :: Num a => Dual a -> a #
Foldable Last # | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # toList :: Last a -> [a] # null :: Last a -> Bool # length :: Last a -> Int # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # minimum :: Ord a => Last a -> a # sum :: Num a => Last a -> a # product :: Num a => Last a -> a #
Foldable First # | Since: base-4.8.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # toList :: First a -> [a] # null :: First a -> Bool # length :: First a -> Int # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # sum :: Num a => First a -> a # product :: Num a => First a -> a #
Foldable Identity # | Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods fold :: Monoid m => Identity m -> m # foldMap :: Monoid m => (a -> m) -> Identity a -> m # foldr :: (a -> b -> b) -> b -> Identity a -> b # foldr' :: (a -> b -> b) -> b -> Identity a -> b # foldl :: (b -> a -> b) -> b -> Identity a -> b # foldl' :: (b -> a -> b) -> b -> Identity a -> b # foldr1 :: (a -> a -> a) -> Identity a -> a # foldl1 :: (a -> a -> a) -> Identity a -> a # toList :: Identity a -> [a] # null :: Identity a -> Bool # length :: Identity a -> Int # elem :: Eq a => a -> Identity a -> Bool # maximum :: Ord a => Identity a -> a # minimum :: Ord a => Identity a -> a # sum :: Num a => Identity a -> a # product :: Num a => Identity a -> a #
Foldable ZipList # |
Instance details Defined in Control.Applicative Methods fold :: Monoid m => ZipList m -> m # foldMap :: Monoid m => (a -> m) -> ZipList a -> m # foldr :: (a -> b -> b) -> b -> ZipList a -> b # foldr' :: (a -> b -> b) -> b -> ZipList a -> b # foldl :: (b -> a -> b) -> b -> ZipList a -> b # foldl' :: (b -> a -> b) -> b -> ZipList a -> b # foldr1 :: (a -> a -> a) -> ZipList a -> a # foldl1 :: (a -> a -> a) -> ZipList a -> a # toList :: ZipList a -> [a] # null :: ZipList a -> Bool # length :: ZipList a -> Int # elem :: Eq a => a -> ZipList a -> Bool # maximum :: Ord a => ZipList a -> a # minimum :: Ord a => ZipList a -> a # sum :: Num a => ZipList a -> a # product :: Num a => ZipList a -> a #
Foldable Option # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Option m -> m # foldMap :: Monoid m => (a -> m) -> Option a -> m # foldr :: (a -> b -> b) -> b -> Option a -> b # foldr' :: (a -> b -> b) -> b -> Option a -> b # foldl :: (b -> a -> b) -> b -> Option a -> b # foldl' :: (b -> a -> b) -> b -> Option a -> b # foldr1 :: (a -> a -> a) -> Option a -> a # foldl1 :: (a -> a -> a) -> Option a -> a # toList :: Option a -> [a] # null :: Option a -> Bool # length :: Option a -> Int # elem :: Eq a => a -> Option a -> Bool # maximum :: Ord a => Option a -> a # minimum :: Ord a => Option a -> a # sum :: Num a => Option a -> a # product :: Num a => Option a -> a #
Foldable Last # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Last m -> m # foldMap :: Monoid m => (a -> m) -> Last a -> m # foldr :: (a -> b -> b) -> b -> Last a -> b # foldr' :: (a -> b -> b) -> b -> Last a -> b # foldl :: (b -> a -> b) -> b -> Last a -> b # foldl' :: (b -> a -> b) -> b -> Last a -> b # foldr1 :: (a -> a -> a) -> Last a -> a # foldl1 :: (a -> a -> a) -> Last a -> a # toList :: Last a -> [a] # null :: Last a -> Bool # length :: Last a -> Int # elem :: Eq a => a -> Last a -> Bool # maximum :: Ord a => Last a -> a # minimum :: Ord a => Last a -> a # sum :: Num a => Last a -> a # product :: Num a => Last a -> a #
Foldable First # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => First m -> m # foldMap :: Monoid m => (a -> m) -> First a -> m # foldr :: (a -> b -> b) -> b -> First a -> b # foldr' :: (a -> b -> b) -> b -> First a -> b # foldl :: (b -> a -> b) -> b -> First a -> b # foldl' :: (b -> a -> b) -> b -> First a -> b # foldr1 :: (a -> a -> a) -> First a -> a # foldl1 :: (a -> a -> a) -> First a -> a # toList :: First a -> [a] # null :: First a -> Bool # length :: First a -> Int # elem :: Eq a => a -> First a -> Bool # maximum :: Ord a => First a -> a # minimum :: Ord a => First a -> a # sum :: Num a => First a -> a # product :: Num a => First a -> a #
Foldable Max # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Max m -> m # foldMap :: Monoid m => (a -> m) -> Max a -> m # foldr :: (a -> b -> b) -> b -> Max a -> b # foldr' :: (a -> b -> b) -> b -> Max a -> b # foldl :: (b -> a -> b) -> b -> Max a -> b # foldl' :: (b -> a -> b) -> b -> Max a -> b # foldr1 :: (a -> a -> a) -> Max a -> a # foldl1 :: (a -> a -> a) -> Max a -> a # toList :: Max a -> [a] # null :: Max a -> Bool # length :: Max a -> Int # elem :: Eq a => a -> Max a -> Bool # maximum :: Ord a => Max a -> a # minimum :: Ord a => Max a -> a # sum :: Num a => Max a -> a # product :: Num a => Max a -> a #
Foldable Min # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Min m -> m # foldMap :: Monoid m => (a -> m) -> Min a -> m # foldr :: (a -> b -> b) -> b -> Min a -> b # foldr' :: (a -> b -> b) -> b -> Min a -> b # foldl :: (b -> a -> b) -> b -> Min a -> b # foldl' :: (b -> a -> b) -> b -> Min a -> b # foldr1 :: (a -> a -> a) -> Min a -> a # foldl1 :: (a -> a -> a) -> Min a -> a # toList :: Min a -> [a] # null :: Min a -> Bool # length :: Min a -> Int # elem :: Eq a => a -> Min a -> Bool # maximum :: Ord a => Min a -> a # minimum :: Ord a => Min a -> a # sum :: Num a => Min a -> a # product :: Num a => Min a -> a #
Foldable Complex # |
Instance details Defined in Data.Complex Methods fold :: Monoid m => Complex m -> m # foldMap :: Monoid m => (a -> m) -> Complex a -> m # foldr :: (a -> b -> b) -> b -> Complex a -> b # foldr' :: (a -> b -> b) -> b -> Complex a -> b # foldl :: (b -> a -> b) -> b -> Complex a -> b # foldl' :: (b -> a -> b) -> b -> Complex a -> b # foldr1 :: (a -> a -> a) -> Complex a -> a # foldl1 :: (a -> a -> a) -> Complex a -> a # toList :: Complex a -> [a] # null :: Complex a -> Bool # length :: Complex a -> Int # elem :: Eq a => a -> Complex a -> Bool # maximum :: Ord a => Complex a -> a # minimum :: Ord a => Complex a -> a # sum :: Num a => Complex a -> a # product :: Num a => Complex a -> a #
Foldable (Either a) # | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Either a m -> m # foldMap :: Monoid m => (a0 -> m) -> Either a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Either a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Either a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Either a a0 -> a0 # toList :: Either a a0 -> [a0] # null :: Either a a0 -> Bool # length :: Either a a0 -> Int # elem :: Eq a0 => a0 -> Either a a0 -> Bool # maximum :: Ord a0 => Either a a0 -> a0 # minimum :: Ord a0 => Either a a0 -> a0 # sum :: Num a0 => Either a a0 -> a0 # product :: Num a0 => Either a a0 -> a0 #
Foldable (V1 :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => V1 m -> m # foldMap :: Monoid m => (a -> m) -> V1 a -> m # foldr :: (a -> b -> b) -> b -> V1 a -> b # foldr' :: (a -> b -> b) -> b -> V1 a -> b # foldl :: (b -> a -> b) -> b -> V1 a -> b # foldl' :: (b -> a -> b) -> b -> V1 a -> b # foldr1 :: (a -> a -> a) -> V1 a -> a # foldl1 :: (a -> a -> a) -> V1 a -> a # toList :: V1 a -> [a] # null :: V1 a -> Bool # length :: V1 a -> Int # elem :: Eq a => a -> V1 a -> Bool # maximum :: Ord a => V1 a -> a # minimum :: Ord a => V1 a -> a # sum :: Num a => V1 a -> a # product :: Num a => V1 a -> a #
Foldable (U1 :: * -> *) # | Since: base-4.9.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => U1 m -> m # foldMap :: Monoid m => (a -> m) -> U1 a -> m # foldr :: (a -> b -> b) -> b -> U1 a -> b # foldr' :: (a -> b -> b) -> b -> U1 a -> b # foldl :: (b -> a -> b) -> b -> U1 a -> b # foldl' :: (b -> a -> b) -> b -> U1 a -> b # foldr1 :: (a -> a -> a) -> U1 a -> a # foldl1 :: (a -> a -> a) -> U1 a -> a # toList :: U1 a -> [a] # null :: U1 a -> Bool # length :: U1 a -> Int # elem :: Eq a => a -> U1 a -> Bool # maximum :: Ord a => U1 a -> a # minimum :: Ord a => U1 a -> a # sum :: Num a => U1 a -> a # product :: Num a => U1 a -> a #
Foldable ((,) a) # | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => (a, m) -> m # foldMap :: Monoid m => (a0 -> m) -> (a, a0) -> m # foldr :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldr' :: (a0 -> b -> b) -> b -> (a, a0) -> b # foldl :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldl' :: (b -> a0 -> b) -> b -> (a, a0) -> b # foldr1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # foldl1 :: (a0 -> a0 -> a0) -> (a, a0) -> a0 # toList :: (a, a0) -> [a0] # null :: (a, a0) -> Bool # length :: (a, a0) -> Int # elem :: Eq a0 => a0 -> (a, a0) -> Bool # maximum :: Ord a0 => (a, a0) -> a0 # minimum :: Ord a0 => (a, a0) -> a0 # sum :: Num a0 => (a, a0) -> a0 # product :: Num a0 => (a, a0) -> a0 #
Foldable (Proxy :: * -> *) # | Since: base-4.7.0.0
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> m # foldr :: (a -> b -> b) -> b -> Proxy a -> b # foldr' :: (a -> b -> b) -> b -> Proxy a -> b # foldl :: (b -> a -> b) -> b -> Proxy a -> b # foldl' :: (b -> a -> b) -> b -> Proxy a -> b # foldr1 :: (a -> a -> a) -> Proxy a -> a # foldl1 :: (a -> a -> a) -> Proxy a -> a # toList :: Proxy a -> [a] # null :: Proxy a -> Bool # length :: Proxy a -> Int # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # sum :: Num a => Proxy a -> a # product :: Num a => Proxy a -> a #
Foldable (Arg a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods fold :: Monoid m => Arg a m -> m # foldMap :: Monoid m => (a0 -> m) -> Arg a a0 -> m # foldr :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldr' :: (a0 -> b -> b) -> b -> Arg a a0 -> b # foldl :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldl' :: (b -> a0 -> b) -> b -> Arg a a0 -> b # foldr1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # foldl1 :: (a0 -> a0 -> a0) -> Arg a a0 -> a0 # toList :: Arg a a0 -> [a0] # null :: Arg a a0 -> Bool # length :: Arg a a0 -> Int # elem :: Eq a0 => a0 -> Arg a a0 -> Bool # maximum :: Ord a0 => Arg a a0 -> a0 # minimum :: Ord a0 => Arg a a0 -> a0 # sum :: Num a0 => Arg a a0 -> a0 # product :: Num a0 => Arg a a0 -> a0 #
Foldable f => Foldable (Rec1 f) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => Rec1 f m -> m # foldMap :: Monoid m => (a -> m) -> Rec1 f a -> m # foldr :: (a -> b -> b) -> b -> Rec1 f a -> b # foldr' :: (a -> b -> b) -> b -> Rec1 f a -> b # foldl :: (b -> a -> b) -> b -> Rec1 f a -> b # foldl' :: (b -> a -> b) -> b -> Rec1 f a -> b # foldr1 :: (a -> a -> a) -> Rec1 f a -> a # foldl1 :: (a -> a -> a) -> Rec1 f a -> a # toList :: Rec1 f a -> [a] # null :: Rec1 f a -> Bool # length :: Rec1 f a -> Int # elem :: Eq a => a -> Rec1 f a -> Bool # maximum :: Ord a => Rec1 f a -> a # minimum :: Ord a => Rec1 f a -> a # sum :: Num a => Rec1 f a -> a # product :: Num a => Rec1 f a -> a #
Foldable (URec Char :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Char m -> m # foldMap :: Monoid m => (a -> m) -> URec Char a -> m # foldr :: (a -> b -> b) -> b -> URec Char a -> b # foldr' :: (a -> b -> b) -> b -> URec Char a -> b # foldl :: (b -> a -> b) -> b -> URec Char a -> b # foldl' :: (b -> a -> b) -> b -> URec Char a -> b # foldr1 :: (a -> a -> a) -> URec Char a -> a # foldl1 :: (a -> a -> a) -> URec Char a -> a # toList :: URec Char a -> [a] # null :: URec Char a -> Bool # length :: URec Char a -> Int # elem :: Eq a => a -> URec Char a -> Bool # maximum :: Ord a => URec Char a -> a # minimum :: Ord a => URec Char a -> a # sum :: Num a => URec Char a -> a # product :: Num a => URec Char a -> a #
Foldable (URec Double :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Double m -> m # foldMap :: Monoid m => (a -> m) -> URec Double a -> m # foldr :: (a -> b -> b) -> b -> URec Double a -> b # foldr' :: (a -> b -> b) -> b -> URec Double a -> b # foldl :: (b -> a -> b) -> b -> URec Double a -> b # foldl' :: (b -> a -> b) -> b -> URec Double a -> b # foldr1 :: (a -> a -> a) -> URec Double a -> a # foldl1 :: (a -> a -> a) -> URec Double a -> a # toList :: URec Double a -> [a] # null :: URec Double a -> Bool # length :: URec Double a -> Int # elem :: Eq a => a -> URec Double a -> Bool # maximum :: Ord a => URec Double a -> a # minimum :: Ord a => URec Double a -> a # sum :: Num a => URec Double a -> a # product :: Num a => URec Double a -> a #
Foldable (URec Float :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Float m -> m # foldMap :: Monoid m => (a -> m) -> URec Float a -> m # foldr :: (a -> b -> b) -> b -> URec Float a -> b # foldr' :: (a -> b -> b) -> b -> URec Float a -> b # foldl :: (b -> a -> b) -> b -> URec Float a -> b # foldl' :: (b -> a -> b) -> b -> URec Float a -> b # foldr1 :: (a -> a -> a) -> URec Float a -> a # foldl1 :: (a -> a -> a) -> URec Float a -> a # toList :: URec Float a -> [a] # null :: URec Float a -> Bool # length :: URec Float a -> Int # elem :: Eq a => a -> URec Float a -> Bool # maximum :: Ord a => URec Float a -> a # minimum :: Ord a => URec Float a -> a # sum :: Num a => URec Float a -> a # product :: Num a => URec Float a -> a #
Foldable (URec Int :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Int m -> m # foldMap :: Monoid m => (a -> m) -> URec Int a -> m # foldr :: (a -> b -> b) -> b -> URec Int a -> b # foldr' :: (a -> b -> b) -> b -> URec Int a -> b # foldl :: (b -> a -> b) -> b -> URec Int a -> b # foldl' :: (b -> a -> b) -> b -> URec Int a -> b # foldr1 :: (a -> a -> a) -> URec Int a -> a # foldl1 :: (a -> a -> a) -> URec Int a -> a # toList :: URec Int a -> [a] # null :: URec Int a -> Bool # length :: URec Int a -> Int # elem :: Eq a => a -> URec Int a -> Bool # maximum :: Ord a => URec Int a -> a # minimum :: Ord a => URec Int a -> a # sum :: Num a => URec Int a -> a # product :: Num a => URec Int a -> a #
Foldable (URec Word :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec Word m -> m # foldMap :: Monoid m => (a -> m) -> URec Word a -> m # foldr :: (a -> b -> b) -> b -> URec Word a -> b # foldr' :: (a -> b -> b) -> b -> URec Word a -> b # foldl :: (b -> a -> b) -> b -> URec Word a -> b # foldl' :: (b -> a -> b) -> b -> URec Word a -> b # foldr1 :: (a -> a -> a) -> URec Word a -> a # foldl1 :: (a -> a -> a) -> URec Word a -> a # toList :: URec Word a -> [a] # null :: URec Word a -> Bool # length :: URec Word a -> Int # elem :: Eq a => a -> URec Word a -> Bool # maximum :: Ord a => URec Word a -> a # minimum :: Ord a => URec Word a -> a # sum :: Num a => URec Word a -> a # product :: Num a => URec Word a -> a #
Foldable (URec (Ptr ()) :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => URec (Ptr ()) m -> m # foldMap :: Monoid m => (a -> m) -> URec (Ptr ()) a -> m # foldr :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b # foldr' :: (a -> b -> b) -> b -> URec (Ptr ()) a -> b # foldl :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b # foldl' :: (b -> a -> b) -> b -> URec (Ptr ()) a -> b # foldr1 :: (a -> a -> a) -> URec (Ptr ()) a -> a # foldl1 :: (a -> a -> a) -> URec (Ptr ()) a -> a # toList :: URec (Ptr ()) a -> [a] # null :: URec (Ptr ()) a -> Bool # length :: URec (Ptr ()) a -> Int # elem :: Eq a => a -> URec (Ptr ()) a -> Bool # maximum :: Ord a => URec (Ptr ()) a -> a # minimum :: Ord a => URec (Ptr ()) a -> a # sum :: Num a => URec (Ptr ()) a -> a # product :: Num a => URec (Ptr ()) a -> a #
Foldable (Const m :: * -> *) # | Since: base-4.7.0.0
Instance details Defined in Data.Functor.Const Methods fold :: Monoid m0 => Const m m0 -> m0 # foldMap :: Monoid m0 => (a -> m0) -> Const m a -> m0 # foldr :: (a -> b -> b) -> b -> Const m a -> b # foldr' :: (a -> b -> b) -> b -> Const m a -> b # foldl :: (b -> a -> b) -> b -> Const m a -> b # foldl' :: (b -> a -> b) -> b -> Const m a -> b # foldr1 :: (a -> a -> a) -> Const m a -> a # foldl1 :: (a -> a -> a) -> Const m a -> a # toList :: Const m a -> [a] # null :: Const m a -> Bool # length :: Const m a -> Int # elem :: Eq a => a -> Const m a -> Bool # maximum :: Ord a => Const m a -> a # minimum :: Ord a => Const m a -> a # sum :: Num a => Const m a -> a # product :: Num a => Const m a -> a #
Foldable (K1 i c :: * -> *) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => K1 i c m -> m # foldMap :: Monoid m => (a -> m) -> K1 i c a -> m # foldr :: (a -> b -> b) -> b -> K1 i c a -> b # foldr' :: (a -> b -> b) -> b -> K1 i c a -> b # foldl :: (b -> a -> b) -> b -> K1 i c a -> b # foldl' :: (b -> a -> b) -> b -> K1 i c a -> b # foldr1 :: (a -> a -> a) -> K1 i c a -> a # foldl1 :: (a -> a -> a) -> K1 i c a -> a # toList :: K1 i c a -> [a] # null :: K1 i c a -> Bool # length :: K1 i c a -> Int # elem :: Eq a => a -> K1 i c a -> Bool # maximum :: Ord a => K1 i c a -> a # minimum :: Ord a => K1 i c a -> a # sum :: Num a => K1 i c a -> a # product :: Num a => K1 i c a -> a #
(Foldable f, Foldable g) => Foldable (f :+: g) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => (f :+: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :+: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :+: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :+: g) a -> b # foldr1 :: (a -> a -> a) -> (f :+: g) a -> a # foldl1 :: (a -> a -> a) -> (f :+: g) a -> a # toList :: (f :+: g) a -> [a] # null :: (f :+: g) a -> Bool # length :: (f :+: g) a -> Int # elem :: Eq a => a -> (f :+: g) a -> Bool # maximum :: Ord a => (f :+: g) a -> a # minimum :: Ord a => (f :+: g) a -> a # sum :: Num a => (f :+: g) a -> a # product :: Num a => (f :+: g) a -> a #
(Foldable f, Foldable g) => Foldable (f :*: g) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => (f :*: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :*: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :*: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :*: g) a -> b # foldr1 :: (a -> a -> a) -> (f :*: g) a -> a # foldl1 :: (a -> a -> a) -> (f :*: g) a -> a # toList :: (f :*: g) a -> [a] # null :: (f :*: g) a -> Bool # length :: (f :*: g) a -> Int # elem :: Eq a => a -> (f :*: g) a -> Bool # maximum :: Ord a => (f :*: g) a -> a # minimum :: Ord a => (f :*: g) a -> a # sum :: Num a => (f :*: g) a -> a # product :: Num a => (f :*: g) a -> a #
(Foldable f, Foldable g) => Foldable (Sum f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods fold :: Monoid m => Sum f g m -> m # foldMap :: Monoid m => (a -> m) -> Sum f g a -> m # foldr :: (a -> b -> b) -> b -> Sum f g a -> b # foldr' :: (a -> b -> b) -> b -> Sum f g a -> b # foldl :: (b -> a -> b) -> b -> Sum f g a -> b # foldl' :: (b -> a -> b) -> b -> Sum f g a -> b # foldr1 :: (a -> a -> a) -> Sum f g a -> a # foldl1 :: (a -> a -> a) -> Sum f g a -> a # toList :: Sum f g a -> [a] # null :: Sum f g a -> Bool # length :: Sum f g a -> Int # elem :: Eq a => a -> Sum f g a -> Bool # maximum :: Ord a => Sum f g a -> a # minimum :: Ord a => Sum f g a -> a # sum :: Num a => Sum f g a -> a # product :: Num a => Sum f g a -> a #
(Foldable f, Foldable g) => Foldable (Product f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods fold :: Monoid m => Product f g m -> m # foldMap :: Monoid m => (a -> m) -> Product f g a -> m # foldr :: (a -> b -> b) -> b -> Product f g a -> b # foldr' :: (a -> b -> b) -> b -> Product f g a -> b # foldl :: (b -> a -> b) -> b -> Product f g a -> b # foldl' :: (b -> a -> b) -> b -> Product f g a -> b # foldr1 :: (a -> a -> a) -> Product f g a -> a # foldl1 :: (a -> a -> a) -> Product f g a -> a # toList :: Product f g a -> [a] # null :: Product f g a -> Bool # length :: Product f g a -> Int # elem :: Eq a => a -> Product f g a -> Bool # maximum :: Ord a => Product f g a -> a # minimum :: Ord a => Product f g a -> a # sum :: Num a => Product f g a -> a # product :: Num a => Product f g a -> a #
Foldable f => Foldable (M1 i c f) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => M1 i c f m -> m # foldMap :: Monoid m => (a -> m) -> M1 i c f a -> m # foldr :: (a -> b -> b) -> b -> M1 i c f a -> b # foldr' :: (a -> b -> b) -> b -> M1 i c f a -> b # foldl :: (b -> a -> b) -> b -> M1 i c f a -> b # foldl' :: (b -> a -> b) -> b -> M1 i c f a -> b # foldr1 :: (a -> a -> a) -> M1 i c f a -> a # foldl1 :: (a -> a -> a) -> M1 i c f a -> a # toList :: M1 i c f a -> [a] # null :: M1 i c f a -> Bool # length :: M1 i c f a -> Int # elem :: Eq a => a -> M1 i c f a -> Bool # maximum :: Ord a => M1 i c f a -> a # minimum :: Ord a => M1 i c f a -> a # sum :: Num a => M1 i c f a -> a # product :: Num a => M1 i c f a -> a #
(Foldable f, Foldable g) => Foldable (f :.: g) # |
Instance details Defined in Data.Foldable Methods fold :: Monoid m => (f :.: g) m -> m # foldMap :: Monoid m => (a -> m) -> (f :.: g) a -> m # foldr :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldr' :: (a -> b -> b) -> b -> (f :.: g) a -> b # foldl :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldl' :: (b -> a -> b) -> b -> (f :.: g) a -> b # foldr1 :: (a -> a -> a) -> (f :.: g) a -> a # foldl1 :: (a -> a -> a) -> (f :.: g) a -> a # toList :: (f :.: g) a -> [a] # null :: (f :.: g) a -> Bool # length :: (f :.: g) a -> Int # elem :: Eq a => a -> (f :.: g) a -> Bool # maximum :: Ord a => (f :.: g) a -> a # minimum :: Ord a => (f :.: g) a -> a # sum :: Num a => (f :.: g) a -> a # product :: Num a => (f :.: g) a -> a #
(Foldable f, Foldable g) => Foldable (Compose f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods fold :: Monoid m => Compose f g m -> m # foldMap :: Monoid m => (a -> m) -> Compose f g a -> m # foldr :: (a -> b -> b) -> b -> Compose f g a -> b # foldr' :: (a -> b -> b) -> b -> Compose f g a -> b # foldl :: (b -> a -> b) -> b -> Compose f g a -> b # foldl' :: (b -> a -> b) -> b -> Compose f g a -> b # foldr1 :: (a -> a -> a) -> Compose f g a -> a # foldl1 :: (a -> a -> a) -> Compose f g a -> a # toList :: Compose f g a -> [a] # null :: Compose f g a -> Bool # length :: Compose f g a -> Int # elem :: Eq a => a -> Compose f g a -> Bool # maximum :: Ord a => Compose f g a -> a # minimum :: Ord a => Compose f g a -> a # sum :: Num a => Compose f g a -> a # product :: Num a => Compose f g a -> a #

class (Functor t, Foldable t) => Traversable t where #

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.

-     t (pure x) = pure x

-     t (x <*> y) = t x <*> t y

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:

- In the `Functor` instance, `fmap` should be equivalent to traversal with the identity applicative functor (`fmapDefault`).
- In the `Foldable` instance, `foldMap` should be equivalent to traversal with a constant applicative functor (`foldMapDefault`).

Minimal complete definition

traverse | sequenceA

Methods

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

Map each element of a structure to an action, evaluate these actions from left to right, and collect the results. For a version that ignores the results see `traverse_`.

sequenceA :: Applicative f => t (f a) -> f (t a) #

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

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

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 [] # | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> [a] -> f [b] # sequenceA :: Applicative f => [f a] -> f [a] # mapM :: Monad m => (a -> m b) -> [a] -> m [b] # sequence :: Monad m => [m a] -> m [a] #
Traversable Maybe # | Since: base-2.1
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) # sequenceA :: Applicative f => Maybe (f a) -> f (Maybe a) # mapM :: Monad m => (a -> m b) -> Maybe a -> m (Maybe b) # sequence :: Monad m => Maybe (m a) -> m (Maybe a) #
Traversable Par1 # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Par1 a -> f (Par1 b) # sequenceA :: Applicative f => Par1 (f a) -> f (Par1 a) # mapM :: Monad m => (a -> m b) -> Par1 a -> m (Par1 b) # sequence :: Monad m => Par1 (m a) -> m (Par1 a) #
Traversable NonEmpty # | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> NonEmpty a -> f (NonEmpty b) # sequenceA :: Applicative f => NonEmpty (f a) -> f (NonEmpty a) # mapM :: Monad m => (a -> m b) -> NonEmpty a -> m (NonEmpty b) # sequence :: Monad m => NonEmpty (m a) -> m (NonEmpty a) #
Traversable Product # | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Product a -> f (Product b) # sequenceA :: Applicative f => Product (f a) -> f (Product a) # mapM :: Monad m => (a -> m b) -> Product a -> m (Product b) # sequence :: Monad m => Product (m a) -> m (Product a) #
Traversable Sum # | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Sum a -> f (Sum b) # sequenceA :: Applicative f => Sum (f a) -> f (Sum a) # mapM :: Monad m => (a -> m b) -> Sum a -> m (Sum b) # sequence :: Monad m => Sum (m a) -> m (Sum a) #
Traversable Dual # | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Dual a -> f (Dual b) # sequenceA :: Applicative f => Dual (f a) -> f (Dual a) # mapM :: Monad m => (a -> m b) -> Dual a -> m (Dual b) # sequence :: Monad m => Dual (m a) -> m (Dual a) #
Traversable Last # | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) # sequenceA :: Applicative f => Last (f a) -> f (Last a) # mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) # sequence :: Monad m => Last (m a) -> m (Last a) #
Traversable First # | Since: base-4.8.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> First a -> f (First b) # sequenceA :: Applicative f => First (f a) -> f (First a) # mapM :: Monad m => (a -> m b) -> First a -> m (First b) # sequence :: Monad m => First (m a) -> m (First a) #
Traversable Identity # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Identity a -> f (Identity b) # sequenceA :: Applicative f => Identity (f a) -> f (Identity a) # mapM :: Monad m => (a -> m b) -> Identity a -> m (Identity b) # sequence :: Monad m => Identity (m a) -> m (Identity a) #
Traversable ZipList # | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> ZipList a -> f (ZipList b) # sequenceA :: Applicative f => ZipList (f a) -> f (ZipList a) # mapM :: Monad m => (a -> m b) -> ZipList a -> m (ZipList b) # sequence :: Monad m => ZipList (m a) -> m (ZipList a) #
Traversable Option # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Option a -> f (Option b) # sequenceA :: Applicative f => Option (f a) -> f (Option a) # mapM :: Monad m => (a -> m b) -> Option a -> m (Option b) # sequence :: Monad m => Option (m a) -> m (Option a) #
Traversable Last # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Last a -> f (Last b) # sequenceA :: Applicative f => Last (f a) -> f (Last a) # mapM :: Monad m => (a -> m b) -> Last a -> m (Last b) # sequence :: Monad m => Last (m a) -> m (Last a) #
Traversable First # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> First a -> f (First b) # sequenceA :: Applicative f => First (f a) -> f (First a) # mapM :: Monad m => (a -> m b) -> First a -> m (First b) # sequence :: Monad m => First (m a) -> m (First a) #
Traversable Max # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Max a -> f (Max b) # sequenceA :: Applicative f => Max (f a) -> f (Max a) # mapM :: Monad m => (a -> m b) -> Max a -> m (Max b) # sequence :: Monad m => Max (m a) -> m (Max a) #
Traversable Min # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a -> f b) -> Min a -> f (Min b) # sequenceA :: Applicative f => Min (f a) -> f (Min a) # mapM :: Monad m => (a -> m b) -> Min a -> m (Min b) # sequence :: Monad m => Min (m a) -> m (Min a) #
Traversable Complex # |
Instance details Defined in Data.Complex Methods traverse :: Applicative f => (a -> f b) -> Complex a -> f (Complex b) # sequenceA :: Applicative f => Complex (f a) -> f (Complex a) # mapM :: Monad m => (a -> m b) -> Complex a -> m (Complex b) # sequence :: Monad m => Complex (m a) -> m (Complex a) #
Traversable (Either a) # | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> Either a a0 -> f (Either a b) # sequenceA :: Applicative f => Either a (f a0) -> f (Either a a0) # mapM :: Monad m => (a0 -> m b) -> Either a a0 -> m (Either a b) # sequence :: Monad m => Either a (m a0) -> m (Either a a0) #
Traversable (V1 :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> V1 a -> f (V1 b) # sequenceA :: Applicative f => V1 (f a) -> f (V1 a) # mapM :: Monad m => (a -> m b) -> V1 a -> m (V1 b) # sequence :: Monad m => V1 (m a) -> m (V1 a) #
Traversable (U1 :: * -> *) # | Since: base-4.9.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> U1 a -> f (U1 b) # sequenceA :: Applicative f => U1 (f a) -> f (U1 a) # mapM :: Monad m => (a -> m b) -> U1 a -> m (U1 b) # sequence :: Monad m => U1 (m a) -> m (U1 a) #
Traversable ((,) a) # | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a0 -> f b) -> (a, a0) -> f (a, b) # sequenceA :: Applicative f => (a, f a0) -> f (a, a0) # mapM :: Monad m => (a0 -> m b) -> (a, a0) -> m (a, b) # sequence :: Monad m => (a, m a0) -> m (a, a0) #
Traversable (Proxy :: * -> *) # | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Proxy a -> f (Proxy b) # sequenceA :: Applicative f => Proxy (f a) -> f (Proxy a) # mapM :: Monad m => (a -> m b) -> Proxy a -> m (Proxy b) # sequence :: Monad m => Proxy (m a) -> m (Proxy a) #
Traversable (Arg a) # | Since: base-4.9.0.0
Instance details Defined in Data.Semigroup Methods traverse :: Applicative f => (a0 -> f b) -> Arg a a0 -> f (Arg a b) # sequenceA :: Applicative f => Arg a (f a0) -> f (Arg a a0) # mapM :: Monad m => (a0 -> m b) -> Arg a a0 -> m (Arg a b) # sequence :: Monad m => Arg a (m a0) -> m (Arg a a0) #
Traversable f => Traversable (Rec1 f) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) # sequenceA :: Applicative f0 => Rec1 f (f0 a) -> f0 (Rec1 f a) # mapM :: Monad m => (a -> m b) -> Rec1 f a -> m (Rec1 f b) # sequence :: Monad m => Rec1 f (m a) -> m (Rec1 f a) #
Traversable (URec Char :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Char a -> f (URec Char b) # sequenceA :: Applicative f => URec Char (f a) -> f (URec Char a) # mapM :: Monad m => (a -> m b) -> URec Char a -> m (URec Char b) # sequence :: Monad m => URec Char (m a) -> m (URec Char a) #
Traversable (URec Double :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Double a -> f (URec Double b) # sequenceA :: Applicative f => URec Double (f a) -> f (URec Double a) # mapM :: Monad m => (a -> m b) -> URec Double a -> m (URec Double b) # sequence :: Monad m => URec Double (m a) -> m (URec Double a) #
Traversable (URec Float :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Float a -> f (URec Float b) # sequenceA :: Applicative f => URec Float (f a) -> f (URec Float a) # mapM :: Monad m => (a -> m b) -> URec Float a -> m (URec Float b) # sequence :: Monad m => URec Float (m a) -> m (URec Float a) #
Traversable (URec Int :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Int a -> f (URec Int b) # sequenceA :: Applicative f => URec Int (f a) -> f (URec Int a) # mapM :: Monad m => (a -> m b) -> URec Int a -> m (URec Int b) # sequence :: Monad m => URec Int (m a) -> m (URec Int a) #
Traversable (URec Word :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec Word a -> f (URec Word b) # sequenceA :: Applicative f => URec Word (f a) -> f (URec Word a) # mapM :: Monad m => (a -> m b) -> URec Word a -> m (URec Word b) # sequence :: Monad m => URec Word (m a) -> m (URec Word a) #
Traversable (URec (Ptr ()) :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> URec (Ptr ()) a -> f (URec (Ptr ()) b) # sequenceA :: Applicative f => URec (Ptr ()) (f a) -> f (URec (Ptr ()) a) # mapM :: Monad m => (a -> m b) -> URec (Ptr ()) a -> m (URec (Ptr ()) b) # sequence :: Monad m => URec (Ptr ()) (m a) -> m (URec (Ptr ()) a) #
Traversable (Const m :: * -> *) # | Since: base-4.7.0.0
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> Const m a -> f (Const m b) # sequenceA :: Applicative f => Const m (f a) -> f (Const m a) # mapM :: Monad m0 => (a -> m0 b) -> Const m a -> m0 (Const m b) # sequence :: Monad m0 => Const m (m0 a) -> m0 (Const m a) #
Traversable (K1 i c :: * -> *) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f => (a -> f b) -> K1 i c a -> f (K1 i c b) # sequenceA :: Applicative f => K1 i c (f a) -> f (K1 i c a) # mapM :: Monad m => (a -> m b) -> K1 i c a -> m (K1 i c b) # sequence :: Monad m => K1 i c (m a) -> m (K1 i c a) #
(Traversable f, Traversable g) => Traversable (f :+: g) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) # sequenceA :: Applicative f0 => (f :+: g) (f0 a) -> f0 ((f :+: g) a) # mapM :: Monad m => (a -> m b) -> (f :+: g) a -> m ((f :+: g) b) # sequence :: Monad m => (f :+: g) (m a) -> m ((f :+: g) a) #
(Traversable f, Traversable g) => Traversable (f :*: g) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) # sequenceA :: Applicative f0 => (f :*: g) (f0 a) -> f0 ((f :*: g) a) # mapM :: Monad m => (a -> m b) -> (f :*: g) a -> m ((f :*: g) b) # sequence :: Monad m => (f :*: g) (m a) -> m ((f :*: g) a) #
(Traversable f, Traversable g) => Traversable (Sum f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods traverse :: Applicative f0 => (a -> f0 b) -> Sum f g a -> f0 (Sum f g b) # sequenceA :: Applicative f0 => Sum f g (f0 a) -> f0 (Sum f g a) # mapM :: Monad m => (a -> m b) -> Sum f g a -> m (Sum f g b) # sequence :: Monad m => Sum f g (m a) -> m (Sum f g a) #
(Traversable f, Traversable g) => Traversable (Product f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods traverse :: Applicative f0 => (a -> f0 b) -> Product f g a -> f0 (Product f g b) # sequenceA :: Applicative f0 => Product f g (f0 a) -> f0 (Product f g a) # mapM :: Monad m => (a -> m b) -> Product f g a -> m (Product f g b) # sequence :: Monad m => Product f g (m a) -> m (Product f g a) #
Traversable f => Traversable (M1 i c f) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> M1 i c f a -> f0 (M1 i c f b) # sequenceA :: Applicative f0 => M1 i c f (f0 a) -> f0 (M1 i c f a) # mapM :: Monad m => (a -> m b) -> M1 i c f a -> m (M1 i c f b) # sequence :: Monad m => M1 i c f (m a) -> m (M1 i c f a) #
(Traversable f, Traversable g) => Traversable (f :.: g) # |
Instance details Defined in Data.Traversable Methods traverse :: Applicative f0 => (a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) # sequenceA :: Applicative f0 => (f :.: g) (f0 a) -> f0 ((f :.: g) a) # mapM :: Monad m => (a -> m b) -> (f :.: g) a -> m ((f :.: g) b) # sequence :: Monad m => (f :.: g) (m a) -> m ((f :.: g) a) #
(Traversable f, Traversable g) => Traversable (Compose f g) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods traverse :: Applicative f0 => (a -> f0 b) -> Compose f g a -> f0 (Compose f g b) # sequenceA :: Applicative f0 => Compose f g (f0 a) -> f0 (Compose f g a) # mapM :: Monad m => (a -> m b) -> Compose f g a -> m (Compose f g b) # sequence :: Monad m => Compose f g (m a) -> m (Compose f g a) #

## Miscellaneous functions

id :: a -> a #

Identity function.

    id x = x

const :: a -> b -> a #

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

    >>> const 42 "hello"
    42

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

(.) :: (b -> c) -> (a -> b) -> a -> c infixr 9 #

Function composition.

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

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

    >>> flip (++) "hello" "world"
    "worldhello"

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

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

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

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

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

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

asTypeOf :: a -> a -> a #

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

error :: forall (r :: RuntimeRep). forall (a :: TYPE r). HasCallStack => [Char] -> a #

`error` stops execution and displays an error message.

errorWithoutStackTrace :: forall (r :: RuntimeRep). forall (a :: TYPE r). [Char] -> a #

A variant of `error` that does not produce a stack trace.

Since: base-4.9.0.0

undefined :: forall (r :: RuntimeRep). forall (a :: TYPE r). HasCallStack => a #

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

seq :: a -> b -> b Source #

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

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

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

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

# List operations

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

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

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

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

Append two lists, i.e.,

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

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

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

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

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

head :: [a] -> a #

Extract the first element of a list, which must be non-empty.

last :: [a] -> a #

Extract the last element of a list, which must be finite and non-empty.

tail :: [a] -> [a] #

Extract the elements after the head of a list, which must be non-empty.

init :: [a] -> [a] #

Return all the elements of a list except the last one. The list must be non-empty.

null :: Foldable t => t a -> Bool #

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 #

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 #

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

`reverse` `xs` returns the elements of `xs` in reverse order. `xs` must be finite.

### Special folds

and :: Foldable t => t Bool -> Bool #

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

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

Determines whether any element of the structure satisfies the predicate.

all :: Foldable t => (a -> Bool) -> t a -> Bool #

Determines whether all elements of the structure satisfy the predicate.

concat :: Foldable t => t [a] -> [a] #

The concatenation of all the elements of a container of lists.

concatMap :: Foldable t => (a -> [b]) -> t a -> [b] #

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

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

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

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

`scanr1` is a variant of `scanr` that has no starting value argument.

### Infinite lists

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

`iterate` `f x` returns an infinite list of repeated applications of `f` to `x`:

    iterate f x == [x, f x, f (f x), ...]

Note that `iterate` is lazy, potentially leading to thunk build-up if the consumer doesn't force each iterate. See 'iterate\'' for a strict variant of this function.

repeat :: a -> [a] #

`repeat` `x` is an infinite list, with `x` the value of every element.

replicate :: Int -> a -> [a] #

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

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

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

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

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

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

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

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

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

`notElem` is the negation of `elem`.

lookup :: Eq a => a -> [(a, b)] -> Maybe b #

`lookup` `key assocs` looks up a key in an association list.

## Zipping and unzipping lists

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

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

`zip3` takes three lists and returns a list of triples, analogous to `zip`.

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

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

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

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

The `unzip3` function takes a list of triples and returns three lists, analogous to `unzip`.

## Functions on strings

lines :: String -> [String] #

`lines` breaks a string up into a list of strings at newline characters. The resulting strings do not contain newlines.

Note that after splitting the string at newline characters, the last part of the string is considered a line even if it doesn't end with a newline. For example,

    >>> lines ""
    []

    >>> lines "\n"
    [""]

    >>> lines "one"
    ["one"]

    >>> lines "one\n"
    ["one"]

    >>> lines "one\n\n"
    ["one",""]

    >>> lines "one\ntwo"
    ["one","two"]

    >>> lines "one\ntwo\n"
    ["one","two"]

Thus ``lines` s` contains at least as many elements as newlines in `s`.

words :: String -> [String] #

`words` breaks a string up into a list of words, which were delimited by white space.

    >>> words "Lorem ipsum\ndolor"
    ["Lorem","ipsum","dolor"]

unlines :: [String] -> String #

`unlines` is an inverse operation to `lines`. It joins lines, after appending a terminating newline to each.

    >>> unlines ["Hello", "World", "!"]
    "Hello\nWorld\n!\n"

unwords :: [String] -> String #

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

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 #

Conversion of values to readable `String`s.

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

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

For example, given the declarations

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

the derived instance of `Show` is equivalent to

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

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

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

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

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

Minimal complete definition

showsPrec | show

Methods

showsPrec #

Arguments

:: Int | the operator precedence of the enclosing context (a number from `0` to `11`). Function application has precedence `10`.
-> a | the value to be converted to a `String`
-> ShowS |

Convert a value to a readable `String`.

`showsPrec` should satisfy the law

    showsPrec d x r ++ s  ==  showsPrec d x (r ++ s)

Derived instances of `Read` and `Show` satisfy the following:

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

That is, `readsPrec` parses the string produced by `showsPrec`, and delivers the value that `showsPrec` started with.

show :: a -> String #

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

showList :: [a] -> ShowS #

The method `showList` is provided to allow the programmer to give a specialised way of showing lists of values. For example, this is used by the predefined `Show` instance of the `Char` type, where values of type `String` should be shown in double quotes, rather than between square brackets.

Instances

Show Bool # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Bool -> ShowS # show :: Bool -> String # showList :: [Bool] -> ShowS #
Show Char # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Char -> ShowS # show :: Char -> String # showList :: [Char] -> ShowS #
Show Double # | Since: base-2.1
Instance details Defined in GHC.Float Methods showsPrec :: Int -> Double -> ShowS # show :: Double -> String # showList :: [Double] -> ShowS #
Show Float # | Since: base-2.1
Instance details Defined in GHC.Float Methods showsPrec :: Int -> Float -> ShowS # show :: Float -> String # showList :: [Float] -> ShowS #
Show Int # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Int -> ShowS # show :: Int -> String # showList :: [Int] -> ShowS #
Show Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int8 -> ShowS # show :: Int8 -> String # showList :: [Int8] -> ShowS #
Show Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int16 -> ShowS # show :: Int16 -> String # showList :: [Int16] -> ShowS #
Show Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int32 -> ShowS # show :: Int32 -> String # showList :: [Int32] -> ShowS #
Show Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods showsPrec :: Int -> Int64 -> ShowS # show :: Int64 -> String # showList :: [Int64] -> ShowS #
Show Integer # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Integer -> ShowS # show :: Integer -> String # showList :: [Integer] -> ShowS #
Show Natural # | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods showsPrec :: Int -> Natural -> ShowS # show :: Natural -> String # showList :: [Natural] -> ShowS #
Show Ordering # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Ordering -> ShowS # show :: Ordering -> String # showList :: [Ordering] -> ShowS #
Show Word # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Word -> ShowS # show :: Word -> String # showList :: [Word] -> ShowS #
Show Word8 # | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word8 -> ShowS # show :: Word8 -> String # showList :: [Word8] -> ShowS #
Show Word16 # | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word16 -> ShowS # show :: Word16 -> String # showList :: [Word16] -> ShowS #
Show Word32 # | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word32 -> ShowS # show :: Word32 -> String # showList :: [Word32] -> ShowS #
Show Word64 # | Since: base-2.1
Instance details Defined in GHC.Word Methods showsPrec :: Int -> Word64 -> ShowS # show :: Word64 -> String # showList :: [Word64] -> ShowS #
Show RuntimeRep # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> RuntimeRep -> ShowS # show :: RuntimeRep -> String # showList :: [RuntimeRep] -> ShowS #
Show VecCount # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> VecCount -> ShowS # show :: VecCount -> String # showList :: [VecCount] -> ShowS #
Show VecElem # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> VecElem -> ShowS # show :: VecElem -> String # showList :: [VecElem] -> ShowS #
Show CallStack # | Since: base-4.9.0.0
Instance details Defined in GHC.Show Methods showsPrec :: Int -> CallStack -> ShowS # show :: CallStack -> String # showList :: [CallStack] -> ShowS #
Show SomeTypeRep # | Since: base-4.10.0.0
Instance details Defined in Data.Typeable.Internal Methods showsPrec :: Int -> SomeTypeRep -> ShowS # show :: SomeTypeRep -> String # showList :: [SomeTypeRep] -> ShowS #
Show () # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> () -> ShowS # show :: () -> String # showList :: [()] -> ShowS #
Show TyCon # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> TyCon -> ShowS # show :: TyCon -> String # showList :: [TyCon] -> ShowS #
Show Module # | Since: base-4.9.0.0
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Module -> ShowS # show :: Module -> String # showList :: [Module] -> ShowS #
Show TrName # | Since: base-4.9.0.0
Instance details Defined in GHC.Show Methods showsPrec :: Int -> TrName -> ShowS # show :: TrName -> String # showList :: [TrName] -> ShowS #
Show KindRep # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> KindRep -> ShowS # show :: KindRep -> String # showList :: [KindRep] -> ShowS #
Show TypeLitSort # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> TypeLitSort -> ShowS # show :: TypeLitSort -> String # showList :: [TypeLitSort] -> ShowS #
Show SrcLoc # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> SrcLoc -> ShowS # show :: SrcLoc -> String # showList :: [SrcLoc] -> ShowS #
Show SomeException # | Since: base-3.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> SomeException -> ShowS # show :: SomeException -> String # showList :: [SomeException] -> ShowS #
Show GeneralCategory # |
Instance details Defined in GHC.Unicode Methods showsPrec :: Int -> GeneralCategory -> ShowS # show :: GeneralCategory -> String # showList :: [GeneralCategory] -> ShowS #
Show Number # |
Instance details Defined in Text.Read.Lex Methods showsPrec :: Int -> Number -> ShowS # show :: Number -> String # showList :: [Number] -> ShowS #
Show Lexeme # |
Instance details Defined in Text.Read.Lex Methods showsPrec :: Int -> Lexeme -> ShowS # show :: Lexeme -> String # showList :: [Lexeme] -> ShowS #
Show Fingerprint # | Since: base-4.7.0.0
Instance details Defined in GHC.Fingerprint.Type Methods showsPrec :: Int -> Fingerprint -> ShowS # show :: Fingerprint -> String # showList :: [Fingerprint] -> ShowS #
Show IOMode # |
Instance details Defined in GHC.IO.IOMode Methods showsPrec :: Int -> IOMode -> ShowS # show :: IOMode -> String # showList :: [IOMode] -> ShowS #
Show IntPtr # |
Instance details Defined in Foreign.Ptr Methods showsPrec :: Int -> IntPtr -> ShowS # show :: IntPtr -> String # showList :: [IntPtr] -> ShowS #
Show WordPtr # |
Instance details Defined in Foreign.Ptr Methods showsPrec :: Int -> WordPtr -> ShowS # show :: WordPtr -> String # showList :: [WordPtr] -> ShowS #
Show CUIntMax # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUIntMax -> ShowS # show :: CUIntMax -> String # showList :: [CUIntMax] -> ShowS #
Show CIntMax # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CIntMax -> ShowS # show :: CIntMax -> String # showList :: [CIntMax] -> ShowS #
Show CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUIntPtr -> ShowS # show :: CUIntPtr -> String # showList :: [CUIntPtr] -> ShowS #
Show CIntPtr # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CIntPtr -> ShowS # show :: CIntPtr -> String # showList :: [CIntPtr] -> ShowS #
Show CSUSeconds # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CSUSeconds -> ShowS # show :: CSUSeconds -> String # showList :: [CSUSeconds] -> ShowS #
Show CUSeconds # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUSeconds -> ShowS # show :: CUSeconds -> String # showList :: [CUSeconds] -> ShowS #
Show CTime # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CTime -> ShowS # show :: CTime -> String # showList :: [CTime] -> ShowS #
Show CClock # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CClock -> ShowS # show :: CClock -> String # showList :: [CClock] -> ShowS #
Show CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CSigAtomic -> ShowS # show :: CSigAtomic -> String # showList :: [CSigAtomic] -> ShowS #
Show CWchar # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CWchar -> ShowS # show :: CWchar -> String # showList :: [CWchar] -> ShowS #
Show CSize # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CSize -> ShowS # show :: CSize -> String # showList :: [CSize] -> ShowS #
Show CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CPtrdiff -> ShowS # show :: CPtrdiff -> String # showList :: [CPtrdiff] -> ShowS #
Show CDouble # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CDouble -> ShowS # show :: CDouble -> String # showList :: [CDouble] -> ShowS #
Show CFloat # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CFloat -> ShowS # show :: CFloat -> String # showList :: [CFloat] -> ShowS #
Show CBool # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CBool -> ShowS # show :: CBool -> String # showList :: [CBool] -> ShowS #
Show CULLong # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CULLong -> ShowS # show :: CULLong -> String # showList :: [CULLong] -> ShowS #
Show CLLong # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CLLong -> ShowS # show :: CLLong -> String # showList :: [CLLong] -> ShowS #
Show CULong # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CULong -> ShowS # show :: CULong -> String # showList :: [CULong] -> ShowS #
Show CLong # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CLong -> ShowS # show :: CLong -> String # showList :: [CLong] -> ShowS #
Show CUInt # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUInt -> ShowS # show :: CUInt -> String # showList :: [CUInt] -> ShowS #
Show CInt # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CInt -> ShowS # show :: CInt -> String # showList :: [CInt] -> ShowS #
Show CUShort # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUShort -> ShowS # show :: CUShort -> String # showList :: [CUShort] -> ShowS #
Show CShort # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CShort -> ShowS # show :: CShort -> String # showList :: [CShort] -> ShowS #
Show CUChar # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CUChar -> ShowS # show :: CUChar -> String # showList :: [CUChar] -> ShowS #
Show CSChar # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CSChar -> ShowS # show :: CSChar -> String # showList :: [CSChar] -> ShowS #
Show CChar # |
Instance details Defined in Foreign.C.Types Methods showsPrec :: Int -> CChar -> ShowS # show :: CChar -> String # showList :: [CChar] -> ShowS #
Show SomeNat # | Since: base-4.7.0.0
Instance details Defined in GHC.TypeNats Methods showsPrec :: Int -> SomeNat -> ShowS # show :: SomeNat -> String # showList :: [SomeNat] -> ShowS #
Show SomeSymbol # | Since: base-4.7.0.0
Instance details Defined in GHC.TypeLits Methods showsPrec :: Int -> SomeSymbol -> ShowS # show :: SomeSymbol -> String # showList :: [SomeSymbol] -> ShowS #
Show DecidedStrictness # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> DecidedStrictness -> ShowS # show :: DecidedStrictness -> String # showList :: [DecidedStrictness] -> ShowS #
Show SourceStrictness # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> SourceStrictness -> ShowS # show :: SourceStrictness -> String # showList :: [SourceStrictness] -> ShowS #
Show SourceUnpackedness # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> SourceUnpackedness -> ShowS # show :: SourceUnpackedness -> String # showList :: [SourceUnpackedness] -> ShowS #
Show Associativity # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> Associativity -> ShowS # show :: Associativity -> String # showList :: [Associativity] -> ShowS #
Show Fixity # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> Fixity -> ShowS # show :: Fixity -> String # showList :: [Fixity] -> ShowS #
Show Any # |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Any -> ShowS # show :: Any -> String # showList :: [Any] -> ShowS #
Show All # |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> All -> ShowS # show :: All -> String # showList :: [All] -> ShowS #
Show ArithException # | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> ArithException -> ShowS # show :: ArithException -> String # showList :: [ArithException] -> ShowS #
Show ErrorCall # | Since: base-4.0.0.0
Instance details Defined in GHC.Exception Methods showsPrec :: Int -> ErrorCall -> ShowS # show :: ErrorCall -> String # showList :: [ErrorCall] -> ShowS #
Show IOException # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOException -> ShowS # show :: IOException -> String # showList :: [IOException] -> ShowS #
Show MaskingState # |
Instance details Defined in GHC.IO Methods showsPrec :: Int -> MaskingState -> ShowS # show :: MaskingState -> String # showList :: [MaskingState] -> ShowS #
Show CodingProgress # |
Instance details Defined in GHC.IO.Encoding.Types Methods showsPrec :: Int -> CodingProgress -> ShowS # show :: CodingProgress -> String # showList :: [CodingProgress] -> ShowS #
Show TextEncoding # | Since: base-4.3.0.0
Instance details Defined in GHC.IO.Encoding.Types Methods showsPrec :: Int -> TextEncoding -> ShowS # show :: TextEncoding -> String # showList :: [TextEncoding] -> ShowS #
Show SeekMode # |
Instance details Defined in GHC.IO.Device Methods showsPrec :: Int -> SeekMode -> ShowS # show :: SeekMode -> String # showList :: [SeekMode] -> ShowS #
Show NewlineMode # |
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> NewlineMode -> ShowS # show :: NewlineMode -> String # showList :: [NewlineMode] -> ShowS #
Show Newline # |
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> Newline -> ShowS # show :: Newline -> String # showList :: [Newline] -> ShowS #
Show BufferMode # |
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> BufferMode -> ShowS # show :: BufferMode -> String # showList :: [BufferMode] -> ShowS #
Show Handle # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle.Types Methods showsPrec :: Int -> Handle -> ShowS # show :: Handle -> String # showList :: [Handle] -> ShowS #
Show IOErrorType # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> IOErrorType -> ShowS # show :: IOErrorType -> String # showList :: [IOErrorType] -> ShowS #
Show ExitCode # |
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> ExitCode -> ShowS # show :: ExitCode -> String # showList :: [ExitCode] -> ShowS #
Show FixIOException # | Since: base-4.11.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> FixIOException -> ShowS # show :: FixIOException -> String # showList :: [FixIOException] -> ShowS #
Show ArrayException # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> ArrayException -> ShowS # show :: ArrayException -> String # showList :: [ArrayException] -> ShowS #
Show AsyncException # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AsyncException -> ShowS # show :: AsyncException -> String # showList :: [AsyncException] -> ShowS #
Show SomeAsyncException # | Since: base-4.7.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> SomeAsyncException -> ShowS # show :: SomeAsyncException -> String # showList :: [SomeAsyncException] -> ShowS #
Show AssertionFailed # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AssertionFailed -> ShowS # show :: AssertionFailed -> String # showList :: [AssertionFailed] -> ShowS #
Show CompactionFailed # | Since: base-4.10.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> CompactionFailed -> ShowS # show :: CompactionFailed -> String # showList :: [CompactionFailed] -> ShowS #
Show AllocationLimitExceeded # | Since: base-4.7.1.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> AllocationLimitExceeded -> ShowS # show :: AllocationLimitExceeded -> String # showList :: [AllocationLimitExceeded] -> ShowS #
Show Deadlock # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> Deadlock -> ShowS # show :: Deadlock -> String # showList :: [Deadlock] -> ShowS #
Show BlockedIndefinitelyOnSTM # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnSTM -> ShowS # show :: BlockedIndefinitelyOnSTM -> String # showList :: [BlockedIndefinitelyOnSTM] -> ShowS #
Show BlockedIndefinitelyOnMVar # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Exception Methods showsPrec :: Int -> BlockedIndefinitelyOnMVar -> ShowS # show :: BlockedIndefinitelyOnMVar -> String # showList :: [BlockedIndefinitelyOnMVar] -> ShowS #
Show CodingFailureMode # |
Instance details Defined in GHC.IO.Encoding.Failure Methods showsPrec :: Int -> CodingFailureMode -> ShowS # show :: CodingFailureMode -> String # showList :: [CodingFailureMode] -> ShowS #
Show Fd # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> Fd -> ShowS # show :: Fd -> String # showList :: [Fd] -> ShowS #
Show CTimer # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CTimer -> ShowS # show :: CTimer -> String # showList :: [CTimer] -> ShowS #
Show CKey # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CKey -> ShowS # show :: CKey -> String # showList :: [CKey] -> ShowS #
Show CId # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CId -> ShowS # show :: CId -> String # showList :: [CId] -> ShowS #
Show CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CFsFilCnt -> ShowS # show :: CFsFilCnt -> String # showList :: [CFsFilCnt] -> ShowS #
Show CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CFsBlkCnt -> ShowS # show :: CFsBlkCnt -> String # showList :: [CFsBlkCnt] -> ShowS #
Show CClockId # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CClockId -> ShowS # show :: CClockId -> String # showList :: [CClockId] -> ShowS #
Show CBlkCnt # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CBlkCnt -> ShowS # show :: CBlkCnt -> String # showList :: [CBlkCnt] -> ShowS #
Show CBlkSize # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CBlkSize -> ShowS # show :: CBlkSize -> String # showList :: [CBlkSize] -> ShowS #
Show CRLim # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CRLim -> ShowS # show :: CRLim -> String # showList :: [CRLim] -> ShowS #
Show CTcflag # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CTcflag -> ShowS # show :: CTcflag -> String # showList :: [CTcflag] -> ShowS #
Show CSpeed # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CSpeed -> ShowS # show :: CSpeed -> String # showList :: [CSpeed] -> ShowS #
Show CCc # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CCc -> ShowS # show :: CCc -> String # showList :: [CCc] -> ShowS #
Show CUid # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CUid -> ShowS # show :: CUid -> String # showList :: [CUid] -> ShowS #
Show CNlink # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CNlink -> ShowS # show :: CNlink -> String # showList :: [CNlink] -> ShowS #
Show CGid # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CGid -> ShowS # show :: CGid -> String # showList :: [CGid] -> ShowS #
Show CSsize # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CSsize -> ShowS # show :: CSsize -> String # showList :: [CSsize] -> ShowS #
Show CPid # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CPid -> ShowS # show :: CPid -> String # showList :: [CPid] -> ShowS #
Show COff # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> COff -> ShowS # show :: COff -> String # showList :: [COff] -> ShowS #
Show CMode # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CMode -> ShowS # show :: CMode -> String # showList :: [CMode] -> ShowS #
Show CIno # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CIno -> ShowS # show :: CIno -> String # showList :: [CIno] -> ShowS #
Show CDev # |
Instance details Defined in System.Posix.Types Methods showsPrec :: Int -> CDev -> ShowS # show :: CDev -> String # showList :: [CDev] -> ShowS #
Show Lifetime # |
Instance details Defined in GHC.Event.Internal Methods showsPrec :: Int -> Lifetime -> ShowS # show :: Lifetime -> String # showList :: [Lifetime] -> ShowS #
Show Event # | Since: base-4.3.1.0
Instance details Defined in GHC.Event.Internal Methods showsPrec :: Int -> Event -> ShowS # show :: Event -> String # showList :: [Event] -> ShowS #
Show Dynamic # | Since: base-2.1
Instance details Defined in Data.Dynamic Methods showsPrec :: Int -> Dynamic -> ShowS # show :: Dynamic -> String # showList :: [Dynamic] -> ShowS #
Show ThreadStatus # |
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> ThreadStatus -> ShowS # show :: ThreadStatus -> String # showList :: [ThreadStatus] -> ShowS #
Show BlockReason # |
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> BlockReason -> ShowS # show :: BlockReason -> String # showList :: [BlockReason] -> ShowS #
Show ThreadId # | Since: base-4.2.0.0
Instance details Defined in GHC.Conc.Sync Methods showsPrec :: Int -> ThreadId -> ShowS # show :: ThreadId -> String # showList :: [ThreadId] -> ShowS #
Show NestedAtomically # | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NestedAtomically -> ShowS # show :: NestedAtomically -> String # showList :: [NestedAtomically] -> ShowS #
Show NonTermination # | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NonTermination -> ShowS # show :: NonTermination -> String # showList :: [NonTermination] -> ShowS #
Show TypeError # | Since: base-4.9.0.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> TypeError -> ShowS # show :: TypeError -> String # showList :: [TypeError] -> ShowS #
Show NoMethodError # | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> NoMethodError -> ShowS # show :: NoMethodError -> String # showList :: [NoMethodError] -> ShowS #
Show RecUpdError # | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecUpdError -> ShowS # show :: RecUpdError -> String # showList :: [RecUpdError] -> ShowS #
Show RecConError # | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecConError -> ShowS # show :: RecConError -> String # showList :: [RecConError] -> ShowS #
Show RecSelError # | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> RecSelError -> ShowS # show :: RecSelError -> String # showList :: [RecSelError] -> ShowS #
Show PatternMatchFail # | Since: base-4.0
Instance details Defined in Control.Exception.Base Methods showsPrec :: Int -> PatternMatchFail -> ShowS # show :: PatternMatchFail -> String # showList :: [PatternMatchFail] -> ShowS #
Show FdKey # |
Instance details Defined in GHC.Event.Manager Methods showsPrec :: Int -> FdKey -> ShowS # show :: FdKey -> String # showList :: [FdKey] -> ShowS #
Show FileLockingNotSupported # |
Instance details Defined in GHC.IO.Handle.Lock Methods showsPrec :: Int -> FileLockingNotSupported -> ShowS # show :: FileLockingNotSupported -> String # showList :: [FileLockingNotSupported] -> ShowS #
Show HandlePosn # | Since: base-4.1.0.0
Instance details Defined in GHC.IO.Handle Methods showsPrec :: Int -> HandlePosn -> ShowS # show :: HandlePosn -> String # showList :: [HandlePosn] -> ShowS #
Show Version # |
Instance details Defined in Data.Version Methods showsPrec :: Int -> Version -> ShowS # show :: Version -> String # showList :: [Version] -> ShowS #
Show ByteOrder # |
Instance details Defined in GHC.ByteOrder Methods showsPrec :: Int -> ByteOrder -> ShowS # show :: ByteOrder -> String # showList :: [ByteOrder] -> ShowS #
Show GCDetails # |
Instance details Defined in GHC.Stats Methods showsPrec :: Int -> GCDetails -> ShowS # show :: GCDetails -> String # showList :: [GCDetails] -> ShowS #
Show RTSStats # |
Instance details Defined in GHC.Stats Methods showsPrec :: Int -> RTSStats -> ShowS # show :: RTSStats -> String # showList :: [RTSStats] -> ShowS #
Show RTSFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> RTSFlags -> ShowS # show :: RTSFlags -> String # showList :: [RTSFlags] -> ShowS #
Show ParFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> ParFlags -> ShowS # show :: ParFlags -> String # showList :: [ParFlags] -> ShowS #
Show TickyFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> TickyFlags -> ShowS # show :: TickyFlags -> String # showList :: [TickyFlags] -> ShowS #
Show TraceFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> TraceFlags -> ShowS # show :: TraceFlags -> String # showList :: [TraceFlags] -> ShowS #
Show DoTrace # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> DoTrace -> ShowS # show :: DoTrace -> String # showList :: [DoTrace] -> ShowS #
Show ProfFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> ProfFlags -> ShowS # show :: ProfFlags -> String # showList :: [ProfFlags] -> ShowS #
Show DoHeapProfile # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> DoHeapProfile -> ShowS # show :: DoHeapProfile -> String # showList :: [DoHeapProfile] -> ShowS #
Show CCFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> CCFlags -> ShowS # show :: CCFlags -> String # showList :: [CCFlags] -> ShowS #
Show DoCostCentres # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> DoCostCentres -> ShowS # show :: DoCostCentres -> String # showList :: [DoCostCentres] -> ShowS #
Show DebugFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> DebugFlags -> ShowS # show :: DebugFlags -> String # showList :: [DebugFlags] -> ShowS #
Show MiscFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> MiscFlags -> ShowS # show :: MiscFlags -> String # showList :: [MiscFlags] -> ShowS #
Show ConcFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> ConcFlags -> ShowS # show :: ConcFlags -> String # showList :: [ConcFlags] -> ShowS #
Show GCFlags # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> GCFlags -> ShowS # show :: GCFlags -> String # showList :: [GCFlags] -> ShowS #
Show GiveGCStats # |
Instance details Defined in GHC.RTS.Flags Methods showsPrec :: Int -> GiveGCStats -> ShowS # show :: GiveGCStats -> String # showList :: [GiveGCStats] -> ShowS #
Show Fixity # |
Instance details Defined in Data.Data Methods showsPrec :: Int -> Fixity -> ShowS # show :: Fixity -> String # showList :: [Fixity] -> ShowS #
Show ConstrRep # |
Instance details Defined in Data.Data Methods showsPrec :: Int -> ConstrRep -> ShowS # show :: ConstrRep -> String # showList :: [ConstrRep] -> ShowS #
Show DataRep # |
Instance details Defined in Data.Data Methods showsPrec :: Int -> DataRep -> ShowS # show :: DataRep -> String # showList :: [DataRep] -> ShowS #
Show Constr # | Since: base-4.0.0.0
Instance details Defined in Data.Data Methods showsPrec :: Int -> Constr -> ShowS # show :: Constr -> String # showList :: [Constr] -> ShowS #
Show DataType # |
Instance details Defined in Data.Data Methods showsPrec :: Int -> DataType -> ShowS # show :: DataType -> String # showList :: [DataType] -> ShowS #
Show StaticPtrInfo # |
Instance details Defined in GHC.StaticPtr Methods showsPrec :: Int -> StaticPtrInfo -> ShowS # show :: StaticPtrInfo -> String # showList :: [StaticPtrInfo] -> ShowS #
Show Void # | Since: base-4.8.0.0
Instance details Defined in Data.Void Methods showsPrec :: Int -> Void -> ShowS # show :: Void -> String # showList :: [Void] -> ShowS #
Show a => Show [a] # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> [a] -> ShowS # show :: [a] -> String # showList :: [[a]] -> ShowS #
Show a => Show (Maybe a) # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> Maybe a -> ShowS # show :: Maybe a -> String # showList :: [Maybe a] -> ShowS #
Show a => Show (Ratio a) # | Since: base-2.0.1
Instance details Defined in GHC.Real Methods showsPrec :: Int -> Ratio a -> ShowS # show :: Ratio a -> String # showList :: [Ratio a] -> ShowS #
Show (Ptr a) # | Since: base-2.1
Instance details Defined in GHC.Ptr Methods showsPrec :: Int -> Ptr a -> ShowS # show :: Ptr a -> String # showList :: [Ptr a] -> ShowS #
Show (FunPtr a) # | Since: base-2.1
Instance details Defined in GHC.Ptr Methods showsPrec :: Int -> FunPtr a -> ShowS # show :: FunPtr a -> String # showList :: [FunPtr a] -> ShowS #
Show p => Show (Par1 p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> Par1 p -> ShowS # show :: Par1 p -> String # showList :: [Par1 p] -> ShowS #
Show a => Show (NonEmpty a) # |
Instance details Defined in GHC.Show Methods showsPrec :: Int -> NonEmpty a -> ShowS # show :: NonEmpty a -> String # showList :: [NonEmpty a] -> ShowS #
Show a => Show (Down a) # | Since: base-4.7.0.0
Instance details Defined in Data.Ord Methods showsPrec :: Int -> Down a -> ShowS # show :: Down a -> String # showList :: [Down a] -> ShowS #
Show a => Show (Product a) # |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Product a -> ShowS # show :: Product a -> String # showList :: [Product a] -> ShowS #
Show a => Show (Sum a) # |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Sum a -> ShowS # show :: Sum a -> String # showList :: [Sum a] -> ShowS #
Show a => Show (Dual a) # |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Dual a -> ShowS # show :: Dual a -> String # showList :: [Dual a] -> ShowS #
Show a => Show (Last a) # |
Instance details Defined in Data.Monoid Methods showsPrec :: Int -> Last a -> ShowS # show :: Last a -> String # showList :: [Last a] -> ShowS #
Show a => Show (First a) # |
Instance details Defined in Data.Monoid Methods showsPrec :: Int -> First a -> ShowS # show :: First a -> String # showList :: [First a] -> ShowS #
Show (ForeignPtr a) # | Since: base-2.1
Instance details Defined in GHC.ForeignPtr Methods showsPrec :: Int -> ForeignPtr a -> ShowS # show :: ForeignPtr a -> String # showList :: [ForeignPtr a] -> ShowS #
Show a => Show (Identity a) # | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods showsPrec :: Int -> Identity a -> ShowS # show :: Identity a -> String # showList :: [Identity a] -> ShowS #
Show a => Show (ZipList a) # |
Instance details Defined in Control.Applicative Methods showsPrec :: Int -> ZipList a -> ShowS # show :: ZipList a -> String # showList :: [ZipList a] -> ShowS #
Show a => Show (Option a) # |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Option a -> ShowS # show :: Option a -> String # showList :: [Option a] -> ShowS #
Show m => Show (WrappedMonoid m) # |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> WrappedMonoid m -> ShowS # show :: WrappedMonoid m -> String # showList :: [WrappedMonoid m] -> ShowS #
Show a => Show (Last a) # |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Last a -> ShowS # show :: Last a -> String # showList :: [Last a] -> ShowS #
Show a => Show (First a) # |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> First a -> ShowS # show :: First a -> String # showList :: [First a] -> ShowS #
Show a => Show (Max a) # |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Max a -> ShowS # show :: Max a -> String # showList :: [Max a] -> ShowS #
Show a => Show (Min a) # |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Min a -> ShowS # show :: Min a -> String # showList :: [Min a] -> ShowS #
HasResolution a => Show (Fixed a) # | Since: base-2.1
Instance details Defined in Data.Fixed Methods showsPrec :: Int -> Fixed a -> ShowS # show :: Fixed a -> String # showList :: [Fixed a] -> ShowS #
Show a => Show (Complex a) # |
Instance details Defined in Data.Complex Methods showsPrec :: Int -> Complex a -> ShowS # show :: Complex a -> String # showList :: [Complex a] -> ShowS #
Show (a -> b) # | Since: base-2.1
Instance details Defined in Text.Show.Functions Methods showsPrec :: Int -> (a -> b) -> ShowS # show :: (a -> b) -> String # showList :: [a -> b] -> ShowS #
(Show a, Show b) => Show (Either a b) # |
Instance details Defined in Data.Either Methods showsPrec :: Int -> Either a b -> ShowS # show :: Either a b -> String # showList :: [Either a b] -> ShowS #
Show (V1 p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> V1 p -> ShowS # show :: V1 p -> String # showList :: [V1 p] -> ShowS #
Show (U1 p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> U1 p -> ShowS # show :: U1 p -> String # showList :: [U1 p] -> ShowS #
Show (TypeRep a) # |
Instance details Defined in Data.Typeable.Internal Methods showsPrec :: Int -> TypeRep a -> ShowS # show :: TypeRep a -> String # showList :: [TypeRep a] -> ShowS #
(Show a, Show b) => Show (a, b) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b) -> ShowS # show :: (a, b) -> String # showList :: [(a, b)] -> ShowS #
Show (ST s a) # | Since: base-2.1
Instance details Defined in GHC.ST Methods showsPrec :: Int -> ST s a -> ShowS # show :: ST s a -> String # showList :: [ST s a] -> ShowS #
Show (Proxy s) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods showsPrec :: Int -> Proxy s -> ShowS # show :: Proxy s -> String # showList :: [Proxy s] -> ShowS #
(Show a, Show b) => Show (Arg a b) # |
Instance details Defined in Data.Semigroup Methods showsPrec :: Int -> Arg a b -> ShowS # show :: Arg a b -> String # showList :: [Arg a b] -> ShowS #
Show (f p) => Show (Rec1 f p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> Rec1 f p -> ShowS # show :: Rec1 f p -> String # showList :: [Rec1 f p] -> ShowS #
Show (URec Word p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Word p -> ShowS # show :: URec Word p -> String # showList :: [URec Word p] -> ShowS #
Show (URec Int p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Int p -> ShowS # show :: URec Int p -> String # showList :: [URec Int p] -> ShowS #
Show (URec Float p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Float p -> ShowS # show :: URec Float p -> String # showList :: [URec Float p] -> ShowS #
Show (URec Double p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Double p -> ShowS # show :: URec Double p -> String # showList :: [URec Double p] -> ShowS #
Show (URec Char p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> URec Char p -> ShowS # show :: URec Char p -> String # showList :: [URec Char p] -> ShowS #
(Show a, Show b, Show c) => Show (a, b, c) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c) -> ShowS # show :: (a, b, c) -> String # showList :: [(a, b, c)] -> ShowS #
Show (a :~: b) # |
Instance details Defined in Data.Type.Equality Methods showsPrec :: Int -> (a :~: b) -> ShowS # show :: (a :~: b) -> String # showList :: [a :~: b] -> ShowS #
Show (Coercion a b) # |
Instance details Defined in Data.Type.Coercion Methods showsPrec :: Int -> Coercion a b -> ShowS # show :: Coercion a b -> String # showList :: [Coercion a b] -> ShowS #
Show (f a) => Show (Alt f a) # |
Instance details Defined in Data.Semigroup.Internal Methods showsPrec :: Int -> Alt f a -> ShowS # show :: Alt f a -> String # showList :: [Alt f a] -> ShowS #
Show a => Show (Const a b) # | This instance would be equivalent to the derived instances of the `Const` newtype if the `runConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods showsPrec :: Int -> Const a b -> ShowS # show :: Const a b -> String # showList :: [Const a b] -> ShowS #
Show c => Show (K1 i c p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> K1 i c p -> ShowS # show :: K1 i c p -> String # showList :: [K1 i c p] -> ShowS #
(Show (f p), Show (g p)) => Show ((f :+: g) p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> (f :+: g) p -> ShowS # show :: (f :+: g) p -> String # showList :: [(f :+: g) p] -> ShowS #
(Show (f p), Show (g p)) => Show ((f :*: g) p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> (f :*: g) p -> ShowS # show :: (f :*: g) p -> String # showList :: [(f :*: g) p] -> ShowS #
(Show a, Show b, Show c, Show d) => Show (a, b, c, d) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d) -> ShowS # show :: (a, b, c, d) -> String # showList :: [(a, b, c, d)] -> ShowS #
Show (a :~~: b) # | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods showsPrec :: Int -> (a :~~: b) -> ShowS # show :: (a :~~: b) -> String # showList :: [a :~~: b] -> ShowS #
(Show1 f, Show1 g, Show a) => Show (Sum f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods showsPrec :: Int -> Sum f g a -> ShowS # show :: Sum f g a -> String # showList :: [Sum f g a] -> ShowS #
(Show1 f, Show1 g, Show a) => Show (Product f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods showsPrec :: Int -> Product f g a -> ShowS # show :: Product f g a -> String # showList :: [Product f g a] -> ShowS #
Show (f p) => Show (M1 i c f p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> M1 i c f p -> ShowS # show :: M1 i c f p -> String # showList :: [M1 i c f p] -> ShowS #
Show (f (g p)) => Show ((f :.: g) p) # |
Instance details Defined in GHC.Generics Methods showsPrec :: Int -> (f :.: g) p -> ShowS # show :: (f :.: g) p -> String # showList :: [(f :.: g) p] -> ShowS #
(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e) -> ShowS # show :: (a, b, c, d, e) -> String # showList :: [(a, b, c, d, e)] -> ShowS #
(Show1 f, Show1 g, Show a) => Show (Compose f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods showsPrec :: Int -> Compose f g a -> ShowS # show :: Compose f g a -> String # showList :: [Compose f g a] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f) -> ShowS # show :: (a, b, c, d, e, f) -> String # showList :: [(a, b, c, d, e, f)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g) -> ShowS # show :: (a, b, c, d, e, f, g) -> String # showList :: [(a, b, c, d, e, f, g)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h) => Show (a, b, c, d, e, f, g, h) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h) -> ShowS # show :: (a, b, c, d, e, f, g, h) -> String # showList :: [(a, b, c, d, e, f, g, h)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i) => Show (a, b, c, d, e, f, g, h, i) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i) -> ShowS # show :: (a, b, c, d, e, f, g, h, i) -> String # showList :: [(a, b, c, d, e, f, g, h, i)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j) => Show (a, b, c, d, e, f, g, h, i, j) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k) => Show (a, b, c, d, e, f, g, h, i, j, k) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l) => Show (a, b, c, d, e, f, g, h, i, j, k, l) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k, l) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k, l)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] -> ShowS #
(Show a, Show b, Show c, Show d, Show e, Show f, Show g, Show h, Show i, Show j, Show k, Show l, Show m, Show n, Show o) => Show (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | Since: base-2.1
Instance details Defined in GHC.Show Methods showsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ShowS # show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> String # showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> ShowS #

shows :: Show a => a -> ShowS #

equivalent to `showsPrec` with a precedence of 0.

showChar :: Char -> ShowS #

utility function converting a `Char` to a show function that simply prepends the character unchanged.

showString :: String -> ShowS #

utility function converting a `String` to a show function that simply prepends the string unchanged.

showParen :: Bool -> ShowS -> ShowS #

utility function that surrounds the inner show function with parentheses when the `Bool` parameter is `True`.

## Converting from `String`

type ReadS a = String -> [(a, String)] #

A parser for a type `a`, represented as a function that takes a `String` and returns a list of possible parses as `(a,`String`)` pairs.

Note that this kind of backtracking parser is very inefficient; reading a large structure may be quite slow (cf `ReadP`).

class Read a where #

Parsing of `String`s, producing values.

Derived instances of `Read` make the following assumptions, which derived instances of `Show` obey:

- If the constructor is defined to be an infix operator, then the derived `Read` instance will parse only infix applications of the constructor (not the prefix form).
- Associativity is not used to reduce the occurrence of parentheses, although precedence may be.
- If the constructor is defined using record syntax, the derived `Read` will parse only the record-syntax form, and furthermore, the fields must be given in the same order as the original declaration.
- The derived `Read` instance allows arbitrary Haskell whitespace between tokens of the input string. Extra parentheses are also allowed.

For example, given the declarations

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

the derived instance of `Read` in Haskell 2010 is equivalent to

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

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

                          ++ readParen (d > up_prec)
                             (\r -> [(u:^:v,w) |
                                     (u,s) <- readsPrec (up_prec+1) r,
                                     (":^:",t) <- lex s,
                                     (v,w) <- readsPrec (up_prec+1) t]) r

              where app_prec = 10
                    up_prec = 5

Note that right-associativity of `:^:` is unused.

The derived instance in GHC is equivalent to

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

            readPrec = parens $ (prec app_prec $ do
                                     Ident "Leaf" <- lexP
                                     m <- step readPrec
                                     return (Leaf m))

                         +++ (prec up_prec $ do
                                     u <- step readPrec
                                     Symbol ":^:" <- lexP
                                     v <- step readPrec
                                     return (u :^: v))

              where app_prec = 10
                    up_prec = 5

            readListPrec = readListPrecDefault

Why do both `readsPrec` and `readPrec` exist, and why does GHC opt to implement `readPrec` in derived `Read` instances instead of `readsPrec`? The reason is that `readsPrec` is based on the `ReadS` type, and although `ReadS` is mentioned in the Haskell 2010 Report, it is not a very efficient parser data structure.

`readPrec`, on the other hand, is based on a much more efficient `ReadPrec` datatype (a.k.a "new-style parsers"), but its definition relies on the use of the `RankNTypes` language extension. Therefore, `readPrec` (and its cousin, `readListPrec`) are marked as GHC-only. Nevertheless, it is recommended to use `readPrec` instead of `readsPrec` whenever possible for the efficiency improvements it brings.

As mentioned above, derived `Read` instances in GHC will implement `readPrec` instead of `readsPrec`. The default implementations of `readsPrec` (and its cousin, `readList`) will simply use `readPrec` under the hood. If you are writing a `Read` instance by hand, it is recommended to write it like so:

    instance Read T where
      readPrec     = ...
      readListPrec = readListPrecDefault

Minimal complete definition

readsPrec | readPrec

Methods

readsPrec #

Arguments

:: Int | the operator precedence of the enclosing context (a number from `0` to `11`). Function application has precedence `10`.
-> ReadS a |

attempts to parse a value from the front of the string, returning a list of (parsed value, remaining string) pairs. If there is no successful parse, the returned list is empty.

Derived instances of `Read` and `Show` satisfy the following:

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

That is, `readsPrec` parses the string produced by `showsPrec`, and delivers the value that `showsPrec` started with.

readList :: ReadS [a] #

The method `readList` is provided to allow the programmer to give a specialised way of parsing lists of values. For example, this is used by the predefined `Read` instance of the `Char` type, where values of type `String` should be are expected to use double quotes, rather than square brackets.

Instances

Read Bool # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Bool # readList :: ReadS [Bool] # readPrec :: ReadPrec Bool # readListPrec :: ReadPrec [Bool] #
Read Char # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Char # readList :: ReadS [Char] # readPrec :: ReadPrec Char # readListPrec :: ReadPrec [Char] #
Read Double # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Double # readList :: ReadS [Double] # readPrec :: ReadPrec Double # readListPrec :: ReadPrec [Double] #
Read Float # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Float # readList :: ReadS [Float] # readPrec :: ReadPrec Float # readListPrec :: ReadPrec [Float] #
Read Int # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Int # readList :: ReadS [Int] # readPrec :: ReadPrec Int # readListPrec :: ReadPrec [Int] #
Read Int8 # | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int8 # readList :: ReadS [Int8] # readPrec :: ReadPrec Int8 # readListPrec :: ReadPrec [Int8] #
Read Int16 # | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int16 # readList :: ReadS [Int16] # readPrec :: ReadPrec Int16 # readListPrec :: ReadPrec [Int16] #
Read Int32 # | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int32 # readList :: ReadS [Int32] # readPrec :: ReadPrec Int32 # readListPrec :: ReadPrec [Int32] #
Read Int64 # | Since: base-2.1
Instance details Defined in GHC.Int Methods readsPrec :: Int -> ReadS Int64 # readList :: ReadS [Int64] # readPrec :: ReadPrec Int64 # readListPrec :: ReadPrec [Int64] #
Read Integer # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Integer # readList :: ReadS [Integer] # readPrec :: ReadPrec Integer # readListPrec :: ReadPrec [Integer] #
Read Natural # | Since: base-4.8.0.0
Instance details Defined in GHC.Natural Methods readsPrec :: Int -> ReadS Natural # readList :: ReadS [Natural] # readPrec :: ReadPrec Natural # readListPrec :: ReadPrec [Natural] #
Read Ordering # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Ordering # readList :: ReadS [Ordering] # readPrec :: ReadPrec Ordering # readListPrec :: ReadPrec [Ordering] #
Read Word # | Since: base-4.5.0.0
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word # readList :: ReadS [Word] # readPrec :: ReadPrec Word # readListPrec :: ReadPrec [Word] #
Read Word8 # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word8 # readList :: ReadS [Word8] # readPrec :: ReadPrec Word8 # readListPrec :: ReadPrec [Word8] #
Read Word16 # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word16 # readList :: ReadS [Word16] # readPrec :: ReadPrec Word16 # readListPrec :: ReadPrec [Word16] #
Read Word32 # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word32 # readList :: ReadS [Word32] # readPrec :: ReadPrec Word32 # readListPrec :: ReadPrec [Word32] #
Read Word64 # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Word64 # readList :: ReadS [Word64] # readPrec :: ReadPrec Word64 # readListPrec :: ReadPrec [Word64] #
Read () # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS () # readList :: ReadS [()] # readPrec :: ReadPrec () # readListPrec :: ReadPrec [()] #
Read GeneralCategory # |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS GeneralCategory # readList :: ReadS [GeneralCategory] # readPrec :: ReadPrec GeneralCategory # readListPrec :: ReadPrec [GeneralCategory] #
Read Lexeme # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS Lexeme # readList :: ReadS [Lexeme] # readPrec :: ReadPrec Lexeme # readListPrec :: ReadPrec [Lexeme] #
Read IOMode # |
Instance details Defined in GHC.IO.IOMode Methods readsPrec :: Int -> ReadS IOMode # readList :: ReadS [IOMode] # readPrec :: ReadPrec IOMode # readListPrec :: ReadPrec [IOMode] #
Read IntPtr # |
Instance details Defined in Foreign.Ptr Methods readsPrec :: Int -> ReadS IntPtr # readList :: ReadS [IntPtr] # readPrec :: ReadPrec IntPtr # readListPrec :: ReadPrec [IntPtr] #
Read WordPtr # |
Instance details Defined in Foreign.Ptr Methods readsPrec :: Int -> ReadS WordPtr # readList :: ReadS [WordPtr] # readPrec :: ReadPrec WordPtr # readListPrec :: ReadPrec [WordPtr] #
Read CUIntMax # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUIntMax # readList :: ReadS [CUIntMax] # readPrec :: ReadPrec CUIntMax # readListPrec :: ReadPrec [CUIntMax] #
Read CIntMax # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CIntMax # readList :: ReadS [CIntMax] # readPrec :: ReadPrec CIntMax # readListPrec :: ReadPrec [CIntMax] #
Read CUIntPtr # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUIntPtr # readList :: ReadS [CUIntPtr] # readPrec :: ReadPrec CUIntPtr # readListPrec :: ReadPrec [CUIntPtr] #
Read CIntPtr # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CIntPtr # readList :: ReadS [CIntPtr] # readPrec :: ReadPrec CIntPtr # readListPrec :: ReadPrec [CIntPtr] #
Read CSUSeconds # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CSUSeconds # readList :: ReadS [CSUSeconds] # readPrec :: ReadPrec CSUSeconds # readListPrec :: ReadPrec [CSUSeconds] #
Read CUSeconds # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUSeconds # readList :: ReadS [CUSeconds] # readPrec :: ReadPrec CUSeconds # readListPrec :: ReadPrec [CUSeconds] #
Read CTime # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CTime # readList :: ReadS [CTime] # readPrec :: ReadPrec CTime # readListPrec :: ReadPrec [CTime] #
Read CClock # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CClock # readList :: ReadS [CClock] # readPrec :: ReadPrec CClock # readListPrec :: ReadPrec [CClock] #
Read CSigAtomic # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CSigAtomic # readList :: ReadS [CSigAtomic] # readPrec :: ReadPrec CSigAtomic # readListPrec :: ReadPrec [CSigAtomic] #
Read CWchar # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CWchar # readList :: ReadS [CWchar] # readPrec :: ReadPrec CWchar # readListPrec :: ReadPrec [CWchar] #
Read CSize # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CSize # readList :: ReadS [CSize] # readPrec :: ReadPrec CSize # readListPrec :: ReadPrec [CSize] #
Read CPtrdiff # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CPtrdiff # readList :: ReadS [CPtrdiff] # readPrec :: ReadPrec CPtrdiff # readListPrec :: ReadPrec [CPtrdiff] #
Read CDouble # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CDouble # readList :: ReadS [CDouble] # readPrec :: ReadPrec CDouble # readListPrec :: ReadPrec [CDouble] #
Read CFloat # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CFloat # readList :: ReadS [CFloat] # readPrec :: ReadPrec CFloat # readListPrec :: ReadPrec [CFloat] #
Read CBool # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CBool # readList :: ReadS [CBool] # readPrec :: ReadPrec CBool # readListPrec :: ReadPrec [CBool] #
Read CULLong # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CULLong # readList :: ReadS [CULLong] # readPrec :: ReadPrec CULLong # readListPrec :: ReadPrec [CULLong] #
Read CLLong # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CLLong # readList :: ReadS [CLLong] # readPrec :: ReadPrec CLLong # readListPrec :: ReadPrec [CLLong] #
Read CULong # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CULong # readList :: ReadS [CULong] # readPrec :: ReadPrec CULong # readListPrec :: ReadPrec [CULong] #
Read CLong # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CLong # readList :: ReadS [CLong] # readPrec :: ReadPrec CLong # readListPrec :: ReadPrec [CLong] #
Read CUInt # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUInt # readList :: ReadS [CUInt] # readPrec :: ReadPrec CUInt # readListPrec :: ReadPrec [CUInt] #
Read CInt # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CInt # readList :: ReadS [CInt] # readPrec :: ReadPrec CInt # readListPrec :: ReadPrec [CInt] #
Read CUShort # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUShort # readList :: ReadS [CUShort] # readPrec :: ReadPrec CUShort # readListPrec :: ReadPrec [CUShort] #
Read CShort # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CShort # readList :: ReadS [CShort] # readPrec :: ReadPrec CShort # readListPrec :: ReadPrec [CShort] #
Read CUChar # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CUChar # readList :: ReadS [CUChar] # readPrec :: ReadPrec CUChar # readListPrec :: ReadPrec [CUChar] #
Read CSChar # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CSChar # readList :: ReadS [CSChar] # readPrec :: ReadPrec CSChar # readListPrec :: ReadPrec [CSChar] #
Read CChar # |
Instance details Defined in Foreign.C.Types Methods readsPrec :: Int -> ReadS CChar # readList :: ReadS [CChar] # readPrec :: ReadPrec CChar # readListPrec :: ReadPrec [CChar] #
Read SomeNat # | Since: base-4.7.0.0
Instance details Defined in GHC.TypeNats Methods readsPrec :: Int -> ReadS SomeNat # readList :: ReadS [SomeNat] # readPrec :: ReadPrec SomeNat # readListPrec :: ReadPrec [SomeNat] #
Read SomeSymbol # | Since: base-4.7.0.0
Instance details Defined in GHC.TypeLits Methods readsPrec :: Int -> ReadS SomeSymbol # readList :: ReadS [SomeSymbol] # readPrec :: ReadPrec SomeSymbol # readListPrec :: ReadPrec [SomeSymbol] #
Read DecidedStrictness # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS DecidedStrictness # readList :: ReadS [DecidedStrictness] # readPrec :: ReadPrec DecidedStrictness # readListPrec :: ReadPrec [DecidedStrictness] #
Read SourceStrictness # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS SourceStrictness # readList :: ReadS [SourceStrictness] # readPrec :: ReadPrec SourceStrictness # readListPrec :: ReadPrec [SourceStrictness] #
Read SourceUnpackedness # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS SourceUnpackedness # readList :: ReadS [SourceUnpackedness] # readPrec :: ReadPrec SourceUnpackedness # readListPrec :: ReadPrec [SourceUnpackedness] #
Read Associativity # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS Associativity # readList :: ReadS [Associativity] # readPrec :: ReadPrec Associativity # readListPrec :: ReadPrec [Associativity] #
Read Fixity # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS Fixity # readList :: ReadS [Fixity] # readPrec :: ReadPrec Fixity # readListPrec :: ReadPrec [Fixity] #
Read Any # |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS Any # readList :: ReadS [Any] # readPrec :: ReadPrec Any # readListPrec :: ReadPrec [Any] #
Read All # |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS All # readList :: ReadS [All] # readPrec :: ReadPrec All # readListPrec :: ReadPrec [All] #
Read SeekMode # |
Instance details Defined in GHC.IO.Device Methods readsPrec :: Int -> ReadS SeekMode # readList :: ReadS [SeekMode] # readPrec :: ReadPrec SeekMode # readListPrec :: ReadPrec [SeekMode] #
Read NewlineMode # |
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS NewlineMode # readList :: ReadS [NewlineMode] # readPrec :: ReadPrec NewlineMode # readListPrec :: ReadPrec [NewlineMode] #
Read Newline # |
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS Newline # readList :: ReadS [Newline] # readPrec :: ReadPrec Newline # readListPrec :: ReadPrec [Newline] #
Read BufferMode # |
Instance details Defined in GHC.IO.Handle.Types Methods readsPrec :: Int -> ReadS BufferMode # readList :: ReadS [BufferMode] # readPrec :: ReadPrec BufferMode # readListPrec :: ReadPrec [BufferMode] #
Read ExitCode # |
Instance details Defined in GHC.IO.Exception Methods readsPrec :: Int -> ReadS ExitCode # readList :: ReadS [ExitCode] # readPrec :: ReadPrec ExitCode # readListPrec :: ReadPrec [ExitCode] #
Read Fd # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS Fd # readList :: ReadS [Fd] # readPrec :: ReadPrec Fd # readListPrec :: ReadPrec [Fd] #
Read CKey # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CKey # readList :: ReadS [CKey] # readPrec :: ReadPrec CKey # readListPrec :: ReadPrec [CKey] #
Read CId # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CId # readList :: ReadS [CId] # readPrec :: ReadPrec CId # readListPrec :: ReadPrec [CId] #
Read CFsFilCnt # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CFsFilCnt # readList :: ReadS [CFsFilCnt] # readPrec :: ReadPrec CFsFilCnt # readListPrec :: ReadPrec [CFsFilCnt] #
Read CFsBlkCnt # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CFsBlkCnt # readList :: ReadS [CFsBlkCnt] # readPrec :: ReadPrec CFsBlkCnt # readListPrec :: ReadPrec [CFsBlkCnt] #
Read CClockId # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CClockId # readList :: ReadS [CClockId] # readPrec :: ReadPrec CClockId # readListPrec :: ReadPrec [CClockId] #
Read CBlkCnt # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CBlkCnt # readList :: ReadS [CBlkCnt] # readPrec :: ReadPrec CBlkCnt # readListPrec :: ReadPrec [CBlkCnt] #
Read CBlkSize # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CBlkSize # readList :: ReadS [CBlkSize] # readPrec :: ReadPrec CBlkSize # readListPrec :: ReadPrec [CBlkSize] #
Read CRLim # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CRLim # readList :: ReadS [CRLim] # readPrec :: ReadPrec CRLim # readListPrec :: ReadPrec [CRLim] #
Read CTcflag # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CTcflag # readList :: ReadS [CTcflag] # readPrec :: ReadPrec CTcflag # readListPrec :: ReadPrec [CTcflag] #
Read CSpeed # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CSpeed # readList :: ReadS [CSpeed] # readPrec :: ReadPrec CSpeed # readListPrec :: ReadPrec [CSpeed] #
Read CCc # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CCc # readList :: ReadS [CCc] # readPrec :: ReadPrec CCc # readListPrec :: ReadPrec [CCc] #
Read CUid # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CUid # readList :: ReadS [CUid] # readPrec :: ReadPrec CUid # readListPrec :: ReadPrec [CUid] #
Read CNlink # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CNlink # readList :: ReadS [CNlink] # readPrec :: ReadPrec CNlink # readListPrec :: ReadPrec [CNlink] #
Read CGid # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CGid # readList :: ReadS [CGid] # readPrec :: ReadPrec CGid # readListPrec :: ReadPrec [CGid] #
Read CSsize # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CSsize # readList :: ReadS [CSsize] # readPrec :: ReadPrec CSsize # readListPrec :: ReadPrec [CSsize] #
Read CPid # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CPid # readList :: ReadS [CPid] # readPrec :: ReadPrec CPid # readListPrec :: ReadPrec [CPid] #
Read COff # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS COff # readList :: ReadS [COff] # readPrec :: ReadPrec COff # readListPrec :: ReadPrec [COff] #
Read CMode # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CMode # readList :: ReadS [CMode] # readPrec :: ReadPrec CMode # readListPrec :: ReadPrec [CMode] #
Read CIno # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CIno # readList :: ReadS [CIno] # readPrec :: ReadPrec CIno # readListPrec :: ReadPrec [CIno] #
Read CDev # |
Instance details Defined in System.Posix.Types Methods readsPrec :: Int -> ReadS CDev # readList :: ReadS [CDev] # readPrec :: ReadPrec CDev # readListPrec :: ReadPrec [CDev] #
Read Version # |
Instance details Defined in Data.Version Methods readsPrec :: Int -> ReadS Version # readList :: ReadS [Version] # readPrec :: ReadPrec Version # readListPrec :: ReadPrec [Version] #
Read ByteOrder # |
Instance details Defined in GHC.ByteOrder Methods readsPrec :: Int -> ReadS ByteOrder # readList :: ReadS [ByteOrder] # readPrec :: ReadPrec ByteOrder # readListPrec :: ReadPrec [ByteOrder] #
Read GCDetails # |
Instance details Defined in GHC.Stats Methods readsPrec :: Int -> ReadS GCDetails # readList :: ReadS [GCDetails] # readPrec :: ReadPrec GCDetails # readListPrec :: ReadPrec [GCDetails] #
Read RTSStats # |
Instance details Defined in GHC.Stats Methods readsPrec :: Int -> ReadS RTSStats # readList :: ReadS [RTSStats] # readPrec :: ReadPrec RTSStats # readListPrec :: ReadPrec [RTSStats] #
Read Void # | Reading a `Void` value is always a parse error, considering `Void` as a data type with no constructors. Since: base-4.8.0.0
Instance details Defined in Data.Void Methods readsPrec :: Int -> ReadS Void # readList :: ReadS [Void] # readPrec :: ReadPrec Void # readListPrec :: ReadPrec [Void] #
Read a => Read [a] # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS [a] # readList :: ReadS [[a]] # readPrec :: ReadPrec [a] # readListPrec :: ReadPrec [[a]] #
Read a => Read (Maybe a) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Maybe a) # readList :: ReadS [Maybe a] # readPrec :: ReadPrec (Maybe a) # readListPrec :: ReadPrec [Maybe a] #
(Integral a, Read a) => Read (Ratio a) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (Ratio a) # readList :: ReadS [Ratio a] # readPrec :: ReadPrec (Ratio a) # readListPrec :: ReadPrec [Ratio a] #
Read p => Read (Par1 p) # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (Par1 p) # readList :: ReadS [Par1 p] # readPrec :: ReadPrec (Par1 p) # readListPrec :: ReadPrec [Par1 p] #
Read a => Read (NonEmpty a) # |
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (NonEmpty a) # readList :: ReadS [NonEmpty a] # readPrec :: ReadPrec (NonEmpty a) # readListPrec :: ReadPrec [NonEmpty a] #
Read a => Read (Down a) # | Since: base-4.7.0.0
Instance details Defined in Data.Ord Methods readsPrec :: Int -> ReadS (Down a) # readList :: ReadS [Down a] # readPrec :: ReadPrec (Down a) # readListPrec :: ReadPrec [Down a] #
Read a => Read (Product a) # |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Product a) # readList :: ReadS [Product a] # readPrec :: ReadPrec (Product a) # readListPrec :: ReadPrec [Product a] #
Read a => Read (Sum a) # |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Sum a) # readList :: ReadS [Sum a] # readPrec :: ReadPrec (Sum a) # readListPrec :: ReadPrec [Sum a] #
Read a => Read (Dual a) # |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Dual a) # readList :: ReadS [Dual a] # readPrec :: ReadPrec (Dual a) # readListPrec :: ReadPrec [Dual a] #
Read a => Read (Last a) # |
Instance details Defined in Data.Monoid Methods readsPrec :: Int -> ReadS (Last a) # readList :: ReadS [Last a] # readPrec :: ReadPrec (Last a) # readListPrec :: ReadPrec [Last a] #
Read a => Read (First a) # |
Instance details Defined in Data.Monoid Methods readsPrec :: Int -> ReadS (First a) # readList :: ReadS [First a] # readPrec :: ReadPrec (First a) # readListPrec :: ReadPrec [First a] #
Read a => Read (Identity a) # | This instance would be equivalent to the derived instances of the `Identity` newtype if the `runIdentity` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Identity Methods readsPrec :: Int -> ReadS (Identity a) # readList :: ReadS [Identity a] # readPrec :: ReadPrec (Identity a) # readListPrec :: ReadPrec [Identity a] #
Read a => Read (ZipList a) # |
Instance details Defined in Control.Applicative Methods readsPrec :: Int -> ReadS (ZipList a) # readList :: ReadS [ZipList a] # readPrec :: ReadPrec (ZipList a) # readListPrec :: ReadPrec [ZipList a] #
Read a => Read (Option a) # |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Option a) # readList :: ReadS [Option a] # readPrec :: ReadPrec (Option a) # readListPrec :: ReadPrec [Option a] #
Read m => Read (WrappedMonoid m) # |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (WrappedMonoid m) # readList :: ReadS [WrappedMonoid m] # readPrec :: ReadPrec (WrappedMonoid m) # readListPrec :: ReadPrec [WrappedMonoid m] #
Read a => Read (Last a) # |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Last a) # readList :: ReadS [Last a] # readPrec :: ReadPrec (Last a) # readListPrec :: ReadPrec [Last a] #
Read a => Read (First a) # |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (First a) # readList :: ReadS [First a] # readPrec :: ReadPrec (First a) # readListPrec :: ReadPrec [First a] #
Read a => Read (Max a) # |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Max a) # readList :: ReadS [Max a] # readPrec :: ReadPrec (Max a) # readListPrec :: ReadPrec [Max a] #
Read a => Read (Min a) # |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Min a) # readList :: ReadS [Min a] # readPrec :: ReadPrec (Min a) # readListPrec :: ReadPrec [Min a] #
HasResolution a => Read (Fixed a) # | Since: base-4.3.0.0
Instance details Defined in Data.Fixed Methods readsPrec :: Int -> ReadS (Fixed a) # readList :: ReadS [Fixed a] # readPrec :: ReadPrec (Fixed a) # readListPrec :: ReadPrec [Fixed a] #
Read a => Read (Complex a) # |
Instance details Defined in Data.Complex Methods readsPrec :: Int -> ReadS (Complex a) # readList :: ReadS [Complex a] # readPrec :: ReadPrec (Complex a) # readListPrec :: ReadPrec [Complex a] #
(Read a, Read b) => Read (Either a b) # |
Instance details Defined in Data.Either Methods readsPrec :: Int -> ReadS (Either a b) # readList :: ReadS [Either a b] # readPrec :: ReadPrec (Either a b) # readListPrec :: ReadPrec [Either a b] #
Read (V1 p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (V1 p) # readList :: ReadS [V1 p] # readPrec :: ReadPrec (V1 p) # readListPrec :: ReadPrec [V1 p] #
Read (U1 p) # | Since: base-4.9.0.0
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (U1 p) # readList :: ReadS [U1 p] # readPrec :: ReadPrec (U1 p) # readListPrec :: ReadPrec [U1 p] #
(Read a, Read b) => Read (a, b) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b) # readList :: ReadS [(a, b)] # readPrec :: ReadPrec (a, b) # readListPrec :: ReadPrec [(a, b)] #
Read (Proxy t) # | Since: base-4.7.0.0
Instance details Defined in Data.Proxy Methods readsPrec :: Int -> ReadS (Proxy t) # readList :: ReadS [Proxy t] # readPrec :: ReadPrec (Proxy t) # readListPrec :: ReadPrec [Proxy t] #
(Read a, Read b) => Read (Arg a b) # |
Instance details Defined in Data.Semigroup Methods readsPrec :: Int -> ReadS (Arg a b) # readList :: ReadS [Arg a b] # readPrec :: ReadPrec (Arg a b) # readListPrec :: ReadPrec [Arg a b] #
Read (f p) => Read (Rec1 f p) # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (Rec1 f p) # readList :: ReadS [Rec1 f p] # readPrec :: ReadPrec (Rec1 f p) # readListPrec :: ReadPrec [Rec1 f p] #
(Read a, Read b, Read c) => Read (a, b, c) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c) # readList :: ReadS [(a, b, c)] # readPrec :: ReadPrec (a, b, c) # readListPrec :: ReadPrec [(a, b, c)] #
a ~ b => Read (a :~: b) # | Since: base-4.7.0.0
Instance details Defined in Data.Type.Equality Methods readsPrec :: Int -> ReadS (a :~: b) # readList :: ReadS [a :~: b] # readPrec :: ReadPrec (a :~: b) # readListPrec :: ReadPrec [a :~: b] #
Coercible a b => Read (Coercion a b) # | Since: base-4.7.0.0
Instance details Defined in Data.Type.Coercion Methods readsPrec :: Int -> ReadS (Coercion a b) # readList :: ReadS [Coercion a b] # readPrec :: ReadPrec (Coercion a b) # readListPrec :: ReadPrec [Coercion a b] #
Read (f a) => Read (Alt f a) # |
Instance details Defined in Data.Semigroup.Internal Methods readsPrec :: Int -> ReadS (Alt f a) # readList :: ReadS [Alt f a] # readPrec :: ReadPrec (Alt f a) # readListPrec :: ReadPrec [Alt f a] #
Read a => Read (Const a b) # | This instance would be equivalent to the derived instances of the `Const` newtype if the `runConst` field were removed Since: base-4.8.0.0
Instance details Defined in Data.Functor.Const Methods readsPrec :: Int -> ReadS (Const a b) # readList :: ReadS [Const a b] # readPrec :: ReadPrec (Const a b) # readListPrec :: ReadPrec [Const a b] #
Read c => Read (K1 i c p) # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (K1 i c p) # readList :: ReadS [K1 i c p] # readPrec :: ReadPrec (K1 i c p) # readListPrec :: ReadPrec [K1 i c p] #
(Read (f p), Read (g p)) => Read ((f :+: g) p) # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS ((f :+: g) p) # readList :: ReadS [(f :+: g) p] # readPrec :: ReadPrec ((f :+: g) p) # readListPrec :: ReadPrec [(f :+: g) p] #
(Read (f p), Read (g p)) => Read ((f :*: g) p) # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS ((f :*: g) p) # readList :: ReadS [(f :*: g) p] # readPrec :: ReadPrec ((f :*: g) p) # readListPrec :: ReadPrec [(f :*: g) p] #
(Read a, Read b, Read c, Read d) => Read (a, b, c, d) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d) # readList :: ReadS [(a, b, c, d)] # readPrec :: ReadPrec (a, b, c, d) # readListPrec :: ReadPrec [(a, b, c, d)] #
a ~~ b => Read (a :~~: b) # | Since: base-4.10.0.0
Instance details Defined in Data.Type.Equality Methods readsPrec :: Int -> ReadS (a :~~: b) # readList :: ReadS [a :~~: b] # readPrec :: ReadPrec (a :~~: b) # readListPrec :: ReadPrec [a :~~: b] #
(Read1 f, Read1 g, Read a) => Read (Sum f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Sum Methods readsPrec :: Int -> ReadS (Sum f g a) # readList :: ReadS [Sum f g a] # readPrec :: ReadPrec (Sum f g a) # readListPrec :: ReadPrec [Sum f g a] #
(Read1 f, Read1 g, Read a) => Read (Product f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Product Methods readsPrec :: Int -> ReadS (Product f g a) # readList :: ReadS [Product f g a] # readPrec :: ReadPrec (Product f g a) # readListPrec :: ReadPrec [Product f g a] #
Read (f p) => Read (M1 i c f p) # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS (M1 i c f p) # readList :: ReadS [M1 i c f p] # readPrec :: ReadPrec (M1 i c f p) # readListPrec :: ReadPrec [M1 i c f p] #
Read (f (g p)) => Read ((f :.: g) p) # |
Instance details Defined in GHC.Generics Methods readsPrec :: Int -> ReadS ((f :.: g) p) # readList :: ReadS [(f :.: g) p] # readPrec :: ReadPrec ((f :.: g) p) # readListPrec :: ReadPrec [(f :.: g) p] #
(Read a, Read b, Read c, Read d, Read e) => Read (a, b, c, d, e) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e) # readList :: ReadS [(a, b, c, d, e)] # readPrec :: ReadPrec (a, b, c, d, e) # readListPrec :: ReadPrec [(a, b, c, d, e)] #
(Read1 f, Read1 g, Read a) => Read (Compose f g a) # | Since: base-4.9.0.0
Instance details Defined in Data.Functor.Compose Methods readsPrec :: Int -> ReadS (Compose f g a) # readList :: ReadS [Compose f g a] # readPrec :: ReadPrec (Compose f g a) # readListPrec :: ReadPrec [Compose f g a] #
(Read a, Read b, Read c, Read d, Read e, Read f) => Read (a, b, c, d, e, f) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f) # readList :: ReadS [(a, b, c, d, e, f)] # readPrec :: ReadPrec (a, b, c, d, e, f) # readListPrec :: ReadPrec [(a, b, c, d, e, f)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g) => Read (a, b, c, d, e, f, g) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g) # readList :: ReadS [(a, b, c, d, e, f, g)] # readPrec :: ReadPrec (a, b, c, d, e, f, g) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h) => Read (a, b, c, d, e, f, g, h) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h) # readList :: ReadS [(a, b, c, d, e, f, g, h)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i) => Read (a, b, c, d, e, f, g, h, i) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i) # readList :: ReadS [(a, b, c, d, e, f, g, h, i)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j) => Read (a, b, c, d, e, f, g, h, i, j) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k) => Read (a, b, c, d, e, f, g, h, i, j, k) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l) => Read (a, b, c, d, e, f, g, h, i, j, k, l) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m, n)] #
(Read a, Read b, Read c, Read d, Read e, Read f, Read g, Read h, Read i, Read j, Read k, Read l, Read m, Read n, Read o) => Read (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | Since: base-2.1
Instance details Defined in GHC.Read Methods readsPrec :: Int -> ReadS (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # readList :: ReadS [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] # readPrec :: ReadPrec (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # readListPrec :: ReadPrec [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] #

reads :: Read a => ReadS a #

equivalent to `readsPrec` with a precedence of 0.

readParen :: Bool -> ReadS a -> ReadS a #

``readParen` `True` p` parses what `p` parses, but surrounded with parentheses.

``readParen` `False` p` parses what `p` parses, but optionally surrounded with parentheses.

read :: Read a => String -> a #

The `read` function reads input from a string, which must be completely consumed by the input process. `read` fails with an `error` if the parse is unsuccessful, and it is therefore discouraged from being used in real applications. Use `readMaybe` or `readEither` for safe alternatives.

    >>> read "123" :: Int
    123

    >>> read "hello" :: Int
    *** Exception: Prelude.read: no parse

lex :: ReadS String #

The `lex` function reads a single lexeme from the input, discarding initial white space, and returning the characters that constitute the lexeme. If the input string contains only white space, `lex` returns a single successful `lexeme' consisting of the empty string. (Thus ``lex` "" = [("","")]`.) If there is no legal lexeme at the beginning of the input string, `lex` fails (i.e. returns `[]`).

This lexer is not completely faithful to the Haskell lexical syntax in the following respects:

- Qualified names are not handled properly
- Octal and hexadecimal numerics are not recognized as a single token
- Comments are not treated properly

# Basic Input and output

data IO a Source #

A value of type ``IO` a` is a computation which, when performed, does some I/O before returning a value of type `a`.

There is really only one way to "perform" an I/O action: bind it to `Main.main` in your program. When your program is run, the I/O will be performed. It isn't possible to perform I/O from an arbitrary function, unless that function is itself in the `IO` monad and called at some point, directly or indirectly, from `Main.main`.

`IO` is a monad, so `IO` actions can be combined using either the do-notation or the `>>` and `>>=` operations from the `Monad` class.

Instances

Monad IO # | Since: base-2.1
Instance details Defined in GHC.Base Methods (>>=) :: IO a -> (a -> IO b) -> IO b # (>>) :: IO a -> IO b -> IO b # return :: a -> IO a # fail :: String -> IO a #
Functor IO # | Since: base-2.1
Instance details Defined in GHC.Base Methods fmap :: (a -> b) -> IO a -> IO b # (<$) :: a -> IO b -> IO a #
MonadFix IO # | Since: base-2.1
Instance details Defined in Control.Monad.Fix Methods mfix :: (a -> IO a) -> IO a #
MonadFail IO # | Since: base-4.9.0.0
Instance details Defined in Control.Monad.Fail Methods fail :: String -> IO a #
Applicative IO # | Since: base-2.1
Instance details Defined in GHC.Base Methods pure :: a -> IO a # (<*>) :: IO (a -> b) -> IO a -> IO b # liftA2 :: (a -> b -> c) -> IO a -> IO b -> IO c # (*>) :: IO a -> IO b -> IO b # (<*) :: IO a -> IO b -> IO a #
MonadPlus IO # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mzero :: IO a # mplus :: IO a -> IO a -> IO a #
Alternative IO # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods empty :: IO a # (<|>) :: IO a -> IO a -> IO a # some :: IO a -> IO [a] # many :: IO a -> IO [a] #
MonadIO IO # | Since: base-4.9.0.0
Instance details Defined in Control.Monad.IO.Class Methods liftIO :: IO a -> IO a #
Semigroup a => Semigroup (IO a) # | Since: base-4.10.0.0
Instance details Defined in GHC.Base Methods (<>) :: IO a -> IO a -> IO a # sconcat :: NonEmpty (IO a) -> IO a # stimes :: Integral b => b -> IO a -> IO a #
Monoid a => Monoid (IO a) # | Since: base-4.9.0.0
Instance details Defined in GHC.Base Methods mempty :: IO a # mappend :: IO a -> IO a -> IO a # mconcat :: [IO a] -> IO a #
a ~ () => HPrintfType (IO a) # | Since: base-4.7.0.0
Instance details Defined in Text.Printf Methods hspr :: Handle -> String -> [UPrintf] -> IO a
a ~ () => PrintfType (IO a) # | Since: base-4.7.0.0
Instance details Defined in Text.Printf Methods spr :: String -> [UPrintf] -> IO a

## Simple I/O operations

### Output functions

putChar :: Char -> IO () #

Write a character to the standard output device (same as `hPutChar` `stdout`).

putStr :: String -> IO () #

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

putStrLn :: String -> IO () #

The same as `putStr`, but adds a newline character.

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

The `print` function outputs a value of any printable type to the standard output device. Printable types are those that are instances of class `Show`; `print` converts values to strings for output using the `show` operation and adds a newline.

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

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

### Input functions

getChar :: IO Char #

Read a character from the standard input device (same as `hGetChar` `stdin`).

getLine :: IO String #

Read a line from the standard input device (same as `hGetLine` `stdin`).

getContents :: IO String #

The `getContents` operation returns all user input as a single string, which is read lazily as it is needed (same as `hGetContents` `stdin`).

interact :: (String -> String) -> IO () #

The `interact` function takes a function of type `String->String` as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device.

### Files

type FilePath = String #

File and directory names are values of type `String`, whose precise meaning is operating system dependent. Files can be opened, yielding a handle which can then be used to operate on the contents of that file.

readFile :: FilePath -> IO String #

The `readFile` function reads a file and returns the contents of the file as a string. The file is read lazily, on demand, as with `getContents`.

writeFile :: FilePath -> String -> IO () #

The computation `writeFile` `file str` function writes the string `str`, to the file `file`.

appendFile :: FilePath -> String -> IO () #

The computation `appendFile` `file str` function appends the string `str`, to the file `file`.

Note that `writeFile` and `appendFile` write a literal string to a file. To write a value of any printable type, as with `print`, use the `show` function to convert the value to a string first.

    main = appendFile "squares" (show [(x,x*x) | x <- [0,0.1..2]])

readIO :: Read a => String -> IO a #

The `readIO` function is similar to `read` except that it signals parse failure to the `IO` monad instead of terminating the program.

readLn :: Read a => IO a #

The `readLn` function combines `getLine` and `readIO`.

## Exception handling in the I/O monad

type IOError = IOException #

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 #

Raise an `IOError` in the `IO` monad.

userError :: String -> IOError #

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)