basement-0.0.3: Foundation scrap box of array & string

Basement.Imports

Description

re-export of all the base prelude and basic primitive stuffs

Synopsis

# Documentation

($) :: (a -> b) -> a -> b infixr 0 # Application operator. This operator is redundant, since ordinary application (f x) means the same as (f$ x). However, $ has low, right-associative binding precedence, so it sometimes allows parentheses to be omitted; for example:  f$ g $h x = f (g (h x)) It is also useful in higher-order situations, such as map ($ 0) xs, or zipWith ($) fs xs. ($!) :: (a -> b) -> a -> b infixr 0 #

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

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

Boolean "and"

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

Boolean "or"

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

morphism composition

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

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)


not :: Bool -> Bool #

Boolean "not"

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

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

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

Extract the first component of a pair.

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

Extract the second component of a pair.

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

the identity morphism

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

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

#### Examples

Basic usage:

>>> maybe False odd (Just 3)
True

>>> maybe False odd Nothing
False


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

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


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

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


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

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

#### Examples

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

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


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

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

const :: a -> b -> a #

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

For instance,

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


error :: forall r. forall a. HasCallStack => String -> a Source #

stop execution and displays an error message

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.

undefined :: HasCallStack => a #

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

seq :: a -> b -> b #

The value of seq a b is bottom if a is bottom, and otherwise equal to b. seq is usually introduced to improve performance by avoiding unneeded laziness.

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

class Show a #

Conversion of values to readable Strings.

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

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

For example, given the declarations

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

the derived instance of Show is equivalent to

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

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

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

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

Minimal complete definition

