License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Basement.Imports
Description
re-export of all the base prelude and basic primitive stuffs
Synopsis
- ($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- ($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- (&&) :: Bool -> Bool -> Bool
- (||) :: Bool -> Bool -> Bool
- (.) :: forall (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c
- (<$>) :: Functor f => (a -> b) -> f a -> f b
- not :: Bool -> Bool
- otherwise :: Bool
- fst :: (a, b) -> a
- snd :: (a, b) -> b
- id :: forall (a :: k). Category cat => cat a a
- maybe :: b -> (a -> b) -> Maybe a -> b
- either :: (a -> c) -> (b -> c) -> Either a b -> c
- flip :: (a -> b -> c) -> b -> a -> c
- const :: a -> b -> a
- error :: forall (r :: RuntimeRep). forall (a :: TYPE r). HasCallStack => String -> a
- and :: Foldable t => t Bool -> Bool
- undefined :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => a
- seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b
- class Show a
- show :: Show a => a -> String
- class Eq a => Ord a where
- class Eq a where
- class Bounded a where
- class Enum a where
- succ :: a -> a
- pred :: a -> a
- toEnum :: Int -> a
- fromEnum :: a -> Int
- enumFrom :: a -> [a]
- enumFromThen :: a -> a -> [a]
- enumFromTo :: a -> a -> [a]
- enumFromThenTo :: a -> a -> a -> [a]
- class Functor (f :: Type -> Type) where
- class Functor f => Applicative (f :: Type -> Type) where
- class Applicative m => Monad (m :: Type -> Type) where
- when :: Applicative f => Bool -> f () -> f ()
- unless :: Applicative f => Bool -> f () -> f ()
- data Maybe a
- data Ordering
- data Bool
- data Int
- data Integer
- data Natural
- data Offset ty
- data CountOf ty
- data Char
- class Eq ty => PrimType ty
- data Char7
- data AsciiString
- data String
- data UArray ty
- data Array a
- class Integral a where
- fromInteger :: Integer -> a
- class Fractional a where
- fromRational :: Rational -> a
- class HasNegation a where
- negate :: a -> a
- data Int8
- data Int16
- data Int32
- data Int64
- data Word8
- data Word16
- data Word32
- data Word64
- data Word
- data Double
- data Float
- data IO a
- type FP32 = Float
- type FP64 = Double
- class IsList l where
- class IsString a where
- fromString :: String -> a
- class Generic a where
- data Either a b
- class Typeable a => Data a where
- gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> a -> c a
- gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c a
- toConstr :: a -> Constr
- dataTypeOf :: a -> DataType
- dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c a)
- dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a)
- gmapT :: (forall b. Data b => b -> b) -> a -> a
- gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
- gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r
- gmapQ :: (forall d. Data d => d -> u) -> a -> [u]
- gmapQi :: Int -> (forall d. Data d => d -> u) -> a -> u
- gmapM :: Monad m => (forall d. Data d => d -> m d) -> a -> m a
- gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a
- gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> a -> m a
- mkNoRepType :: String -> DataType
- data DataType
- class Typeable (a :: k)
- class Semigroup a => Monoid a where
- class Semigroup a where
- class (Typeable e, Show e) => Exception e
- throw :: forall (r :: RuntimeRep) (a :: TYPE r) e. Exception e => e -> a
- throwIO :: Exception e => e -> IO a
- data Ptr a = Ptr Addr#
- ifThenElse :: Bool -> a -> a -> a
Documentation
($) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b infixr 0 Source #
Application operator. This operator is redundant, since ordinary
application (f x)
means the same as (f
. However, $
x)$
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
,
or map
($
0) xs
.zipWith
($
) fs xs
Note that (
is levity-polymorphic in its result type, so that
$
)foo
where $
Truefoo :: Bool -> Int#
is well-typed.
($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b infixr 0 Source #
Strict (call-by-value) application operator. It takes a function and an argument, evaluates the argument to weak head normal form (WHNF), then calls the function with that value.
(.) :: forall (b :: k) (c :: k) (a :: k). Category cat => cat b c -> cat a b -> cat a c infixr 9 Source #
morphism composition
(<$>) :: Functor f => (a -> b) -> f a -> f b infixl 4 Source #
An infix synonym for fmap
.
The name of this operator is an allusion to $
.
Note the similarities between their types:
($) :: (a -> b) -> a -> b (<$>) :: Functor f => (a -> b) -> f a -> f b
Whereas $
is function application, <$>
is function
application lifted over a Functor
.
Examples
Convert from a
to a Maybe
Int
using Maybe
String
show
:
>>>
show <$> Nothing
Nothing>>>
show <$> Just 3
Just "3"
Convert from an
to an
Either
Int
Int
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)
maybe :: b -> (a -> b) -> Maybe a -> b Source #
The maybe
function takes a default value, a function, and a Maybe
value. If the Maybe
value is Nothing
, the function returns the
default value. Otherwise, it applies the function to the value inside
the Just
and returns the result.
Examples
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 Source #
Case analysis for the Either
type.
If the value is
, apply the first function to Left
aa
;
if it is
, apply the second function to Right
bb
.
Examples
We create two values of type
, one using the
Either
String
Int
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 Source #
takes its (first) two arguments in the reverse order of flip
ff
.
>>>
flip (++) "hello" "world"
"worldhello"
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]
error :: forall (r :: RuntimeRep). forall (a :: TYPE r). HasCallStack => String -> a Source #
stop execution and displays an error message
undefined :: forall (r :: RuntimeRep) (a :: TYPE r). HasCallStack => a Source #
seq :: forall (r :: RuntimeRep) a (b :: TYPE r). a -> b -> b infixr 0 Source #
The value of seq a b
is bottom if a
is bottom, and
otherwise equal to b
. In other words, it evaluates the first
argument a
to weak head normal form (WHNF). seq
is usually
introduced to improve performance by avoiding unneeded laziness.
A note on evaluation order: the expression seq a b
does
not guarantee that a
will be evaluated before b
.
The only guarantee given by seq
is that the both a
and b
will be evaluated before seq
returns a value.
In particular, this means that b
may be evaluated before
a
. If you need to guarantee a specific order of evaluation,
you must use the function pseq
from the "parallel" package.
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 thand
(associativity is ignored). Thus, ifd
is0
then the result is never surrounded in parentheses; ifd
is11
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,
produces the stringshow
(Leaf 1 :^: Leaf 2 :^: Leaf 3)"Leaf 1 :^: (Leaf 2 :^: Leaf 3)"
.
Instances
Show Bool | Since: base-2.1 |
Show Char | Since: base-2.1 |
Show Int | Since: base-2.1 |
Show Int8 | Since: base-2.1 |
Show Int16 | Since: base-2.1 |
Show Int32 | Since: base-2.1 |
Show Int64 | Since: base-2.1 |
Show Integer | Since: base-2.1 |
Show Natural | Since: base-4.8.0.0 |
Show Ordering | Since: base-2.1 |
Show Word | Since: base-2.1 |
Show Word8 | Since: base-2.1 |
Show Word16 | Since: base-2.1 |
Show Word32 | Since: base-2.1 |
Show Word64 | Since: base-2.1 |
Show RuntimeRep | Since: base-4.11.0.0 |
Show VecCount | Since: base-4.11.0.0 |
Show VecElem | Since: base-4.11.0.0 |
Show CallStack | Since: base-4.9.0.0 |
Show SomeTypeRep | Since: base-4.10.0.0 |
Defined in Data.Typeable.Internal | |
Show () | Since: base-2.1 |
Show TyCon | Since: base-2.1 |
Show Module | Since: base-4.9.0.0 |
Show TrName | Since: base-4.9.0.0 |
Show KindRep | |
Show TypeLitSort | Since: base-4.11.0.0 |
Show DataType | Since: base-4.0.0.0 |
Show Constr | Since: base-4.0.0.0 |
Show DataRep | Since: base-4.0.0.0 |
Show ConstrRep | Since: base-4.0.0.0 |
Show Fixity | Since: base-4.0.0.0 |
Show Version | Since: base-2.1 |
Show CDev | |
Show CIno | |
Show CMode | |
Show COff | |
Show CPid | |
Show CSsize | |
Show CGid | |
Show CNlink | |
Show CUid | |
Show CCc | |
Show CSpeed | |
Show CTcflag | |
Show CRLim | |
Show CBlkSize | |
Show CBlkCnt | |
Show CClockId | |
Show CFsBlkCnt | |
Show CFsFilCnt | |
Show CId | |
Show CKey | |
Show CTimer | |
Show CSocklen | |
Show CNfds | |
Show Fd | |
Show BlockedIndefinitelyOnMVar | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Show BlockedIndefinitelyOnSTM | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Show Deadlock | Since: base-4.1.0.0 |
Show AllocationLimitExceeded | Since: base-4.7.1.0 |
Defined in GHC.IO.Exception | |
Show CompactionFailed | Since: base-4.10.0.0 |
Defined in GHC.IO.Exception | |
Show AssertionFailed | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Show SomeAsyncException | Since: base-4.7.0.0 |
Defined in GHC.IO.Exception | |
Show AsyncException | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Show ArrayException | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Show FixIOException | Since: base-4.11.0.0 |
Defined in GHC.IO.Exception | |
Show ExitCode | |
Show IOErrorType | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Show MaskingState | Since: base-4.3.0.0 |
Show IOException | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
Show ErrorCall | Since: base-4.0.0.0 |
Show ArithException | Since: base-4.0.0.0 |
Defined in GHC.Exception.Type | |
Show All | Since: base-2.1 |
Show Any | Since: base-2.1 |
Show Fixity | Since: base-4.6.0.0 |
Show Associativity | Since: base-4.6.0.0 |
Defined in GHC.Generics | |
Show SourceUnpackedness | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Show SourceStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Show DecidedStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Show SomeSymbol | Since: base-4.7.0.0 |
Defined in GHC.TypeLits | |
Show SomeNat | Since: base-4.7.0.0 |
Show CChar | |
Show CSChar | |
Show CUChar | |
Show CShort | |
Show CUShort | |
Show CInt | |
Show CUInt | |
Show CLong | |
Show CULong | |
Show CLLong | |
Show CULLong | |
Show CBool | |
Show CFloat | |
Show CDouble | |
Show CPtrdiff | |
Show CSize | |
Show CWchar | |
Show CSigAtomic | |
Defined in Foreign.C.Types | |
Show CClock | |
Show CTime | |
Show CUSeconds | |
Show CSUSeconds | |
Defined in Foreign.C.Types | |
Show CIntPtr | |
Show CUIntPtr | |
Show CIntMax | |
Show CUIntMax | |
Show WordPtr | |
Show IntPtr | |
Show GeneralCategory | Since: base-2.1 |
Defined in GHC.Unicode | |
Show SrcLoc | Since: base-4.9.0.0 |
Show SomeException | Since: base-3.0 |
Defined in GHC.Exception.Type | |
Show Endianness Source # | |
Defined in Basement.Endianness | |
Show Char7 Source # | |
Show Word128 Source # | |
Show Word256 Source # | |
Show FileSize Source # | |
Show NonEmptyCollectionIsEmpty Source # | |
Defined in Basement.Exception | |
Show InvalidRecast Source # | |
Defined in Basement.Exception | |
Show RecastDestinationSize Source # | |
Defined in Basement.Exception | |
Show RecastSourceSize Source # | |
Defined in Basement.Exception | |
Show OutOfBound Source # | |
Defined in Basement.Exception | |
Show OutOfBoundOperation Source # | |
Defined in Basement.Exception | |
Show AsciiString Source # | |
Defined in Basement.Types.AsciiString | |
Show UTF32_Invalid Source # | |
Defined in Basement.String.Encoding.UTF32 | |
Show UTF16_Invalid Source # | |
Defined in Basement.String.Encoding.UTF16 | |
Show ISO_8859_1_Invalid Source # | |
Defined in Basement.String.Encoding.ISO_8859_1 | |
Show ASCII7_Invalid Source # | |
Defined in Basement.String.Encoding.ASCII7 | |
Show ValidationFailure Source # | |
Defined in Basement.UTF8.Types | |
Show String Source # | |
Show Encoding Source # | |
Show a => Show [a] | Since: base-2.1 |
Show a => Show (Maybe a) | Since: base-2.1 |
Show a => Show (Ratio a) | Since: base-2.0.1 |
Show (Ptr a) | Since: base-2.1 |
Show (FunPtr a) | Since: base-2.1 |
Show p => Show (Par1 p) | Since: base-4.7.0.0 |
Show a => Show (Min a) | Since: base-4.9.0.0 |
Show a => Show (Max a) | Since: base-4.9.0.0 |
Show a => Show (First a) | Since: base-4.9.0.0 |
Show a => Show (Last a) | Since: base-4.9.0.0 |
Show m => Show (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup | |
Show a => Show (Option a) | Since: base-4.9.0.0 |
Show a => Show (ZipList a) | Since: base-4.7.0.0 |
Show a => Show (Identity a) | This instance would be equivalent to the derived instances of the
Since: base-4.8.0.0 |
Show (ForeignPtr a) | Since: base-2.1 |
Defined in GHC.ForeignPtr | |
Show a => Show (First a) | Since: base-2.1 |
Show a => Show (Last a) | Since: base-2.1 |
Show a => Show (Dual a) | Since: base-2.1 |
Show a => Show (Sum a) | Since: base-2.1 |
Show a => Show (Product a) | Since: base-2.1 |
Show a => Show (Down a) | This instance would be equivalent to the derived instances of the
Since: base-4.7.0.0 |
Show a => Show (NonEmpty a) | Since: base-4.11.0.0 |
Show a => Show (BE a) Source # | |
Show a => Show (LE a) Source # | |
Show (FinalPtr a) Source # | |
Show (Zn n) Source # | |
Show (Zn64 n) Source # | |
Show (CountOf ty) Source # | |
Show (Offset ty) Source # | |
Show a => Show (NonEmpty a) Source # | |
(PrimType ty, Show ty) => Show (Block ty) Source # | |
Show (Bits n) Source # | |
(PrimType ty, Show ty) => Show (UArray ty) Source # | |
Show a => Show (Array a) Source # | |
(Show a, Show b) => Show (Either a b) | Since: base-3.0 |
Show (V1 p) | Since: base-4.9.0.0 |
Show (U1 p) | Since: base-4.9.0.0 |
Show (TypeRep a) | |
(Show a, Show b) => Show (a, b) | Since: base-2.1 |
(Show a, Show b) => Show (Arg a b) | Since: base-4.9.0.0 |
Show (Proxy s) | Since: base-4.7.0.0 |
(Ix a, Show a, Show b) => Show (Array a b) | Since: base-2.1 |
Show (ST s a) | Since: base-2.1 |
(Show a, Show b) => Show (These a b) Source # | |
Show a => Show (ListN n a) Source # | |
(PrimType a, Show a) => Show (BlockN n a) Source # | |
Show a => Show (Vect n a) Source # | |
(PrimType a, Show a) => Show (UVect n a) Source # | |
Show (f p) => Show (Rec1 f p) | Since: base-4.7.0.0 |
Show (URec Char p) | Since: base-4.9.0.0 |
Show (URec Double p) | Since: base-4.9.0.0 |
Show (URec Float p) | |
Show (URec Int p) | Since: base-4.9.0.0 |
Show (URec Word p) | Since: base-4.9.0.0 |
(Show a, Show b, Show c) => Show (a, b, c) | Since: base-2.1 |
Show a => Show (Const a b) | This instance would be equivalent to the derived instances of the
Since: base-4.8.0.0 |
Show (f a) => Show (Ap f a) | Since: base-4.12.0.0 |
Show (f a) => Show (Alt f a) | Since: base-4.8.0.0 |
Show (Coercion a b) | Since: base-4.7.0.0 |
Show (a :~: b) | Since: base-4.7.0.0 |
Show c => Show (K1 i c p) | Since: base-4.7.0.0 |
(Show (f p), Show (g p)) => Show ((f :+: g) p) | Since: base-4.7.0.0 |
(Show (f p), Show (g p)) => Show ((f :*: g) p) | Since: base-4.7.0.0 |
(Show a, Show b, Show c, Show d) => Show (a, b, c, d) | Since: base-2.1 |
Show (a :~~: b) | Since: base-4.10.0.0 |
Show (f p) => Show (M1 i c f p) | Since: base-4.7.0.0 |
Show (f (g p)) => Show ((f :.: g) p) | Since: base-4.7.0.0 |
(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e) | Since: base-2.1 |
(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) | Since: base-2.1 |
(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 |
(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 |
(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 |
(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 |
(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 |
(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 |
(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 |
(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 |
(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 |
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 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.
The Haskell Report defines no laws for Ord
. However, <=
is customarily
expected to implement a non-strict partial order and have the following
properties:
- Transitivity
- if
x <= y && y <= z
=True
, thenx <= z
=True
- Reflexivity
x <= x
=True
- Antisymmetry
- if
x <= y && y <= x
=True
, thenx == y
=True
Note that the following operator interactions are expected to hold:
x >= y
=y <= x
x < y
=x <= y && x /= y
x > y
=y < x
x < y
=compare x y == LT
x > y
=compare x y == GT
x == y
=compare x y == EQ
min x y == if x <= y then x else y
=True
max x y == if x >= y then x else y
=True
Note that (7.) and (8.) do not require min
and max
to return either of
their arguments. The result is merely required to equal one of the
arguments in terms of (==)
.
Minimal complete definition: either compare
or <=
.
Using compare
can be more efficient for complex types.
Methods
compare :: a -> a -> Ordering Source #
(<) :: a -> a -> Bool infix 4 Source #
(<=) :: a -> a -> Bool infix 4 Source #
(>) :: a -> a -> Bool infix 4 Source #