Instances

 MethodsshowsPrec :: Int -> Bool -> ShowS #show :: Bool -> String #showList :: [Bool] -> ShowS # MethodsshowsPrec :: Int -> Char -> ShowS #show :: Char -> String #showList :: [Char] -> ShowS # MethodsshowsPrec :: Int -> Int -> ShowS #show :: Int -> String #showList :: [Int] -> ShowS # MethodsshowsPrec :: Int -> Int8 -> ShowS #show :: Int8 -> String #showList :: [Int8] -> ShowS # MethodsshowsPrec :: Int -> Int16 -> ShowS #show :: Int16 -> String #showList :: [Int16] -> ShowS # MethodsshowsPrec :: Int -> Int32 -> ShowS #show :: Int32 -> String #showList :: [Int32] -> ShowS # MethodsshowsPrec :: Int -> Int64 -> ShowS #show :: Int64 -> String #showList :: [Int64] -> ShowS # MethodsshowList :: [Integer] -> ShowS # MethodsshowList :: [Ordering] -> ShowS # MethodsshowsPrec :: Int -> Word -> ShowS #show :: Word -> String #showList :: [Word] -> ShowS # MethodsshowsPrec :: Int -> Word8 -> ShowS #show :: Word8 -> String #showList :: [Word8] -> ShowS # MethodsshowsPrec :: Int -> Word16 -> ShowS #showList :: [Word16] -> ShowS # MethodsshowsPrec :: Int -> Word32 -> ShowS #showList :: [Word32] -> ShowS # MethodsshowsPrec :: Int -> Word64 -> ShowS #showList :: [Word64] -> ShowS # MethodsshowList :: [CallStack] -> ShowS # MethodsshowList :: [TypeRep] -> ShowS # Show () MethodsshowsPrec :: Int -> () -> ShowS #show :: () -> String #showList :: [()] -> ShowS # MethodsshowsPrec :: Int -> TyCon -> ShowS #show :: TyCon -> String #showList :: [TyCon] -> ShowS # MethodsshowsPrec :: Int -> Module -> ShowS #showList :: [Module] -> ShowS # MethodsshowsPrec :: Int -> TrName -> ShowS #showList :: [TrName] -> ShowS # MethodsshowList :: [Natural] -> ShowS # MethodsshowsPrec :: Int -> Void -> ShowS #show :: Void -> String #showList :: [Void] -> ShowS # MethodsshowList :: [DataType] -> ShowS # MethodsshowsPrec :: Int -> Constr -> ShowS #showList :: [Constr] -> ShowS # MethodsshowList :: [DataRep] -> ShowS # MethodsshowList :: [ConstrRep] -> ShowS # MethodsshowsPrec :: Int -> Fixity -> ShowS #showList :: [Fixity] -> ShowS # MethodsshowList :: [Version] -> ShowS # MethodsshowsPrec :: Int -> CDev -> ShowS #show :: CDev -> String #showList :: [CDev] -> ShowS # MethodsshowsPrec :: Int -> CIno -> ShowS #show :: CIno -> String #showList :: [CIno] -> ShowS # MethodsshowsPrec :: Int -> CMode -> ShowS #show :: CMode -> String #showList :: [CMode] -> ShowS # MethodsshowsPrec :: Int -> COff -> ShowS #show :: COff -> String #showList :: [COff] -> ShowS # MethodsshowsPrec :: Int -> CPid -> ShowS #show :: CPid -> String #showList :: [CPid] -> ShowS # MethodsshowsPrec :: Int -> CSsize -> ShowS #showList :: [CSsize] -> ShowS # MethodsshowsPrec :: Int -> CGid -> ShowS #show :: CGid -> String #showList :: [CGid] -> ShowS # MethodsshowsPrec :: Int -> CNlink -> ShowS #showList :: [CNlink] -> ShowS # MethodsshowsPrec :: Int -> CUid -> ShowS #show :: CUid -> String #showList :: [CUid] -> ShowS # MethodsshowsPrec :: Int -> CCc -> ShowS #show :: CCc -> String #showList :: [CCc] -> ShowS # MethodsshowsPrec :: Int -> CSpeed -> ShowS #showList :: [CSpeed] -> ShowS # MethodsshowList :: [CTcflag] -> ShowS # MethodsshowsPrec :: Int -> CRLim -> ShowS #show :: CRLim -> String #showList :: [CRLim] -> ShowS # MethodsshowsPrec :: Int -> Fd -> ShowS #show :: Fd -> String #showList :: [Fd] -> ShowS # Methods Methods MethodsshowList :: [Deadlock] -> ShowS # Methods MethodsshowList :: [AssertionFailed] -> ShowS # MethodsshowList :: [SomeAsyncException] -> ShowS # MethodsshowList :: [AsyncException] -> ShowS # MethodsshowList :: [ArrayException] -> ShowS # MethodsshowList :: [ExitCode] -> ShowS # MethodsshowList :: [IOErrorType] -> ShowS # MethodsshowList :: [WordPtr] -> ShowS # MethodsshowsPrec :: Int -> IntPtr -> ShowS #showList :: [IntPtr] -> ShowS # MethodsshowsPrec :: Int -> CChar -> ShowS #show :: CChar -> String #showList :: [CChar] -> ShowS # MethodsshowsPrec :: Int -> CSChar -> ShowS #showList :: [CSChar] -> ShowS # MethodsshowsPrec :: Int -> CUChar -> ShowS #showList :: [CUChar] -> ShowS # MethodsshowsPrec :: Int -> CShort -> ShowS #showList :: [CShort] -> ShowS # MethodsshowList :: [CUShort] -> ShowS # MethodsshowsPrec :: Int -> CInt -> ShowS #show :: CInt -> String #showList :: [CInt] -> ShowS # MethodsshowsPrec :: Int -> CUInt -> ShowS #show :: CUInt -> String #showList :: [CUInt] -> ShowS # MethodsshowsPrec :: Int -> CLong -> ShowS #show :: CLong -> String #showList :: [CLong] -> ShowS # MethodsshowsPrec :: Int -> CULong -> ShowS #showList :: [CULong] -> ShowS # MethodsshowsPrec :: Int -> CLLong -> ShowS #showList :: [CLLong] -> ShowS # MethodsshowList :: [CULLong] -> ShowS # MethodsshowsPrec :: Int -> CFloat -> ShowS #showList :: [CFloat] -> ShowS # MethodsshowList :: [CDouble] -> ShowS # MethodsshowList :: [CPtrdiff] -> ShowS # MethodsshowsPrec :: Int -> CSize -> ShowS #show :: CSize -> String #showList :: [CSize] -> ShowS # MethodsshowsPrec :: Int -> CWchar -> ShowS #showList :: [CWchar] -> ShowS # MethodsshowList :: [CSigAtomic] -> ShowS # MethodsshowsPrec :: Int -> CClock -> ShowS #showList :: [CClock] -> ShowS # MethodsshowsPrec :: Int -> CTime -> ShowS #show :: CTime -> String #showList :: [CTime] -> ShowS # MethodsshowList :: [CUSeconds] -> ShowS # MethodsshowList :: [CSUSeconds] -> ShowS # MethodsshowList :: [CIntPtr] -> ShowS # MethodsshowList :: [CUIntPtr] -> ShowS # MethodsshowList :: [CIntMax] -> ShowS # MethodsshowList :: [CUIntMax] -> ShowS # MethodsshowsPrec :: Int -> All -> ShowS #show :: All -> String #showList :: [All] -> ShowS # MethodsshowsPrec :: Int -> Any -> ShowS #show :: Any -> String #showList :: [Any] -> ShowS # MethodsshowsPrec :: Int -> Fixity -> ShowS #showList :: [Fixity] -> ShowS # MethodsshowList :: [Associativity] -> ShowS # MethodsshowList :: [SourceUnpackedness] -> ShowS # MethodsshowList :: [SourceStrictness] -> ShowS # MethodsshowList :: [DecidedStrictness] -> ShowS # MethodsshowList :: [MaskingState] -> ShowS # MethodsshowList :: [IOException] -> ShowS # MethodsshowList :: [ErrorCall] -> ShowS # MethodsshowList :: [ArithException] -> ShowS # MethodsshowList :: [SomeNat] -> ShowS # MethodsshowList :: [SomeSymbol] -> ShowS # MethodsshowList :: [GeneralCategory] -> ShowS # MethodsshowList :: [SomeException] -> ShowS # MethodsshowsPrec :: Int -> SrcLoc -> ShowS #showList :: [SrcLoc] -> ShowS # # MethodsshowList :: [Endianness] -> ShowS # # MethodsshowsPrec :: Int -> Char7 -> ShowS #show :: Char7 -> String #showList :: [Char7] -> ShowS # # MethodsshowList :: [Word128] -> ShowS # # MethodsshowList :: [Word256] -> ShowS # # MethodsshowList :: [FileSize] -> ShowS # # Methods # MethodsshowList :: [InvalidRecast] -> ShowS # # Methods # MethodsshowList :: [RecastSourceSize] -> ShowS # # MethodsshowList :: [OutOfBound] -> ShowS # # Methods # MethodsshowList :: [ValidationFailure] -> ShowS # # MethodsshowList :: [AsciiString] -> ShowS # # MethodsshowsPrec :: Int -> String -> ShowS #showList :: [String] -> ShowS # # MethodsshowList :: [Encoding] -> ShowS # Show a => Show [a] MethodsshowsPrec :: Int -> [a] -> ShowS #show :: [a] -> String #showList :: [[a]] -> ShowS # Show a => Show (Maybe a) MethodsshowsPrec :: Int -> Maybe a -> ShowS #show :: Maybe a -> String #showList :: [Maybe a] -> ShowS # Show a => Show (Ratio a) MethodsshowsPrec :: Int -> Ratio a -> ShowS #show :: Ratio a -> String #showList :: [Ratio a] -> ShowS # Show (Ptr a) MethodsshowsPrec :: Int -> Ptr a -> ShowS #show :: Ptr a -> String #showList :: [Ptr a] -> ShowS # Show (FunPtr a) MethodsshowsPrec :: Int -> FunPtr a -> ShowS #show :: FunPtr a -> String #showList :: [FunPtr a] -> ShowS # Show (V1 p) MethodsshowsPrec :: Int -> V1 p -> ShowS #show :: V1 p -> String #showList :: [V1 p] -> ShowS # Show (U1 p) MethodsshowsPrec :: Int -> U1 p -> ShowS #show :: U1 p -> String #showList :: [U1 p] -> ShowS # Show p => Show (Par1 p) MethodsshowsPrec :: Int -> Par1 p -> ShowS #show :: Par1 p -> String #showList :: [Par1 p] -> ShowS # Show a => Show (Identity a) This instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed MethodsshowsPrec :: Int -> Identity a -> ShowS #show :: Identity a -> String #showList :: [Identity a] -> ShowS # Show a => Show (Min a) MethodsshowsPrec :: Int -> Min a -> ShowS #show :: Min a -> String #showList :: [Min a] -> ShowS # Show a => Show (Max a) MethodsshowsPrec :: Int -> Max a -> ShowS #show :: Max a -> String #showList :: [Max a] -> ShowS # Show a => Show (First a) MethodsshowsPrec :: Int -> First a -> ShowS #show :: First a -> String #showList :: [First a] -> ShowS # Show a => Show (Last a) MethodsshowsPrec :: Int -> Last a -> ShowS #show :: Last a -> String #showList :: [Last a] -> ShowS # Show m => Show (WrappedMonoid m) MethodsshowsPrec :: Int -> WrappedMonoid m -> ShowS #show :: WrappedMonoid m -> String #showList :: [WrappedMonoid m] -> ShowS # Show a => Show (Option a) MethodsshowsPrec :: Int -> Option a -> ShowS #show :: Option a -> String #showList :: [Option a] -> ShowS # Show a => Show (NonEmpty a) MethodsshowsPrec :: Int -> NonEmpty a -> ShowS #show :: NonEmpty a -> String #showList :: [NonEmpty a] -> ShowS # Show a => Show (ZipList a) MethodsshowsPrec :: Int -> ZipList a -> ShowS #show :: ZipList a -> String #showList :: [ZipList a] -> ShowS # MethodsshowsPrec :: Int -> ForeignPtr a -> ShowS #show :: ForeignPtr a -> String #showList :: [ForeignPtr a] -> ShowS # Show a => Show (Dual a) MethodsshowsPrec :: Int -> Dual a -> ShowS #show :: Dual a -> String #showList :: [Dual a] -> ShowS # Show a => Show (Sum a) MethodsshowsPrec :: Int -> Sum a -> ShowS #show :: Sum a -> String #showList :: [Sum a] -> ShowS # Show a => Show (Product a) MethodsshowsPrec :: Int -> Product a -> ShowS #show :: Product a -> String #showList :: [Product a] -> ShowS # Show a => Show (First a) MethodsshowsPrec :: Int -> First a -> ShowS #show :: First a -> String #showList :: [First a] -> ShowS # Show a => Show (Last a) MethodsshowsPrec :: Int -> Last a -> ShowS #show :: Last a -> String #showList :: [Last a] -> ShowS # Show a => Show (BE a) # MethodsshowsPrec :: Int -> BE a -> ShowS #show :: BE a -> String #showList :: [BE a] -> ShowS # Show a => Show (LE a) # MethodsshowsPrec :: Int -> LE a -> ShowS #show :: LE a -> String #showList :: [LE a] -> ShowS # Show (FinalPtr a) # MethodsshowsPrec :: Int -> FinalPtr a -> ShowS #show :: FinalPtr a -> String #showList :: [FinalPtr a] -> ShowS # Show (CountOf ty) # MethodsshowsPrec :: Int -> CountOf ty -> ShowS #show :: CountOf ty -> String #showList :: [CountOf ty] -> ShowS # Show (Offset ty) # MethodsshowsPrec :: Int -> Offset ty -> ShowS #show :: Offset ty -> String #showList :: [Offset ty] -> ShowS # Show a => Show (NonEmpty a) # MethodsshowsPrec :: Int -> NonEmpty a -> ShowS #show :: NonEmpty a -> String #showList :: [NonEmpty a] -> ShowS # Show (Zn n) # MethodsshowsPrec :: Int -> Zn n -> ShowS #show :: Zn n -> String #showList :: [Zn n] -> ShowS # Show (Zn64 n) # MethodsshowsPrec :: Int -> Zn64 n -> ShowS #show :: Zn64 n -> String #showList :: [Zn64 n] -> ShowS # (PrimType ty, Show ty) => Show (Block ty) # MethodsshowsPrec :: Int -> Block ty -> ShowS #show :: Block ty -> String #showList :: [Block ty] -> ShowS # (PrimType ty, Show ty) => Show (UArray ty) # MethodsshowsPrec :: Int -> UArray ty -> ShowS #show :: UArray ty -> String #showList :: [UArray ty] -> ShowS # Show a => Show (Array a) # MethodsshowsPrec :: Int -> Array a -> ShowS #show :: Array a -> String #showList :: [Array a] -> ShowS # (Show b, Show a) => Show (Either a b) MethodsshowsPrec :: Int -> Either a b -> ShowS #show :: Either a b -> String #showList :: [Either a b] -> ShowS # Show (f p) => Show (Rec1 f p) MethodsshowsPrec :: Int -> Rec1 f p -> ShowS #show :: Rec1 f p -> String #showList :: [Rec1 f p] -> ShowS # Show (URec Char p) MethodsshowsPrec :: Int -> URec Char p -> ShowS #show :: URec Char p -> String #showList :: [URec Char p] -> ShowS # MethodsshowsPrec :: Int -> URec Double p -> ShowS #show :: URec Double p -> String #showList :: [URec Double p] -> ShowS # MethodsshowsPrec :: Int -> URec Float p -> ShowS #show :: URec Float p -> String #showList :: [URec Float p] -> ShowS # Show (URec Int p) MethodsshowsPrec :: Int -> URec Int p -> ShowS #show :: URec Int p -> String #showList :: [URec Int p] -> ShowS # Show (URec Word p) MethodsshowsPrec :: Int -> URec Word p -> ShowS #show :: URec Word p -> String #showList :: [URec Word p] -> ShowS # (Show a, Show b) => Show (a, b) MethodsshowsPrec :: Int -> (a, b) -> ShowS #show :: (a, b) -> String #showList :: [(a, b)] -> ShowS # (Show b, Show a) => Show (Arg a b) MethodsshowsPrec :: Int -> Arg a b -> ShowS #show :: Arg a b -> String #showList :: [Arg a b] -> ShowS # Show (Proxy k s) MethodsshowsPrec :: Int -> Proxy k s -> ShowS #show :: Proxy k s -> String #showList :: [Proxy k s] -> ShowS # Show (ST s a) MethodsshowsPrec :: Int -> ST s a -> ShowS #show :: ST s a -> String #showList :: [ST s a] -> ShowS # (Show b, Show a) => Show (These a b) # MethodsshowsPrec :: Int -> These a b -> ShowS #show :: These a b -> String #showList :: [These a b] -> ShowS # Show a => Show (ListN n a) # MethodsshowsPrec :: Int -> ListN n a -> ShowS #show :: ListN n a -> String #showList :: [ListN n a] -> ShowS # (Show a, PrimType a) => Show (BlockN n a) # MethodsshowsPrec :: Int -> BlockN n a -> ShowS #show :: BlockN n a -> String #showList :: [BlockN n a] -> ShowS # Show a => Show (Vect n a) # MethodsshowsPrec :: Int -> Vect n a -> ShowS #show :: Vect n a -> String #showList :: [Vect n a] -> ShowS # (Show a, PrimType a) => Show (UVect n a) # MethodsshowsPrec :: Int -> UVect n a -> ShowS #show :: UVect n a -> String #showList :: [UVect n a] -> ShowS # Show c => Show (K1 i c p) MethodsshowsPrec :: Int -> K1 i c p -> ShowS #show :: K1 i c p -> String #showList :: [K1 i c p] -> ShowS # (Show (g p), Show (f p)) => Show ((:+:) f g p) MethodsshowsPrec :: Int -> (f :+: g) p -> ShowS #show :: (f :+: g) p -> String #showList :: [(f :+: g) p] -> ShowS # (Show (g p), Show (f p)) => Show ((:*:) f g p) MethodsshowsPrec :: Int -> (f :*: g) p -> ShowS #show :: (f :*: g) p -> String #showList :: [(f :*: g) p] -> ShowS # Show (f (g p)) => Show ((:.:) f g p) MethodsshowsPrec :: Int -> (f :.: g) p -> ShowS #show :: (f :.: g) p -> String #showList :: [(f :.: g) p] -> ShowS # (Show a, Show b, Show c) => Show (a, b, c) MethodsshowsPrec :: Int -> (a, b, c) -> ShowS #show :: (a, b, c) -> String #showList :: [(a, b, c)] -> ShowS # Show a => Show (Const k a b) This instance would be equivalent to the derived instances of the Const newtype if the runConst field were removed MethodsshowsPrec :: Int -> Const k a b -> ShowS #show :: Const k a b -> String #showList :: [Const k a b] -> ShowS # Show (f a) => Show (Alt k f a) MethodsshowsPrec :: Int -> Alt k f a -> ShowS #show :: Alt k f a -> String #showList :: [Alt k f a] -> ShowS # Show ((:~:) k a b) MethodsshowsPrec :: Int -> (k :~: a) b -> ShowS #show :: (k :~: a) b -> String #showList :: [(k :~: a) b] -> ShowS # Show (f p) => Show (M1 i c f p) MethodsshowsPrec :: Int -> M1 i c f p -> ShowS #show :: M1 i c f p -> String #showList :: [M1 i c f p] -> ShowS # (Show a, Show b, Show c, Show d) => Show (a, b, c, d) MethodsshowsPrec :: Int -> (a, b, c, d) -> ShowS #show :: (a, b, c, d) -> String #showList :: [(a, b, c, d)] -> ShowS # (Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) MethodsshowsPrec :: Int -> (a, b, c, d, e) -> ShowS #show :: (a, b, c, d, e) -> String #showList :: [(a, b, c, d, e)] -> ShowS # (Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) MethodsshowsPrec :: 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) MethodsshowsPrec :: 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) MethodsshowsPrec :: 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) MethodsshowsPrec :: 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) MethodsshowsPrec :: 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) MethodsshowsPrec :: 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) MethodsshowsPrec :: 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) MethodsshowsPrec :: 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) MethodsshowsPrec :: 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) MethodsshowsPrec :: Int -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> ShowS #show :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> String #showList :: [(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)] -> ShowS #

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

Use the Show class to create a String.

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

class Eq a => Ord a where #

The Ord class is used for totally ordered datatypes.

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

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

Minimal complete definition

Methods

compare :: a -> a -> Ordering #

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

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

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

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

max :: a -> a -> a #

min :: a -> a -> a #

Instances

class Eq a where #

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

Minimal complete definition: either == or /=.

Minimal complete definition

Methods

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

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

Instances

 Methods(==) :: Bool -> Bool -> Bool #(/=) :: Bool -> Bool -> Bool # Methods(==) :: Char -> Char -> Bool #(/=) :: Char -> Char -> Bool # Methods(==) :: Double -> Double -> Bool #(/=) :: Double -> Double -> Bool # Methods(==) :: Float -> Float -> Bool #(/=) :: Float -> Float -> Bool # Methods(==) :: Int -> Int -> Bool #(/=) :: Int -> Int -> Bool # Methods(==) :: Int8 -> Int8 -> Bool #(/=) :: Int8 -> Int8 -> Bool # Methods(==) :: Int16 -> Int16 -> Bool #(/=) :: Int16 -> Int16 -> Bool # Methods(==) :: Int32 -> Int32 -> Bool #(/=) :: Int32 -> Int32 -> Bool # Methods(==) :: Int64 -> Int64 -> Bool #(/=) :: Int64 -> Int64 -> Bool # Methods(==) :: Integer -> Integer -> Bool #(/=) :: Integer -> Integer -> Bool # Methods Methods(==) :: Word -> Word -> Bool #(/=) :: Word -> Word -> Bool # Methods(==) :: Word8 -> Word8 -> Bool #(/=) :: Word8 -> Word8 -> Bool # Methods(==) :: Word16 -> Word16 -> Bool #(/=) :: Word16 -> Word16 -> Bool # Methods(==) :: Word32 -> Word32 -> Bool #(/=) :: Word32 -> Word32 -> Bool # Methods(==) :: Word64 -> Word64 -> Bool #(/=) :: Word64 -> Word64 -> Bool # Methods(==) :: TypeRep -> TypeRep -> Bool #(/=) :: TypeRep -> TypeRep -> Bool # Eq () Methods(==) :: () -> () -> Bool #(/=) :: () -> () -> Bool # Methods(==) :: TyCon -> TyCon -> Bool #(/=) :: TyCon -> TyCon -> Bool # Methods(==) :: BigNat -> BigNat -> Bool #(/=) :: BigNat -> BigNat -> Bool # Methods Methods(==) :: Natural -> Natural -> Bool #(/=) :: Natural -> Natural -> Bool # Methods(==) :: Void -> Void -> Bool #(/=) :: Void -> Void -> Bool # Equality of constructors Methods(==) :: Constr -> Constr -> Bool #(/=) :: Constr -> Constr -> Bool # Methods(==) :: DataRep -> DataRep -> Bool #(/=) :: DataRep -> DataRep -> Bool # Methods Methods(==) :: Fixity -> Fixity -> Bool #(/=) :: Fixity -> Fixity -> Bool # Methods(==) :: Version -> Version -> Bool #(/=) :: Version -> Version -> Bool # Methods(==) :: CDev -> CDev -> Bool #(/=) :: CDev -> CDev -> Bool # Methods(==) :: CIno -> CIno -> Bool #(/=) :: CIno -> CIno -> Bool # Methods(==) :: CMode -> CMode -> Bool #(/=) :: CMode -> CMode -> Bool # Methods(==) :: COff -> COff -> Bool #(/=) :: COff -> COff -> Bool # Methods(==) :: CPid -> CPid -> Bool #(/=) :: CPid -> CPid -> Bool # Methods(==) :: CSsize -> CSsize -> Bool #(/=) :: CSsize -> CSsize -> Bool # Methods(==) :: CGid -> CGid -> Bool #(/=) :: CGid -> CGid -> Bool # Methods(==) :: CNlink -> CNlink -> Bool #(/=) :: CNlink -> CNlink -> Bool # Methods(==) :: CUid -> CUid -> Bool #(/=) :: CUid -> CUid -> Bool # Methods(==) :: CCc -> CCc -> Bool #(/=) :: CCc -> CCc -> Bool # Methods(==) :: CSpeed -> CSpeed -> Bool #(/=) :: CSpeed -> CSpeed -> Bool # Methods(==) :: CTcflag -> CTcflag -> Bool #(/=) :: CTcflag -> CTcflag -> Bool # Methods(==) :: CRLim -> CRLim -> Bool #(/=) :: CRLim -> CRLim -> Bool # Methods(==) :: Fd -> Fd -> Bool #(/=) :: Fd -> Fd -> Bool # Methods Methods Methods Methods Methods(==) :: WordPtr -> WordPtr -> Bool #(/=) :: WordPtr -> WordPtr -> Bool # Methods(==) :: IntPtr -> IntPtr -> Bool #(/=) :: IntPtr -> IntPtr -> Bool # Methods(==) :: CChar -> CChar -> Bool #(/=) :: CChar -> CChar -> Bool # Methods(==) :: CSChar -> CSChar -> Bool #(/=) :: CSChar -> CSChar -> Bool # Methods(==) :: CUChar -> CUChar -> Bool #(/=) :: CUChar -> CUChar -> Bool # Methods(==) :: CShort -> CShort -> Bool #(/=) :: CShort -> CShort -> Bool # Methods(==) :: CUShort -> CUShort -> Bool #(/=) :: CUShort -> CUShort -> Bool # Methods(==) :: CInt -> CInt -> Bool #(/=) :: CInt -> CInt -> Bool # Methods(==) :: CUInt -> CUInt -> Bool #(/=) :: CUInt -> CUInt -> Bool # Methods(==) :: CLong -> CLong -> Bool #(/=) :: CLong -> CLong -> Bool # Methods(==) :: CULong -> CULong -> Bool #(/=) :: CULong -> CULong -> Bool # Methods(==) :: CLLong -> CLLong -> Bool #(/=) :: CLLong -> CLLong -> Bool # Methods(==) :: CULLong -> CULLong -> Bool #(/=) :: CULLong -> CULLong -> Bool # Methods(==) :: CFloat -> CFloat -> Bool #(/=) :: CFloat -> CFloat -> Bool # Methods(==) :: CDouble -> CDouble -> Bool #(/=) :: CDouble -> CDouble -> Bool # Methods Methods(==) :: CSize -> CSize -> Bool #(/=) :: CSize -> CSize -> Bool # Methods(==) :: CWchar -> CWchar -> Bool #(/=) :: CWchar -> CWchar -> Bool # Methods Methods(==) :: CClock -> CClock -> Bool #(/=) :: CClock -> CClock -> Bool # Methods(==) :: CTime -> CTime -> Bool #(/=) :: CTime -> CTime -> Bool # Methods Methods Methods(==) :: CIntPtr -> CIntPtr -> Bool #(/=) :: CIntPtr -> CIntPtr -> Bool # Methods Methods(==) :: CIntMax -> CIntMax -> Bool #(/=) :: CIntMax -> CIntMax -> Bool # Methods Methods(==) :: All -> All -> Bool #(/=) :: All -> All -> Bool # Methods(==) :: Any -> Any -> Bool #(/=) :: Any -> Any -> Bool # Methods(==) :: Fixity -> Fixity -> Bool #(/=) :: Fixity -> Fixity -> Bool # Methods Methods Methods Methods Methods Methods Methods Methods Methods(==) :: SomeNat -> SomeNat -> Bool #(/=) :: SomeNat -> SomeNat -> Bool # Methods Methods Methods(==) :: SrcLoc -> SrcLoc -> Bool #(/=) :: SrcLoc -> SrcLoc -> Bool # # Methods # Methods # Methods(==) :: Char7 -> Char7 -> Bool #(/=) :: Char7 -> Char7 -> Bool # # Methods(==) :: Word128 -> Word128 -> Bool #(/=) :: Word128 -> Word128 -> Bool # # Methods(==) :: Word256 -> Word256 -> Bool #(/=) :: Word256 -> Word256 -> Bool # # Methods # Methods # Methods # Methods # Methods(==) :: Addr -> Addr -> Bool #(/=) :: Addr -> Addr -> Bool # # Methods # Methods # Methods(==) :: String -> String -> Bool #(/=) :: String -> String -> Bool # # Methods Eq a => Eq [a] Methods(==) :: [a] -> [a] -> Bool #(/=) :: [a] -> [a] -> Bool # Eq a => Eq (Maybe a) Methods(==) :: Maybe a -> Maybe a -> Bool #(/=) :: Maybe a -> Maybe a -> Bool # Eq a => Eq (Ratio a) Methods(==) :: Ratio a -> Ratio a -> Bool #(/=) :: Ratio a -> Ratio a -> Bool # Eq (Ptr a) Methods(==) :: Ptr a -> Ptr a -> Bool #(/=) :: Ptr a -> Ptr a -> Bool # Eq (FunPtr a) Methods(==) :: FunPtr a -> FunPtr a -> Bool #(/=) :: FunPtr a -> FunPtr a -> Bool # Eq (V1 p) Methods(==) :: V1 p -> V1 p -> Bool #(/=) :: V1 p -> V1 p -> Bool # Eq (U1 p) Methods(==) :: U1 p -> U1 p -> Bool #(/=) :: U1 p -> U1 p -> Bool # Eq p => Eq (Par1 p) Methods(==) :: Par1 p -> Par1 p -> Bool #(/=) :: Par1 p -> Par1 p -> Bool # Eq a => Eq (Identity a) Methods(==) :: Identity a -> Identity a -> Bool #(/=) :: Identity a -> Identity a -> Bool # Eq a => Eq (Min a) Methods(==) :: Min a -> Min a -> Bool #(/=) :: Min a -> Min a -> Bool # Eq a => Eq (Max a) Methods(==) :: Max a -> Max a -> Bool #(/=) :: Max a -> Max a -> Bool # Eq a => Eq (First a) Methods(==) :: First a -> First a -> Bool #(/=) :: First a -> First a -> Bool # Eq a => Eq (Last a) Methods(==) :: Last a -> Last a -> Bool #(/=) :: Last a -> Last a -> Bool # Eq m => Eq (WrappedMonoid m) Methods(==) :: WrappedMonoid m -> WrappedMonoid m -> Bool #(/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # Eq a => Eq (Option a) Methods(==) :: Option a -> Option a -> Bool #(/=) :: Option a -> Option a -> Bool # Eq a => Eq (NonEmpty a) Methods(==) :: NonEmpty a -> NonEmpty a -> Bool #(/=) :: NonEmpty a -> NonEmpty a -> Bool # Eq a => Eq (ZipList a) Methods(==) :: ZipList a -> ZipList a -> Bool #(/=) :: ZipList a -> ZipList a -> Bool # Eq (ForeignPtr a) Methods(==) :: ForeignPtr a -> ForeignPtr a -> Bool #(/=) :: ForeignPtr a -> ForeignPtr a -> Bool # Eq a => Eq (Dual a) Methods(==) :: Dual a -> Dual a -> Bool #(/=) :: Dual a -> Dual a -> Bool # Eq a => Eq (Sum a) Methods(==) :: Sum a -> Sum a -> Bool #(/=) :: Sum a -> Sum a -> Bool # Eq a => Eq (Product a) Methods(==) :: Product a -> Product a -> Bool #(/=) :: Product a -> Product a -> Bool # Eq a => Eq (First a) Methods(==) :: First a -> First a -> Bool #(/=) :: First a -> First a -> Bool # Eq a => Eq (Last a) Methods(==) :: Last a -> Last a -> Bool #(/=) :: Last a -> Last a -> Bool # Eq (IORef a) Methods(==) :: IORef a -> IORef a -> Bool #(/=) :: IORef a -> IORef a -> Bool # Eq a => Eq (BE a) # Methods(==) :: BE a -> BE a -> Bool #(/=) :: BE a -> BE a -> Bool # Eq a => Eq (LE a) # Methods(==) :: LE a -> LE a -> Bool #(/=) :: LE a -> LE a -> Bool # Eq (FinalPtr a) # Methods(==) :: FinalPtr a -> FinalPtr a -> Bool #(/=) :: FinalPtr a -> FinalPtr a -> Bool # Eq (CountOf ty) # Methods(==) :: CountOf ty -> CountOf ty -> Bool #(/=) :: CountOf ty -> CountOf ty -> Bool # Eq (Offset ty) # Methods(==) :: Offset ty -> Offset ty -> Bool #(/=) :: Offset ty -> Offset ty -> Bool # Eq a => Eq (NonEmpty a) # Methods(==) :: NonEmpty a -> NonEmpty a -> Bool #(/=) :: NonEmpty a -> NonEmpty a -> Bool # Eq (Zn n) # Methods(==) :: Zn n -> Zn n -> Bool #(/=) :: Zn n -> Zn n -> Bool # Eq (Zn64 n) # Methods(==) :: Zn64 n -> Zn64 n -> Bool #(/=) :: Zn64 n -> Zn64 n -> Bool # (PrimType ty, Eq ty) => Eq (Block ty) # Methods(==) :: Block ty -> Block ty -> Bool #(/=) :: Block ty -> Block ty -> Bool # (PrimType ty, Eq ty) => Eq (UArray ty) # Methods(==) :: UArray ty -> UArray ty -> Bool #(/=) :: UArray ty -> UArray ty -> Bool # Eq a => Eq (Array a) # Methods(==) :: Array a -> Array a -> Bool #(/=) :: Array a -> Array a -> Bool # (Eq b, Eq a) => Eq (Either a b) Methods(==) :: Either a b -> Either a b -> Bool #(/=) :: Either a b -> Either a b -> Bool # Eq (f p) => Eq (Rec1 f p) Methods(==) :: Rec1 f p -> Rec1 f p -> Bool #(/=) :: Rec1 f p -> Rec1 f p -> Bool # Eq (URec Char p) Methods(==) :: URec Char p -> URec Char p -> Bool #(/=) :: URec Char p -> URec Char p -> Bool # Eq (URec Double p) Methods(==) :: URec Double p -> URec Double p -> Bool #(/=) :: URec Double p -> URec Double p -> Bool # Eq (URec Float p) Methods(==) :: URec Float p -> URec Float p -> Bool #(/=) :: URec Float p -> URec Float p -> Bool # Eq (URec Int p) Methods(==) :: URec Int p -> URec Int p -> Bool #(/=) :: URec Int p -> URec Int p -> Bool # Eq (URec Word p) Methods(==) :: URec Word p -> URec Word p -> Bool #(/=) :: URec Word p -> URec Word p -> Bool # Eq (URec (Ptr ()) p) Methods(==) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool #(/=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (Eq a, Eq b) => Eq (a, b) Methods(==) :: (a, b) -> (a, b) -> Bool #(/=) :: (a, b) -> (a, b) -> Bool # Eq a => Eq (Arg a b) Methods(==) :: Arg a b -> Arg a b -> Bool #(/=) :: Arg a b -> Arg a b -> Bool # Eq (Proxy k s) Methods(==) :: Proxy k s -> Proxy k s -> Bool #(/=) :: Proxy k s -> Proxy k s -> Bool # Eq (STRef s a) Methods(==) :: STRef s a -> STRef s a -> Bool #(/=) :: STRef s a -> STRef s a -> Bool # (Eq b, Eq a) => Eq (These a b) # Methods(==) :: These a b -> These a b -> Bool #(/=) :: These a b -> These a b -> Bool # Eq a => Eq (ListN n a) # Methods(==) :: ListN n a -> ListN n a -> Bool #(/=) :: ListN n a -> ListN n a -> Bool # PrimType a => Eq (BlockN n a) # Methods(==) :: BlockN n a -> BlockN n a -> Bool #(/=) :: BlockN n a -> BlockN n a -> Bool # Eq a => Eq (Vect n a) # Methods(==) :: Vect n a -> Vect n a -> Bool #(/=) :: Vect n a -> Vect n a -> Bool # PrimType a => Eq (UVect n a) # Methods(==) :: UVect n a -> UVect n a -> Bool #(/=) :: UVect n a -> UVect n a -> Bool # Eq c => Eq (K1 i c p) Methods(==) :: K1 i c p -> K1 i c p -> Bool #(/=) :: K1 i c p -> K1 i c p -> Bool # (Eq (g p), Eq (f p)) => Eq ((:+:) f g p) Methods(==) :: (f :+: g) p -> (f :+: g) p -> Bool #(/=) :: (f :+: g) p -> (f :+: g) p -> Bool # (Eq (g p), Eq (f p)) => Eq ((:*:) f g p) Methods(==) :: (f :*: g) p -> (f :*: g) p -> Bool #(/=) :: (f :*: g) p -> (f :*: g) p -> Bool # Eq (f (g p)) => Eq ((:.:) f g p) Methods(==) :: (f :.: g) p -> (f :.: g) p -> Bool #(/=) :: (f :.: g) p -> (f :.: g) p -> Bool # (Eq a, Eq b, Eq c) => Eq (a, b, c) Methods(==) :: (a, b, c) -> (a, b, c) -> Bool #(/=) :: (a, b, c) -> (a, b, c) -> Bool # Eq a => Eq (Const k a b) Methods(==) :: Const k a b -> Const k a b -> Bool #(/=) :: Const k a b -> Const k a b -> Bool # Eq (f a) => Eq (Alt k f a) Methods(==) :: Alt k f a -> Alt k f a -> Bool #(/=) :: Alt k f a -> Alt k f a -> Bool # Eq ((:~:) k a b) Methods(==) :: (k :~: a) b -> (k :~: a) b -> Bool #(/=) :: (k :~: a) b -> (k :~: a) b -> Bool # Eq (f p) => Eq (M1 i c f p) Methods(==) :: M1 i c f p -> M1 i c f p -> Bool #(/=) :: M1 i c f p -> M1 i c f p -> Bool # (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) Methods(==) :: (a, b, c, d) -> (a, b, c, d) -> Bool #(/=) :: (a, b, c, d) -> (a, b, c, d) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) Methods(==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool #(/=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) Methods(==) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool #(/=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) Methods(==) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool #(/=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h) => Eq (a, b, c, d, e, f, g, h) Methods(==) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool #(/=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i) => Eq (a, b, c, d, e, f, g, h, i) Methods(==) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j) => Eq (a, b, c, d, e, f, g, h, i, j) Methods(==) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k) => Eq (a, b, c, d, e, f, g, h, i, j, k) Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l) => Eq (a, b, c, d, e, f, g, h, i, j, k, l) Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m) Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n) Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g, Eq h, Eq i, Eq j, Eq k, Eq l, Eq m, Eq n, Eq o) => Eq (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) Methods(==) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #(/=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool #

class 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

Methods

minBound :: a #

maxBound :: a #

Instances

 Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Bounded () MethodsminBound :: () #maxBound :: () # Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods Methods # Methods # Methods # Methods Bounded a => Bounded (Identity a) Methods Bounded a => Bounded (Min a) MethodsminBound :: Min a #maxBound :: Min a # Bounded a => Bounded (Max a) MethodsminBound :: Max a #maxBound :: Max a # Bounded a => Bounded (First a) Methods Bounded a => Bounded (Last a) Methods Bounded a => Bounded (WrappedMonoid a) Methods Bounded a => Bounded (Dual a) Methods Bounded a => Bounded (Sum a) MethodsminBound :: Sum a #maxBound :: Sum a # Bounded a => Bounded (Product a) Methods (Bounded a, Bounded b) => Bounded (a, b) MethodsminBound :: (a, b) #maxBound :: (a, b) # Bounded (Proxy k s) MethodsminBound :: Proxy k s #maxBound :: Proxy k s # (Bounded a, Bounded b, Bounded c) => Bounded (a, b, c) MethodsminBound :: (a, b, c) #maxBound :: (a, b, c) # Bounded a => Bounded (Const k a b) MethodsminBound :: Const k a b #maxBound :: Const k a b # (~) k a b => Bounded ((:~:) k a b) MethodsminBound :: (k :~: a) b #maxBound :: (k :~: a) b # (Bounded a, Bounded b, Bounded c, Bounded d) => Bounded (a, b, c, d) MethodsminBound :: (a, b, c, d) #maxBound :: (a, b, c, d) # (Bounded a, Bounded b, Bounded c, Bounded d, Bounded e) => Bounded (a, b, c, d, e) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (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) MethodsminBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #maxBound :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) #

class Enum a where #

Class Enum defines operations on sequentially ordered types.

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

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

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

• 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
| otherwise                = minBound

Minimal complete definition

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