| Copyright | (c) 2016 Stephen Diehl (c) 2016-2018 Serokell (c) 2018-2023 Kowainik |
|---|---|
| License | MIT |
| Maintainer | Kowainik <xrom.xkov@gmail.com> |
| Stability | Stable |
| Portability | Portable |
| Safe Haskell | Trustworthy |
| Language | Haskell2010 |
Relude.Base
Description
Reexports from Data.* and GHC.* modules of
base package.
Synopsis
- data Char
- chr :: Int -> Char
- class Eq a where
- data Ordering
- class Eq a => Ord a where
- newtype Down a = Down {
- getDown :: a
- comparing :: Ord a => (b -> a) -> b -> b -> Ordering
- data IO a
- data IOMode
- type FilePath = String
- class a ~R# b => Coercible (a :: k) (b :: k)
- coerce :: forall {k :: RuntimeRep} (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b
- type Type = TYPE LiftedRep
- type Constraint = CONSTRAINT LiftedRep
- data Proxy (t :: k) = Proxy
- class a ~# b => (a :: k) ~ (b :: k)
- class Typeable (a :: k)
- data Void
- absurd :: Void -> a
- vacuous :: Functor f => f Void -> f a
- ord :: Char -> Int
- seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b
- ($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (a -> b) -> a -> b
- asTypeOf :: a -> a -> a
- class Generic a
- class Show a
- class KnownNat (n :: Nat)
- type family CmpNat (a :: Natural) (b :: Natural) :: Ordering where ...
- data SomeNat = KnownNat n => SomeNat (Proxy n)
- type Nat = Natural
- natVal :: forall (n :: Nat) proxy. KnownNat n => proxy n -> Natural
- someNatVal :: Natural -> SomeNat
- class IsLabel (x :: Symbol) a where
- fromLabel :: a
- getStackTrace :: IO (Maybe [Location])
- showStackTrace :: IO (Maybe String)
- data CallStack
- type HasCallStack = ?callStack :: CallStack
- callStack :: HasCallStack => CallStack
- getCallStack :: CallStack -> [([Char], SrcLoc)]
- currentCallStack :: IO [String]
- prettySrcLoc :: SrcLoc -> String
- prettyCallStack :: CallStack -> String
- withFrozenCallStack :: HasCallStack => (HasCallStack => a) -> a
Base types
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
| Data Char | Since: base-4.0.0.0 |
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 # 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 :: forall r r'. (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 # | |
| Bounded Char | Since: base-2.1 |
| Enum Char | Since: base-2.1 |
| Read Char | Since: base-2.1 |
| Show Char | Since: base-2.1 |
| NFData Char | |
Defined in Control.DeepSeq | |
| Eq Char | |
| Ord Char | |
| Hashable Char | |
Defined in Data.Hashable.Class | |
| ToLText String Source # | |
| ToString String Source # | |
| ToText String Source # | |
| TestCoercion SChar | Since: base-4.18.0.0 |
Defined in GHC.TypeLits | |
| TestEquality SChar | Since: base-4.18.0.0 |
Defined in GHC.TypeLits | |
| ConvertUtf8 String ByteString Source # | |
Defined in Relude.String.Conversion Methods encodeUtf8 :: String -> ByteString Source # decodeUtf8 :: ByteString -> String Source # decodeUtf8Strict :: ByteString -> Either UnicodeException String Source # | |
| ConvertUtf8 String ShortByteString Source # | Since: 0.6.0.0 |
Defined in Relude.String.Conversion Methods encodeUtf8 :: String -> ShortByteString Source # decodeUtf8 :: ShortByteString -> String Source # decodeUtf8Strict :: ShortByteString -> Either UnicodeException String Source # | |
| ConvertUtf8 String LByteString Source # | Converting |
Defined in Relude.String.Conversion Methods encodeUtf8 :: String -> LByteString Source # decodeUtf8 :: LByteString -> String Source # decodeUtf8Strict :: LByteString -> Either UnicodeException String Source # | |
| Lift Char | |
| Generic1 (URec Char :: k -> Type) | |
| Foldable (UChar :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Foldable Methods fold :: Monoid m => UChar m -> m # foldMap :: Monoid m => (a -> m) -> UChar a -> m # foldMap' :: Monoid m => (a -> m) -> UChar a -> m # foldr :: (a -> b -> b) -> b -> UChar a -> b # foldr' :: (a -> b -> b) -> b -> UChar a -> b # foldl :: (b -> a -> b) -> b -> UChar a -> b # foldl' :: (b -> a -> b) -> b -> UChar a -> b # foldr1 :: (a -> a -> a) -> UChar a -> a # foldl1 :: (a -> a -> a) -> UChar a -> a # elem :: Eq a => a -> UChar a -> Bool # maximum :: Ord a => UChar a -> a # minimum :: Ord a => UChar a -> a # | |
| Traversable (UChar :: Type -> Type) | Since: base-4.9.0.0 |
| Functor (URec Char :: Type -> Type) | Since: base-4.9.0.0 |
| Generic (URec Char p) | |
| Show (URec Char p) | Since: base-4.9.0.0 |
| Eq (URec Char p) | Since: base-4.9.0.0 |
| Ord (URec Char p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
| data URec Char (p :: k) | Used for marking occurrences of Since: base-4.9.0.0 |
| type Compare (a :: Char) (b :: Char) | |
Defined in Data.Type.Ord | |
| type Rep1 (URec Char :: k -> Type) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
| type Rep (URec Char p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
Base type classes
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.
The Haskell Report defines no laws for Eq. However, instances are
encouraged to follow these properties:
Instances
| Eq ByteArray | Since: base-4.17.0.0 |
| Eq Constr | Equality of constructors Since: base-4.0.0.0 |
| Eq ConstrRep | Since: base-4.0.0.0 |
| Eq DataRep | Since: base-4.0.0.0 |
| Eq Fixity | Since: base-4.0.0.0 |
| Eq All | Since: base-2.1 |
| Eq Any | Since: base-2.1 |
| Eq SomeTypeRep | |
Defined in Data.Typeable.Internal | |
| Eq Version | Since: base-2.1 |
| Eq Void | Since: base-4.8.0.0 |
| Eq BlockReason | Since: base-4.3.0.0 |
Defined in GHC.Conc.Sync | |
| Eq ThreadId | Since: base-4.2.0.0 |
| Eq ThreadStatus | Since: base-4.3.0.0 |
Defined in GHC.Conc.Sync | |
| Eq ErrorCall | Since: base-4.7.0.0 |
| Eq ArithException | Since: base-3.0 |
Defined in GHC.Exception.Type Methods (==) :: ArithException -> ArithException -> Bool # (/=) :: ArithException -> ArithException -> Bool # | |
| Eq SpecConstrAnnotation | Since: base-4.3.0.0 |
Defined in GHC.Exts Methods (==) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # (/=) :: SpecConstrAnnotation -> SpecConstrAnnotation -> Bool # | |
| Eq Associativity | Since: base-4.6.0.0 |
Defined in GHC.Generics Methods (==) :: Associativity -> Associativity -> Bool # (/=) :: Associativity -> Associativity -> Bool # | |
| Eq DecidedStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics Methods (==) :: DecidedStrictness -> DecidedStrictness -> Bool # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool # | |
| Eq Fixity | Since: base-4.6.0.0 |
| Eq SourceStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics Methods (==) :: SourceStrictness -> SourceStrictness -> Bool # (/=) :: SourceStrictness -> SourceStrictness -> Bool # | |
| Eq SourceUnpackedness | Since: base-4.9.0.0 |
Defined in GHC.Generics Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # | |
| Eq MaskingState | Since: base-4.3.0.0 |
Defined in GHC.IO | |
| Eq ArrayException | Since: base-4.2.0.0 |
Defined in GHC.IO.Exception Methods (==) :: ArrayException -> ArrayException -> Bool # (/=) :: ArrayException -> ArrayException -> Bool # | |
| Eq AsyncException | Since: base-4.2.0.0 |
Defined in GHC.IO.Exception Methods (==) :: AsyncException -> AsyncException -> Bool # (/=) :: AsyncException -> AsyncException -> Bool # | |
| Eq ExitCode | |
| Eq IOErrorType | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
| Eq IOException | Since: base-4.1.0.0 |
Defined in GHC.IO.Exception | |
| Eq HandlePosn | Since: base-4.1.0.0 |
Defined in GHC.IO.Handle | |
| Eq BufferMode | Since: base-4.2.0.0 |
Defined in GHC.IO.Handle.Types | |
| Eq Handle | Since: base-4.1.0.0 |
| Eq Newline | Since: base-4.2.0.0 |
| Eq NewlineMode | Since: base-4.2.0.0 |
Defined in GHC.IO.Handle.Types | |
| Eq IOMode | Since: base-4.2.0.0 |
| Eq Int16 | Since: base-2.1 |
| Eq Int32 | Since: base-2.1 |
| Eq Int64 | Since: base-2.1 |
| Eq Int8 | Since: base-2.1 |
| Eq IoSubSystem | |
Defined in GHC.RTS.Flags | |
| Eq SrcLoc | Since: base-4.9.0.0 |
| Eq SomeChar | |
| Eq SomeSymbol | Since: base-4.7.0.0 |
Defined in GHC.TypeLits | |
| Eq SomeNat | Since: base-4.7.0.0 |
| Eq Word16 | Since: base-2.1 |
| Eq Word32 | Since: base-2.1 |
| Eq Word64 | Since: base-2.1 |
| Eq Word8 | Since: base-2.1 |
| Eq Lexeme | Since: base-2.1 |
| Eq Number | Since: base-4.6.0.0 |
| Eq ByteString | |
Defined in Data.ByteString.Internal.Type | |
| Eq ByteString | |
Defined in Data.ByteString.Lazy.Internal | |
| Eq ShortByteString | |
Defined in Data.ByteString.Short.Internal Methods (==) :: ShortByteString -> ShortByteString -> Bool # (/=) :: ShortByteString -> ShortByteString -> Bool # | |
| Eq IntSet | |
| Eq OsChar | Byte equality of the internal representation. |
| Eq OsString | Byte equality of the internal representation. |
| Eq PosixChar | |
| Eq PosixString | |
Defined in System.OsString.Internal.Types | |
| Eq WindowsChar | |
Defined in System.OsString.Internal.Types | |
| Eq WindowsString | |
Defined in System.OsString.Internal.Types Methods (==) :: WindowsString -> WindowsString -> Bool # (/=) :: WindowsString -> WindowsString -> Bool # | |
| Eq ForeignSrcLang | |
Defined in GHC.ForeignSrcLang.Type Methods (==) :: ForeignSrcLang -> ForeignSrcLang -> Bool # (/=) :: ForeignSrcLang -> ForeignSrcLang -> Bool # | |
| Eq Extension | |
| Eq Module | |
| Eq Ordering | |
| Eq TrName | |
| Eq TyCon | |
| Eq Mode | |
| Eq Style | |
| Eq TextDetails | |
Defined in Text.PrettyPrint.Annotated.HughesPJ | |
| Eq Doc | |
| Eq Undefined Source # | |
| Eq AnnLookup | |
| Eq AnnTarget | |
| Eq Bang | |
| Eq Body | |
| Eq Bytes | |
| Eq Callconv | |
| Eq Clause | |
| Eq Con | |
| Eq Dec | |
| Eq DecidedStrictness | |
Defined in Language.Haskell.TH.Syntax Methods (==) :: DecidedStrictness -> DecidedStrictness -> Bool # (/=) :: DecidedStrictness -> DecidedStrictness -> Bool # | |
| Eq DerivClause | |
Defined in Language.Haskell.TH.Syntax | |
| Eq DerivStrategy | |
Defined in Language.Haskell.TH.Syntax Methods (==) :: DerivStrategy -> DerivStrategy -> Bool # (/=) :: DerivStrategy -> DerivStrategy -> Bool # | |
| Eq DocLoc | |
| Eq Exp | |
| Eq FamilyResultSig | |
Defined in Language.Haskell.TH.Syntax Methods (==) :: FamilyResultSig -> FamilyResultSig -> Bool # (/=) :: FamilyResultSig -> FamilyResultSig -> Bool # | |
| Eq Fixity | |
| Eq FixityDirection | |
Defined in Language.Haskell.TH.Syntax Methods (==) :: FixityDirection -> FixityDirection -> Bool # (/=) :: FixityDirection -> FixityDirection -> Bool # | |
| Eq Foreign | |
| Eq FunDep | |
| Eq Guard | |
| Eq Info | |
| Eq InjectivityAnn | |
Defined in Language.Haskell.TH.Syntax Methods (==) :: InjectivityAnn -> InjectivityAnn -> Bool # (/=) :: InjectivityAnn -> InjectivityAnn -> Bool # | |
| Eq Inline | |
| Eq Lit | |
| Eq Loc | |
| Eq Match | |
| Eq ModName | |
| Eq Module | |
| Eq ModuleInfo | |
Defined in Language.Haskell.TH.Syntax | |
| Eq Name | |
| Eq NameFlavour | |
Defined in Language.Haskell.TH.Syntax | |
| Eq NameSpace | |
| Eq OccName | |
| Eq Overlap | |
| Eq Pat | |
| Eq PatSynArgs | |
Defined in Language.Haskell.TH.Syntax | |
| Eq PatSynDir | |
| Eq Phases | |
| Eq PkgName | |
| Eq Pragma | |
| Eq Range | |
| Eq Role | |
| Eq RuleBndr | |
| Eq RuleMatch | |
| Eq Safety | |
| Eq SourceStrictness | |
Defined in Language.Haskell.TH.Syntax Methods (==) :: SourceStrictness -> SourceStrictness -> Bool # (/=) :: SourceStrictness -> SourceStrictness -> Bool # | |
| Eq SourceUnpackedness | |
Defined in Language.Haskell.TH.Syntax Methods (==) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (/=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # | |
| Eq Specificity | |
Defined in Language.Haskell.TH.Syntax | |
| Eq Stmt | |
| Eq TyLit | |
| Eq TySynEqn | |
| Eq Type | |
| Eq TypeFamilyHead | |
Defined in Language.Haskell.TH.Syntax Methods (==) :: TypeFamilyHead -> TypeFamilyHead -> Bool # (/=) :: TypeFamilyHead -> TypeFamilyHead -> Bool # | |
| Eq UnicodeException | |
Defined in Data.Text.Encoding.Error Methods (==) :: UnicodeException -> UnicodeException -> Bool # (/=) :: UnicodeException -> UnicodeException -> Bool # | |
| Eq Integer | |
| Eq Natural | |
| Eq () | |
| Eq Bool | |
| Eq Char | |
| Eq Double | Note that due to the presence of
Also note that
|
| Eq Float | Note that due to the presence of
Also note that
|
| Eq Int | |
| Eq Word | |
| Eq a => Eq (ZipList a) | Since: base-4.7.0.0 |
| Eq (MutableByteArray s) | Since: base-4.17.0.0 |
Defined in Data.Array.Byte Methods (==) :: MutableByteArray s -> MutableByteArray s -> Bool # (/=) :: MutableByteArray s -> MutableByteArray s -> Bool # | |
| Eq a => Eq (And a) | Since: base-4.16 |
| Eq a => Eq (Iff a) | Since: base-4.16 |
| Eq a => Eq (Ior a) | Since: base-4.16 |
| Eq a => Eq (Xor a) | Since: base-4.16 |
| Eq a => Eq (Complex a) | Since: base-2.1 |
| Eq a => Eq (Identity a) | Since: base-4.8.0.0 |
| Eq a => Eq (First a) | Since: base-2.1 |
| Eq a => Eq (Last a) | Since: base-2.1 |
| Eq a => Eq (Down a) | Since: base-4.6.0.0 |
| Eq a => Eq (First a) | Since: base-4.9.0.0 |
| Eq a => Eq (Last a) | Since: base-4.9.0.0 |
| Eq a => Eq (Max a) | Since: base-4.9.0.0 |
| Eq a => Eq (Min a) | Since: base-4.9.0.0 |
| Eq m => Eq (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods (==) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (/=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # | |
| Eq a => Eq (Dual a) | Since: base-2.1 |
| Eq a => Eq (Product a) | Since: base-2.1 |
| Eq a => Eq (Sum a) | Since: base-2.1 |
| Eq a => Eq (NonEmpty a) | Since: base-4.9.0.0 |
| Eq (TVar a) | Since: base-4.8.0.0 |
| Eq p => Eq (Par1 p) | Since: base-4.7.0.0 |
| Eq (IORef a) | Pointer equality. Since: base-4.0.0.0 |
| Eq (MVar a) | Since: base-4.1.0.0 |
| Eq a => Eq (Ratio a) | Since: base-2.1 |
| Eq a => Eq (IntMap a) | |
| Eq a => Eq (Seq a) | |
| Eq a => Eq (ViewL a) | |
| Eq a => Eq (ViewR a) | |
| Eq a => Eq (Intersection a) | |
Defined in Data.Set.Internal Methods (==) :: Intersection a -> Intersection a -> Bool # (/=) :: Intersection a -> Intersection a -> Bool # | |
| Eq a => Eq (Set a) | |
| Eq a => Eq (Tree a) | |
| Eq a => Eq (Hashed a) | Uses precomputed hash to detect inequality faster |
| Eq a => Eq (HashSet a) | Note that, in the presence of hash collisions, equal
In general, the lack of substitutivity can be observed with any function that depends on the key ordering, such as folds and traversals. |
| Eq a => Eq (AnnotDetails a) | |
Defined in Text.PrettyPrint.Annotated.HughesPJ Methods (==) :: AnnotDetails a -> AnnotDetails a -> Bool # (/=) :: AnnotDetails a -> AnnotDetails a -> Bool # | |
| Eq (Doc a) | |
| Eq a => Eq (Span a) | |
| Eq (TMVar a) | |
| Eq flag => Eq (TyVarBndr flag) | |
| Eq a => Eq (Maybe a) | Since: base-2.1 |
| Eq a => Eq (a) | |
| Eq a => Eq [a] | |
| (Eq a, Eq b) => Eq (Either a b) | Since: base-2.1 |
| Eq (Proxy s) | Since: base-4.7.0.0 |
| Eq a => Eq (Arg a b) | Since: base-4.9.0.0 |
| Eq (TypeRep a) | Since: base-2.1 |
| Eq (U1 p) | Since: base-4.9.0.0 |
| Eq (V1 p) | Since: base-4.9.0.0 |
| (Eq k, Eq a) => Eq (Map k a) | |
| (Eq k, Eq v) => Eq (HashMap k v) | Note that, in the presence of hash collisions, equal
In general, the lack of substitutivity can be observed with any function that depends on the key ordering, such as folds and traversals. |
| (Eq k, Eq v) => Eq (Leaf k v) | |
| (Eq1 m, Eq a) => Eq (MaybeT m a) | |
| (Eq a, Eq b) => Eq (a, b) | |
| Eq a => Eq (Const a b) | Since: base-4.9.0.0 |
| Eq (f a) => Eq (Ap f a) | Since: base-4.12.0.0 |
| Eq (f a) => Eq (Alt f a) | Since: base-4.8.0.0 |
| Eq (a :~: b) | Since: base-4.7.0.0 |
| Eq (OrderingI a b) | |
| (Generic1 f, Eq (Rep1 f a)) => Eq (Generically1 f a) | Since: base-4.18.0.0 |
Defined in GHC.Generics Methods (==) :: Generically1 f a -> Generically1 f a -> Bool # (/=) :: Generically1 f a -> Generically1 f a -> Bool # | |
| Eq (f p) => Eq (Rec1 f p) | Since: base-4.7.0.0 |
| Eq (URec (Ptr ()) p) | Since: base-4.9.0.0 |
| Eq (URec Char p) | Since: base-4.9.0.0 |
| Eq (URec Double p) | Since: base-4.9.0.0 |
| Eq (URec Float p) | |
| Eq (URec Int p) | Since: base-4.9.0.0 |
| Eq (URec Word p) | Since: base-4.9.0.0 |
| (Eq e, Eq1 m, Eq a) => Eq (ExceptT e m a) | |
| (Eq1 f, Eq a) => Eq (IdentityT f a) | |
| (Eq w, Eq1 m, Eq a) => Eq (WriterT w m a) | |
| (Eq w, Eq1 m, Eq a) => Eq (WriterT w m a) | |
| (Eq a, Eq b, Eq c) => Eq (a, b, c) | |
| (Eq (f a), Eq (g a)) => Eq (Product f g a) | Since: base-4.18.0.0 |
| (Eq (f a), Eq (g a)) => Eq (Sum f g a) | Since: base-4.18.0.0 |
| Eq (a :~~: b) | Since: base-4.10.0.0 |
| (Eq (f p), Eq (g p)) => Eq ((f :*: g) p) | Since: base-4.7.0.0 |
| (Eq (f p), Eq (g p)) => Eq ((f :+: g) p) | Since: base-4.7.0.0 |
| Eq c => Eq (K1 i c p) | Since: base-4.7.0.0 |
| (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d) | |
| Eq (f (g a)) => Eq (Compose f g a) | Since: base-4.18.0.0 |
| Eq (f (g p)) => Eq ((f :.: g) p) | Since: base-4.7.0.0 |
| Eq (f p) => Eq (M1 i c f p) | Since: base-4.7.0.0 |
| (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f) => Eq (a, b, c, d, e, f) | |
| (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g) => Eq (a, b, c, d, e, f, g) | |
| (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) | |
| (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) | |
| (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) | |
| (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) | |
| (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) | |
| (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) | |
| (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) | |
| (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) | |
Instances
| Data Ordering | Since: base-4.0.0.0 |
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 :: forall r r'. (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 # | |
| Monoid Ordering | Since: base-2.1 |
| Semigroup Ordering | Since: base-4.9.0.0 |
| Bounded Ordering | Since: base-2.1 |
| Enum Ordering | Since: base-2.1 |
| Generic Ordering | |
| Read Ordering | Since: base-2.1 |
| Show Ordering | Since: base-2.1 |
| NFData Ordering | |
Defined in Control.DeepSeq | |
| Eq Ordering | |
| Ord Ordering | |
Defined in GHC.Classes | |
| Hashable Ordering | |
Defined in Data.Hashable.Class | |
| type Rep Ordering | Since: base-4.6.0.0 |
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.
Ord, as defined by the Haskell report, implements a total order and has the
following properties:
- Comparability
x <= y || y <= x=True- Transitivity
- if
x <= y && y <= z=True, thenx <= z=True - Reflexivity
x <= x=True- Antisymmetry
- if
x <= y && y <= x=True, thenx == y=True
The following operator interactions are expected to hold:
x >= y=y <= xx < y=x <= y && x /= yx > y=y < xx < y=compare x y == LTx > y=compare x y == GTx == y=compare x y == EQmin x y == if x <= y then x else y=Truemax 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 #
(<) :: a -> a -> Bool infix 4 #
(<=) :: a -> a -> Bool infix 4 #
(>) :: a -> a -> Bool infix 4 #
Instances
| Ord ByteArray | Non-lexicographic ordering. This compares the lengths of the byte arrays first and uses a lexicographic ordering if the lengths are equal. Subject to change between major versions. Since: base-4.17.0.0 |
| Ord All | Since: base-2.1 |
| Ord Any | Since: base-2.1 |
| Ord SomeTypeRep | |
Defined in Data.Typeable.Internal Methods compare :: SomeTypeRep -> SomeTypeRep -> Ordering # (<) :: SomeTypeRep -> SomeTypeRep -> Bool # (<=) :: SomeTypeRep -> SomeTypeRep -> Bool # (>) :: SomeTypeRep -> SomeTypeRep -> Bool # (>=) :: SomeTypeRep -> SomeTypeRep -> Bool # max :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep # min :: SomeTypeRep -> SomeTypeRep -> SomeTypeRep # | |
| Ord Version | Since: base-2.1 |
| Ord Void | Since: base-4.8.0.0 |
| Ord BlockReason | Since: base-4.3.0.0 |
Defined in GHC.Conc.Sync Methods compare :: BlockReason -> BlockReason -> Ordering # (<) :: BlockReason -> BlockReason -> Bool # (<=) :: BlockReason -> BlockReason -> Bool # (>) :: BlockReason -> BlockReason -> Bool # (>=) :: BlockReason -> BlockReason -> Bool # max :: BlockReason -> BlockReason -> BlockReason # min :: BlockReason -> BlockReason -> BlockReason # | |
| Ord ThreadId | Since: base-4.2.0.0 |
Defined in GHC.Conc.Sync | |
| Ord ThreadStatus | Since: base-4.3.0.0 |
Defined in GHC.Conc.Sync Methods compare :: ThreadStatus -> ThreadStatus -> Ordering # (<) :: ThreadStatus -> ThreadStatus -> Bool # (<=) :: ThreadStatus -> ThreadStatus -> Bool # (>) :: ThreadStatus -> ThreadStatus -> Bool # (>=) :: ThreadStatus -> ThreadStatus -> Bool # max :: ThreadStatus -> ThreadStatus -> ThreadStatus # min :: ThreadStatus -> ThreadStatus -> ThreadStatus # | |
| Ord ErrorCall | Since: base-4.7.0.0 |
| Ord ArithException | Since: base-3.0 |
Defined in GHC.Exception.Type Methods compare :: ArithException -> ArithException -> Ordering # (<) :: ArithException -> ArithException -> Bool # (<=) :: ArithException -> ArithException -> Bool # (>) :: ArithException -> ArithException -> Bool # (>=) :: ArithException -> ArithException -> Bool # max :: ArithException -> ArithException -> ArithException # min :: ArithException -> ArithException -> ArithException # | |
| Ord Associativity | Since: base-4.6.0.0 |
Defined in GHC.Generics Methods compare :: Associativity -> Associativity -> Ordering # (<) :: Associativity -> Associativity -> Bool # (<=) :: Associativity -> Associativity -> Bool # (>) :: Associativity -> Associativity -> Bool # (>=) :: Associativity -> Associativity -> Bool # max :: Associativity -> Associativity -> Associativity # min :: Associativity -> Associativity -> Associativity # | |
| Ord DecidedStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics Methods compare :: DecidedStrictness -> DecidedStrictness -> Ordering # (<) :: DecidedStrictness -> DecidedStrictness -> Bool # (<=) :: DecidedStrictness -> DecidedStrictness -> Bool # (>) :: DecidedStrictness -> DecidedStrictness -> Bool # (>=) :: DecidedStrictness -> DecidedStrictness -> Bool # max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness # min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness # | |
| Ord Fixity | Since: base-4.6.0.0 |
| Ord SourceStrictness | Since: base-4.9.0.0 |
Defined in GHC.Generics Methods compare :: SourceStrictness -> SourceStrictness -> Ordering # (<) :: SourceStrictness -> SourceStrictness -> Bool # (<=) :: SourceStrictness -> SourceStrictness -> Bool # (>) :: SourceStrictness -> SourceStrictness -> Bool # (>=) :: SourceStrictness -> SourceStrictness -> Bool # max :: SourceStrictness -> SourceStrictness -> SourceStrictness # min :: SourceStrictness -> SourceStrictness -> SourceStrictness # | |
| Ord SourceUnpackedness | Since: base-4.9.0.0 |
Defined in GHC.Generics Methods compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering # (<) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (>) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness # min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness # | |
| Ord ArrayException | Since: base-4.2.0.0 |
Defined in GHC.IO.Exception Methods compare :: ArrayException -> ArrayException -> Ordering # (<) :: ArrayException -> ArrayException -> Bool # (<=) :: ArrayException -> ArrayException -> Bool # (>) :: ArrayException -> ArrayException -> Bool # (>=) :: ArrayException -> ArrayException -> Bool # max :: ArrayException -> ArrayException -> ArrayException # min :: ArrayException -> ArrayException -> ArrayException # | |
| Ord AsyncException | Since: base-4.2.0.0 |
Defined in GHC.IO.Exception Methods compare :: AsyncException -> AsyncException -> Ordering # (<) :: AsyncException -> AsyncException -> Bool # (<=) :: AsyncException -> AsyncException -> Bool # (>) :: AsyncException -> AsyncException -> Bool # (>=) :: AsyncException -> AsyncException -> Bool # max :: AsyncException -> AsyncException -> AsyncException # min :: AsyncException -> AsyncException -> AsyncException # | |
| Ord ExitCode | |
Defined in GHC.IO.Exception | |
| Ord BufferMode | Since: base-4.2.0.0 |
Defined in GHC.IO.Handle.Types Methods compare :: BufferMode -> BufferMode -> Ordering # (<) :: BufferMode -> BufferMode -> Bool # (<=) :: BufferMode -> BufferMode -> Bool # (>) :: BufferMode -> BufferMode -> Bool # (>=) :: BufferMode -> BufferMode -> Bool # max :: BufferMode -> BufferMode -> BufferMode # min :: BufferMode -> BufferMode -> BufferMode # | |
| Ord Newline | Since: base-4.3.0.0 |
| Ord NewlineMode | Since: base-4.3.0.0 |
Defined in GHC.IO.Handle.Types Methods compare :: NewlineMode -> NewlineMode -> Ordering # (<) :: NewlineMode -> NewlineMode -> Bool # (<=) :: NewlineMode -> NewlineMode -> Bool # (>) :: NewlineMode -> NewlineMode -> Bool # (>=) :: NewlineMode -> NewlineMode -> Bool # max :: NewlineMode -> NewlineMode -> NewlineMode # min :: NewlineMode -> NewlineMode -> NewlineMode # | |
| Ord IOMode | Since: base-4.2.0.0 |
| Ord Int16 | Since: base-2.1 |
| Ord Int32 | Since: base-2.1 |
| Ord Int64 | Since: base-2.1 |
| Ord Int8 | Since: base-2.1 |
| Ord SomeChar | |
Defined in GHC.TypeLits | |
| Ord SomeSymbol | Since: base-4.7.0.0 |
Defined in GHC.TypeLits Methods compare :: SomeSymbol -> SomeSymbol -> Ordering # (<) :: SomeSymbol -> SomeSymbol -> Bool # (<=) :: SomeSymbol -> SomeSymbol -> Bool # (>) :: SomeSymbol -> SomeSymbol -> Bool # (>=) :: SomeSymbol -> SomeSymbol -> Bool # max :: SomeSymbol -> SomeSymbol -> SomeSymbol # min :: SomeSymbol -> SomeSymbol -> SomeSymbol # | |
| Ord SomeNat | Since: base-4.7.0.0 |
| Ord Word16 | Since: base-2.1 |
| Ord Word32 | Since: base-2.1 |
| Ord Word64 | Since: base-2.1 |
| Ord Word8 | Since: base-2.1 |
| Ord ByteString | |
Defined in Data.ByteString.Internal.Type Methods compare :: ByteString -> ByteString -> Ordering # (<) :: ByteString -> ByteString -> Bool # (<=) :: ByteString -> ByteString -> Bool # (>) :: ByteString -> ByteString -> Bool # (>=) :: ByteString -> ByteString -> Bool # max :: ByteString -> ByteString -> ByteString # min :: ByteString -> ByteString -> ByteString # | |
| Ord ByteString | |
Defined in Data.ByteString.Lazy.Internal Methods compare :: ByteString -> ByteString -> Ordering # (<) :: ByteString -> ByteString -> Bool # (<=) :: ByteString -> ByteString -> Bool # (>) :: ByteString -> ByteString -> Bool # (>=) :: ByteString -> ByteString -> Bool # max :: ByteString -> ByteString -> ByteString # min :: ByteString -> ByteString -> ByteString # | |
| Ord ShortByteString | |
Defined in Data.ByteString.Short.Internal Methods compare :: ShortByteString -> ShortByteString -> Ordering # (<) :: ShortByteString -> ShortByteString -> Bool # (<=) :: ShortByteString -> ShortByteString -> Bool # (>) :: ShortByteString -> ShortByteString -> Bool # (>=) :: ShortByteString -> ShortByteString -> Bool # max :: ShortByteString -> ShortByteString -> ShortByteString # min :: ShortByteString -> ShortByteString -> ShortByteString # | |
| Ord IntSet | |
| Ord OsChar | Byte ordering of the internal representation. |
| Ord OsString | Byte ordering of the internal representation. |
Defined in System.OsString.Internal.Types | |
| Ord PosixChar | |
| Ord PosixString | |
Defined in System.OsString.Internal.Types Methods compare :: PosixString -> PosixString -> Ordering # (<) :: PosixString -> PosixString -> Bool # (<=) :: PosixString -> PosixString -> Bool # (>) :: PosixString -> PosixString -> Bool # (>=) :: PosixString -> PosixString -> Bool # max :: PosixString -> PosixString -> PosixString # min :: PosixString -> PosixString -> PosixString # | |
| Ord WindowsChar | |
Defined in System.OsString.Internal.Types Methods compare :: WindowsChar -> WindowsChar -> Ordering # (<) :: WindowsChar -> WindowsChar -> Bool # (<=) :: WindowsChar -> WindowsChar -> Bool # (>) :: WindowsChar -> WindowsChar -> Bool # (>=) :: WindowsChar -> WindowsChar -> Bool # max :: WindowsChar -> WindowsChar -> WindowsChar # min :: WindowsChar -> WindowsChar -> WindowsChar # | |
| Ord WindowsString | |
Defined in System.OsString.Internal.Types Methods compare :: WindowsString -> WindowsString -> Ordering # (<) :: WindowsString -> WindowsString -> Bool # (<=) :: WindowsString -> WindowsString -> Bool # (>) :: WindowsString -> WindowsString -> Bool # (>=) :: WindowsString -> WindowsString -> Bool # max :: WindowsString -> WindowsString -> WindowsString # min :: WindowsString -> WindowsString -> WindowsString # | |
| Ord Extension | |
| Ord Ordering | |
Defined in GHC.Classes | |
| Ord TyCon | |
| Ord Undefined Source # | |
| Ord AnnLookup | |
| Ord AnnTarget | |
| Ord Bang | |
| Ord Body | |
| Ord Bytes | |
| Ord Callconv | |
Defined in Language.Haskell.TH.Syntax | |
| Ord Clause | |
| Ord Con | |
| Ord Dec | |
| Ord DecidedStrictness | |
Defined in Language.Haskell.TH.Syntax Methods compare :: DecidedStrictness -> DecidedStrictness -> Ordering # (<) :: DecidedStrictness -> DecidedStrictness -> Bool # (<=) :: DecidedStrictness -> DecidedStrictness -> Bool # (>) :: DecidedStrictness -> DecidedStrictness -> Bool # (>=) :: DecidedStrictness -> DecidedStrictness -> Bool # max :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness # min :: DecidedStrictness -> DecidedStrictness -> DecidedStrictness # | |
| Ord DerivClause | |
Defined in Language.Haskell.TH.Syntax Methods compare :: DerivClause -> DerivClause -> Ordering # (<) :: DerivClause -> DerivClause -> Bool # (<=) :: DerivClause -> DerivClause -> Bool # (>) :: DerivClause -> DerivClause -> Bool # (>=) :: DerivClause -> DerivClause -> Bool # max :: DerivClause -> DerivClause -> DerivClause # min :: DerivClause -> DerivClause -> DerivClause # | |
| Ord DerivStrategy | |
Defined in Language.Haskell.TH.Syntax Methods compare :: DerivStrategy -> DerivStrategy -> Ordering # (<) :: DerivStrategy -> DerivStrategy -> Bool # (<=) :: DerivStrategy -> DerivStrategy -> Bool # (>) :: DerivStrategy -> DerivStrategy -> Bool # (>=) :: DerivStrategy -> DerivStrategy -> Bool # max :: DerivStrategy -> DerivStrategy -> DerivStrategy # min :: DerivStrategy -> DerivStrategy -> DerivStrategy # | |
| Ord DocLoc | |
| Ord Exp | |
| Ord FamilyResultSig | |
Defined in Language.Haskell.TH.Syntax Methods compare :: FamilyResultSig -> FamilyResultSig -> Ordering # (<) :: FamilyResultSig -> FamilyResultSig -> Bool # (<=) :: FamilyResultSig -> FamilyResultSig -> Bool # (>) :: FamilyResultSig -> FamilyResultSig -> Bool # (>=) :: FamilyResultSig -> FamilyResultSig -> Bool # max :: FamilyResultSig -> FamilyResultSig -> FamilyResultSig # min :: FamilyResultSig -> FamilyResultSig -> FamilyResultSig # | |
| Ord Fixity | |
| Ord FixityDirection | |
Defined in Language.Haskell.TH.Syntax Methods compare :: FixityDirection -> FixityDirection -> Ordering # (<) :: FixityDirection -> FixityDirection -> Bool # (<=) :: FixityDirection -> FixityDirection -> Bool # (>) :: FixityDirection -> FixityDirection -> Bool # (>=) :: FixityDirection -> FixityDirection -> Bool # max :: FixityDirection -> FixityDirection -> FixityDirection # min :: FixityDirection -> FixityDirection -> FixityDirection # | |
| Ord Foreign | |
Defined in Language.Haskell.TH.Syntax | |
| Ord FunDep | |
| Ord Guard | |
| Ord Info | |
| Ord InjectivityAnn | |
Defined in Language.Haskell.TH.Syntax Methods compare :: InjectivityAnn -> InjectivityAnn -> Ordering # (<) :: InjectivityAnn -> InjectivityAnn -> Bool # (<=) :: InjectivityAnn -> InjectivityAnn -> Bool # (>) :: InjectivityAnn -> InjectivityAnn -> Bool # (>=) :: InjectivityAnn -> InjectivityAnn -> Bool # max :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn # min :: InjectivityAnn -> InjectivityAnn -> InjectivityAnn # | |
| Ord Inline | |
| Ord Lit | |
| Ord Loc | |
| Ord Match | |
| Ord ModName | |
Defined in Language.Haskell.TH.Syntax | |
| Ord Module | |
| Ord ModuleInfo | |
Defined in Language.Haskell.TH.Syntax Methods compare :: ModuleInfo -> ModuleInfo -> Ordering # (<) :: ModuleInfo -> ModuleInfo -> Bool # (<=) :: ModuleInfo -> ModuleInfo -> Bool # (>) :: ModuleInfo -> ModuleInfo -> Bool # (>=) :: ModuleInfo -> ModuleInfo -> Bool # max :: ModuleInfo -> ModuleInfo -> ModuleInfo # min :: ModuleInfo -> ModuleInfo -> ModuleInfo # | |
| Ord Name | |
| Ord NameFlavour | |
Defined in Language.Haskell.TH.Syntax Methods compare :: NameFlavour -> NameFlavour -> Ordering # (<) :: NameFlavour -> NameFlavour -> Bool # (<=) :: NameFlavour -> NameFlavour -> Bool # (>) :: NameFlavour -> NameFlavour -> Bool # (>=) :: NameFlavour -> NameFlavour -> Bool # max :: NameFlavour -> NameFlavour -> NameFlavour # min :: NameFlavour -> NameFlavour -> NameFlavour # | |
| Ord NameSpace | |
| Ord OccName | |
Defined in Language.Haskell.TH.Syntax | |
| Ord Overlap | |
Defined in Language.Haskell.TH.Syntax | |
| Ord Pat | |
| Ord PatSynArgs | |
Defined in Language.Haskell.TH.Syntax Methods compare :: PatSynArgs -> PatSynArgs -> Ordering # (<) :: PatSynArgs -> PatSynArgs -> Bool # (<=) :: PatSynArgs -> PatSynArgs -> Bool # (>) :: PatSynArgs -> PatSynArgs -> Bool # (>=) :: PatSynArgs -> PatSynArgs -> Bool # max :: PatSynArgs -> PatSynArgs -> PatSynArgs # min :: PatSynArgs -> PatSynArgs -> PatSynArgs # | |
| Ord PatSynDir | |
| Ord Phases | |
| Ord PkgName | |
Defined in Language.Haskell.TH.Syntax | |
| Ord Pragma | |
| Ord Range | |
| Ord Role | |
| Ord RuleBndr | |
Defined in Language.Haskell.TH.Syntax | |
| Ord RuleMatch | |
| Ord Safety | |
| Ord SourceStrictness | |
Defined in Language.Haskell.TH.Syntax Methods compare :: SourceStrictness -> SourceStrictness -> Ordering # (<) :: SourceStrictness -> SourceStrictness -> Bool # (<=) :: SourceStrictness -> SourceStrictness -> Bool # (>) :: SourceStrictness -> SourceStrictness -> Bool # (>=) :: SourceStrictness -> SourceStrictness -> Bool # max :: SourceStrictness -> SourceStrictness -> SourceStrictness # min :: SourceStrictness -> SourceStrictness -> SourceStrictness # | |
| Ord SourceUnpackedness | |
Defined in Language.Haskell.TH.Syntax Methods compare :: SourceUnpackedness -> SourceUnpackedness -> Ordering # (<) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (<=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (>) :: SourceUnpackedness -> SourceUnpackedness -> Bool # (>=) :: SourceUnpackedness -> SourceUnpackedness -> Bool # max :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness # min :: SourceUnpackedness -> SourceUnpackedness -> SourceUnpackedness # | |
| Ord Specificity | |
Defined in Language.Haskell.TH.Syntax Methods compare :: Specificity -> Specificity -> Ordering # (<) :: Specificity -> Specificity -> Bool # (<=) :: Specificity -> Specificity -> Bool # (>) :: Specificity -> Specificity -> Bool # (>=) :: Specificity -> Specificity -> Bool # max :: Specificity -> Specificity -> Specificity # min :: Specificity -> Specificity -> Specificity # | |
| Ord Stmt | |
| Ord TyLit | |
| Ord TySynEqn | |
Defined in Language.Haskell.TH.Syntax | |
| Ord Type | |
| Ord TypeFamilyHead | |
Defined in Language.Haskell.TH.Syntax Methods compare :: TypeFamilyHead -> TypeFamilyHead -> Ordering # (<) :: TypeFamilyHead -> TypeFamilyHead -> Bool # (<=) :: TypeFamilyHead -> TypeFamilyHead -> Bool # (>) :: TypeFamilyHead -> TypeFamilyHead -> Bool # (>=) :: TypeFamilyHead -> TypeFamilyHead -> Bool # max :: TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead # min :: TypeFamilyHead -> TypeFamilyHead -> TypeFamilyHead # | |
| Ord Integer | |
| Ord Natural | |
| Ord () | |
| Ord Bool | |
| Ord Char | |
| Ord Double | Note that due to the presence of
Also note that, due to the same,
|
| Ord Float | Note that due to the presence of
Also note that, due to the same,
|
| Ord Int | |
| Ord Word | |
| Ord a => Ord (ZipList a) | Since: base-4.7.0.0 |
| Ord a => Ord (Identity a) | Since: base-4.8.0.0 |
Defined in Data.Functor.Identity | |
| Ord a => Ord (First a) | Since: base-2.1 |
| Ord a => Ord (Last a) | Since: base-2.1 |
| Ord a => Ord (Down a) | Since: base-4.6.0.0 |
| Ord a => Ord (First a) | Since: base-4.9.0.0 |
| Ord a => Ord (Last a) | Since: base-4.9.0.0 |
| Ord a => Ord (Max a) | Since: base-4.9.0.0 |
| Ord a => Ord (Min a) | Since: base-4.9.0.0 |
| Ord m => Ord (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup Methods compare :: WrappedMonoid m -> WrappedMonoid m -> Ordering # (<) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (<=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (>) :: WrappedMonoid m -> WrappedMonoid m -> Bool # (>=) :: WrappedMonoid m -> WrappedMonoid m -> Bool # max :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # min :: WrappedMonoid m -> WrappedMonoid m -> WrappedMonoid m # | |
| Ord a => Ord (Dual a) | Since: base-2.1 |
| Ord a => Ord (Product a) | Since: base-2.1 |
| Ord a => Ord (Sum a) | Since: base-2.1 |
| Ord a => Ord (NonEmpty a) | Since: base-4.9.0.0 |
| Ord p => Ord (Par1 p) | Since: base-4.7.0.0 |
| Integral a => Ord (Ratio a) | Since: base-2.0.1 |
| Ord a => Ord (IntMap a) | |
Defined in Data.IntMap.Internal | |
| Ord a => Ord (Seq a) | |
| Ord a => Ord (ViewL a) | |
Defined in Data.Sequence.Internal | |
| Ord a => Ord (ViewR a) | |
Defined in Data.Sequence.Internal | |
| Ord a => Ord (Intersection a) | |
Defined in Data.Set.Internal Methods compare :: Intersection a -> Intersection a -> Ordering # (<) :: Intersection a -> Intersection a -> Bool # (<=) :: Intersection a -> Intersection a -> Bool # (>) :: Intersection a -> Intersection a -> Bool # (>=) :: Intersection a -> Intersection a -> Bool # max :: Intersection a -> Intersection a -> Intersection a # min :: Intersection a -> Intersection a -> Intersection a # | |
| Ord a => Ord (Set a) | |
| Ord a => Ord (Tree a) | Since: containers-0.6.5 |
| Ord a => Ord (Hashed a) | |
Defined in Data.Hashable.Class | |
| Ord a => Ord (HashSet a) | |
| Ord flag => Ord (TyVarBndr flag) | |
Defined in Language.Haskell.TH.Syntax Methods compare :: TyVarBndr flag -> TyVarBndr flag -> Ordering # (<) :: TyVarBndr flag -> TyVarBndr flag -> Bool # (<=) :: TyVarBndr flag -> TyVarBndr flag -> Bool # (>) :: TyVarBndr flag -> TyVarBndr flag -> Bool # (>=) :: TyVarBndr flag -> TyVarBndr flag -> Bool # | |
| Ord a => Ord (Maybe a) | Since: base-2.1 |
| Ord a => Ord (a) | |
| Ord a => Ord [a] | |
| (Ord a, Ord b) => Ord (Either a b) | Since: base-2.1 |
| Ord (Proxy s) | Since: base-4.7.0.0 |
| Ord a => Ord (Arg a b) | Since: base-4.9.0.0 |
| Ord (TypeRep a) | Since: base-4.4.0.0 |
| Ord (U1 p) | Since: base-4.7.0.0 |
| Ord (V1 p) | Since: base-4.9.0.0 |
| (Ord k, Ord v) => Ord (Map k v) | |
| (Ord k, Ord v) => Ord (HashMap k v) | The ordering is total and consistent with the |
Defined in Data.HashMap.Internal | |
| (Ord1 m, Ord a) => Ord (MaybeT m a) | |
Defined in Control.Monad.Trans.Maybe | |
| (Ord a, Ord b) => Ord (a, b) | |
| Ord a => Ord (Const a b) | Since: base-4.9.0.0 |
| Ord (f a) => Ord (Ap f a) | Since: base-4.12.0.0 |
| Ord (f a) => Ord (Alt f a) | Since: base-4.8.0.0 |
Defined in Data.Semigroup.Internal | |
| Ord (a :~: b) | Since: base-4.7.0.0 |
Defined in Data.Type.Equality | |
| (Generic1 f, Ord (Rep1 f a)) => Ord (Generically1 f a) | Since: base-4.18.0.0 |
Defined in GHC.Generics Methods compare :: Generically1 f a -> Generically1 f a -> Ordering # (<) :: Generically1 f a -> Generically1 f a -> Bool # (<=) :: Generically1 f a -> Generically1 f a -> Bool # (>) :: Generically1 f a -> Generically1 f a -> Bool # (>=) :: Generically1 f a -> Generically1 f a -> Bool # max :: Generically1 f a -> Generically1 f a -> Generically1 f a # min :: Generically1 f a -> Generically1 f a -> Generically1 f a # | |
| Ord (f p) => Ord (Rec1 f p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
| Ord (URec (Ptr ()) p) | Since: base-4.9.0.0 |
Defined in GHC.Generics Methods compare :: URec (Ptr ()) p -> URec (Ptr ()) p -> Ordering # (<) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (<=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # (>=) :: URec (Ptr ()) p -> URec (Ptr ()) p -> Bool # max :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # min :: URec (Ptr ()) p -> URec (Ptr ()) p -> URec (Ptr ()) p # | |
| Ord (URec Char p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
| Ord (URec Double p) | Since: base-4.9.0.0 |
Defined in GHC.Generics Methods compare :: URec Double p -> URec Double p -> Ordering # (<) :: URec Double p -> URec Double p -> Bool # (<=) :: URec Double p -> URec Double p -> Bool # (>) :: URec Double p -> URec Double p -> Bool # (>=) :: URec Double p -> URec Double p -> Bool # | |
| Ord (URec Float p) | |
Defined in GHC.Generics | |
| Ord (URec Int p) | Since: base-4.9.0.0 |
| Ord (URec Word p) | Since: base-4.9.0.0 |
Defined in GHC.Generics | |
| (Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a) | |
Defined in Control.Monad.Trans.Except Methods compare :: ExceptT e m a -> ExceptT e m a -> Ordering # (<) :: ExceptT e m a -> ExceptT e m a -> Bool # (<=) :: ExceptT e m a -> ExceptT e m a -> Bool # (>) :: ExceptT e m a -> ExceptT e m a -> Bool # (>=) :: ExceptT e m a -> ExceptT e m a -> Bool # | |
| (Ord1 f, Ord a) => Ord (IdentityT f a) | |
Defined in Control.Monad.Trans.Identity Methods compare :: IdentityT f a -> IdentityT f a -> Ordering # (<) :: IdentityT f a -> IdentityT f a -> Bool # (<=) :: IdentityT f a -> IdentityT f a -> Bool # (>) :: IdentityT f a -> IdentityT f a -> Bool # (>=) :: IdentityT f a -> IdentityT f a -> Bool # | |
| (Ord w, Ord1 m, Ord a) => Ord (WriterT w m a) | |
Defined in Control.Monad.Trans.Writer.Lazy Methods compare :: WriterT w m a -> WriterT w m a -> Ordering # (<) :: WriterT w m a -> WriterT w m a -> Bool # (<=) :: WriterT w m a -> WriterT w m a -> Bool # (>) :: WriterT w m a -> WriterT w m a -> Bool # (>=) :: WriterT w m a -> WriterT w m a -> Bool # | |
| (Ord w, Ord1 m, Ord a) => Ord (WriterT w m a) | |
Defined in Control.Monad.Trans.Writer.Strict Methods compare :: WriterT w m a -> WriterT w m a -> Ordering # (<) :: WriterT w m a -> WriterT w m a -> Bool # (<=) :: WriterT w m a -> WriterT w m a -> Bool # (>) :: WriterT w m a -> WriterT w m a -> Bool # (>=) :: WriterT w m a -> WriterT w m a -> Bool # | |
| (Ord a, Ord b, Ord c) => Ord (a, b, c) | |
| (Ord (f a), Ord (g a)) => Ord (Product f g a) | Since: base-4.18.0.0 |
Defined in Data.Functor.Product Methods compare :: Product f g a -> Product f g a -> Ordering # (<) :: Product f g a -> Product f g a -> Bool # (<=) :: Product f g a -> Product f g a -> Bool # (>) :: Product f g a -> Product f g a -> Bool # (>=) :: Product f g a -> Product f g a -> Bool # | |
| (Ord (f a), Ord (g a)) => Ord (Sum f g a) | Since: base-4.18.0.0 |
| Ord (a :~~: b) | Since: base-4.10.0.0 |
| (Ord (f p), Ord (g p)) => Ord ((f :*: g) p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
| (Ord (f p), Ord (g p)) => Ord ((f :+: g) p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
| Ord c => Ord (K1 i c p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
| (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d) | |
Defined in GHC.Classes | |
| Ord (f (g a)) => Ord (Compose f g a) | Since: base-4.18.0.0 |
Defined in Data.Functor.Compose Methods compare :: Compose f g a -> Compose f g a -> Ordering # (<) :: Compose f g a -> Compose f g a -> Bool # (<=) :: Compose f g a -> Compose f g a -> Bool # (>) :: Compose f g a -> Compose f g a -> Bool # (>=) :: Compose f g a -> Compose f g a -> Bool # | |
| Ord (f (g p)) => Ord ((f :.: g) p) | Since: base-4.7.0.0 |
Defined in GHC.Generics | |
| Ord (f p) => Ord (M1 i c f p) | Since: base-4.7.0.0 |
| (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e) -> (a, b, c, d, e) -> Ordering # (<) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (<=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (>) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # (>=) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Bool # max :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # min :: (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f) => Ord (a, b, c, d, e, f) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Ordering # (<) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (<=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (>) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # (>=) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Bool # max :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) # min :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g) => Ord (a, b, c, d, e, f, g) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Ordering # (<) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (<=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (>) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # (>=) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Bool # max :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) # min :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h) => Ord (a, b, c, d, e, f, g, h) | |
Defined in GHC.Classes Methods compare :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Ordering # (<) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (<=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (>) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # (>=) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Bool # max :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) # min :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i) => Ord (a, b, c, d, e, f, g, h, i) | |
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 # (<) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> Bool # max :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) # min :: (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) -> (a, b, c, d, e, f, g, h, i) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j) => Ord (a, b, c, d, e, f, g, h, i, j) | |
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 # (<) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) # min :: (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) -> (a, b, c, d, e, f, g, h, i, j) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k) => Ord (a, b, c, d, e, f, g, h, i, j, k) | |
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 # (<) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) # min :: (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) -> (a, b, c, d, e, f, g, h, i, j, k) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l) => Ord (a, b, c, d, e, f, g, h, i, j, k, l) | |
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 # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) # min :: (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) -> (a, b, c, d, e, f, g, h, i, j, k, l) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m) | |
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 # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) -> (a, b, c, d, e, f, g, h, i, j, k, l, m) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n) | |
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 # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n) # | |
| (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g, Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o) => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) | |
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 # (<) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (<=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (>) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # (>=) :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> Bool # max :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # min :: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) -> (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) # | |
The Down type allows you to reverse sort order conveniently. A value of type
contains a value of type Down aa (represented as ).Down a
If a has an instance associated with it then comparing two
values thus wrapped will give you the opposite of their normal sort order.
This is particularly useful when sorting in generalised list comprehensions,
as in: Ordthen sortWith by .Down x
>>>compare True FalseGT
>>>compare (Down True) (Down False)LT
If a has a instance then the wrapped instance also respects
the reversed ordering by exchanging the values of Bounded and
minBound.maxBound
>>>minBound :: Int-9223372036854775808
>>>minBound :: Down IntDown 9223372036854775807
All other instances of behave as they do for Down aa.
Since: base-4.6.0.0
Instances
| Foldable Down | Since: base-4.12.0.0 |
Defined in Data.Foldable Methods fold :: Monoid m => Down m -> m # foldMap :: Monoid m => (a -> m) -> Down a -> m # foldMap' :: Monoid m => (a -> m) -> Down a -> m # foldr :: (a -> b -> b) -> b -> Down a -> b # foldr' :: (a -> b -> b) -> b -> Down a -> b # foldl :: (b -> a -> b) -> b -> Down a -> b # foldl' :: (b -> a -> b) -> b -> Down a -> b # foldr1 :: (a -> a -> a) -> Down a -> a # foldl1 :: (a -> a -> a) -> Down a -> a # elem :: Eq a => a -> Down a -> Bool # maximum :: Ord a => Down a -> a # | |
| Traversable Down | Since: base-4.12.0.0 |
| Applicative Down | Since: base-4.11.0.0 |
| Functor Down | Since: base-4.11.0.0 |
| Monad Down | Since: base-4.11.0.0 |
| NFData1 Down | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| Generic1 Down | |
| Data a => Data (Down a) | Since: base-4.12.0.0 |
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Down a -> c (Down a) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Down a) # toConstr :: Down a -> Constr # dataTypeOf :: Down a -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (Down a)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Down a)) # gmapT :: (forall b. Data b => b -> b) -> Down a -> Down a # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Down a -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Down a -> r # gmapQ :: (forall d. Data d => d -> u) -> Down a -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Down a -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Down a -> m (Down a) # | |
| Storable a => Storable (Down a) | Since: base-4.14.0.0 |
| Monoid a => Monoid (Down a) | Since: base-4.11.0.0 |
| Semigroup a => Semigroup (Down a) | Since: base-4.11.0.0 |
| Bits a => Bits (Down a) | Since: base-4.14.0.0 |
Defined in Data.Ord Methods (.&.) :: Down a -> Down a -> Down a # (.|.) :: Down a -> Down a -> Down a # xor :: Down a -> Down a -> Down a # complement :: Down a -> Down a # shift :: Down a -> Int -> Down a # rotate :: Down a -> Int -> Down a # setBit :: Down a -> Int -> Down a # clearBit :: Down a -> Int -> Down a # complementBit :: Down a -> Int -> Down a # testBit :: Down a -> Int -> Bool # bitSizeMaybe :: Down a -> Maybe Int # shiftL :: Down a -> Int -> Down a # unsafeShiftL :: Down a -> Int -> Down a # shiftR :: Down a -> Int -> Down a # unsafeShiftR :: Down a -> Int -> Down a # rotateL :: Down a -> Int -> Down a # | |
| FiniteBits a => FiniteBits (Down a) | Since: base-4.14.0.0 |
Defined in Data.Ord Methods finiteBitSize :: Down a -> Int # countLeadingZeros :: Down a -> Int # countTrailingZeros :: Down a -> Int # | |
| Bounded a => Bounded (Down a) | Swaps Since: base-4.14.0.0 |
| (Enum a, Bounded a, Eq a) => Enum (Down a) | Swaps Since: base-4.18.0.0 |
Defined in Data.Ord | |
| Floating a => Floating (Down a) | Since: base-4.14.0.0 |
| RealFloat a => RealFloat (Down a) | Since: base-4.14.0.0 |
Defined in Data.Ord Methods floatRadix :: Down a -> Integer # floatDigits :: Down a -> Int # floatRange :: Down a -> (Int, Int) # decodeFloat :: Down a -> (Integer, Int) # encodeFloat :: Integer -> Int -> Down a # significand :: Down a -> Down a # scaleFloat :: Int -> Down a -> Down a # isInfinite :: Down a -> Bool # isDenormalized :: Down a -> Bool # isNegativeZero :: Down a -> Bool # | |
| Generic (Down a) | |
| Ix a => Ix (Down a) | Since: base-4.14.0.0 |
| Num a => Num (Down a) | Since: base-4.11.0.0 |
| Read a => Read (Down a) | This instance would be equivalent to the derived instances of the
Since: base-4.7.0.0 |
| Fractional a => Fractional (Down a) | Since: base-4.14.0.0 |
| Real a => Real (Down a) | Since: base-4.14.0.0 |
Defined in Data.Ord Methods toRational :: Down a -> Rational # | |
| RealFrac a => RealFrac (Down a) | Since: base-4.14.0.0 |
| Show a => Show (Down a) | This instance would be equivalent to the derived instances of the
Since: base-4.7.0.0 |
| NFData a => NFData (Down a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| Eq a => Eq (Down a) | Since: base-4.6.0.0 |
| Ord a => Ord (Down a) | Since: base-4.6.0.0 |
| type Rep1 Down | Since: base-4.12.0.0 |
Defined in GHC.Generics | |
| type Rep (Down a) | Since: base-4.12.0.0 |
Defined in GHC.Generics | |
comparing :: Ord a => (b -> a) -> b -> b -> Ordering #
comparing p x y = compare (p x) (p y)
Useful combinator for use in conjunction with the xxxBy family
of functions from Data.List, for example:
... sortBy (comparing fst) ...
System IO
A value of type is a computation which, when performed,
does some I/O before returning a value of type IO aa.
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
See openFile
Constructors
| ReadMode | |
| WriteMode | |
| AppendMode | |
| ReadWriteMode |
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.
Types for type-level computation
class a ~R# b => Coercible (a :: k) (b :: k) #
Coercible is a two-parameter class that has instances for types a and b if
the compiler can infer that they have the same representation. This class
does not have regular instances; instead they are created on-the-fly during
type-checking. Trying to manually declare an instance of Coercible
is an error.
Nevertheless one can pretend that the following three kinds of instances exist. First, as a trivial base-case:
instance Coercible a a
Furthermore, for every type constructor there is
an instance that allows to coerce under the type constructor. For
example, let D be a prototypical type constructor (data or
newtype) with three type arguments, which have roles nominal,
representational resp. phantom. Then there is an instance of
the form
instance Coercible b b' => Coercible (D a b c) (D a b' c')
Note that the nominal type arguments are equal, the
representational type arguments can differ, but need to have a
Coercible instance themself, and the phantom type arguments can be
changed arbitrarily.
The third kind of instance exists for every newtype NT = MkNT T and
comes in two variants, namely
instance Coercible a T => Coercible a NT
instance Coercible T b => Coercible NT b
This instance is only usable if the constructor MkNT is in scope.
If, as a library author of a type constructor like Set a, you
want to prevent a user of your module to write
coerce :: Set T -> Set NT,
you need to set the role of Set's type parameter to nominal,
by writing
type role Set nominal
For more details about this feature, please refer to Safe Coercions by Joachim Breitner, Richard A. Eisenberg, Simon Peyton Jones and Stephanie Weirich.
Since: ghc-prim-0.4.0
coerce :: forall {k :: RuntimeRep} (a :: TYPE k) (b :: TYPE k). Coercible a b => a -> b #
The function coerce allows you to safely convert between values of
types that have the same representation with no run-time overhead. In the
simplest case you can use it instead of a newtype constructor, to go from
the newtype's concrete type to the abstract type. But it also works in
more complicated settings, e.g. converting a list of newtypes to a list of
concrete types.
This function is representation-polymorphic, but the
RuntimeRep type argument is marked as Inferred, meaning
that it is not available for visible type application. This means
the typechecker will accept coerce Int Age 42.
type Constraint = CONSTRAINT LiftedRep #
The kind of lifted constraints
Proxy is a type that holds no data, but has a phantom parameter of
arbitrary type (or even kind). Its use is to provide type information, even
though there is no value available of that type (or it may be too costly to
create one).
Historically, is a safer alternative to the
Proxy :: Proxy a idiom.undefined :: a
>>>Proxy :: Proxy (Void, Int -> Int)Proxy
Proxy can even hold types of higher kinds,
>>>Proxy :: Proxy EitherProxy
>>>Proxy :: Proxy FunctorProxy
>>>Proxy :: Proxy complicatedStructureProxy
Constructors
| Proxy |
Instances
| Generic1 (Proxy :: k -> Type) | |
| Foldable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
Defined in Data.Foldable Methods fold :: Monoid m => Proxy m -> m # foldMap :: Monoid m => (a -> m) -> Proxy a -> 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 # elem :: Eq a => a -> Proxy a -> Bool # maximum :: Ord a => Proxy a -> a # minimum :: Ord a => Proxy a -> a # | |
| Contravariant (Proxy :: Type -> Type) | |
| Traversable (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| Alternative (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| Applicative (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| Functor (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| Monad (Proxy :: Type -> Type) | Since: base-4.7.0.0 |
| MonadPlus (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
| NFData1 (Proxy :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
| Hashable1 (Proxy :: Type -> Type) | |
Defined in Data.Hashable.Class | |
| Data t => Data (Proxy t) | Since: base-4.7.0.0 |
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Proxy t -> c (Proxy t) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Proxy t) # toConstr :: Proxy t -> Constr # dataTypeOf :: Proxy t -> DataType # dataCast1 :: Typeable t0 => (forall d. Data d => c (t0 d)) -> Maybe (c (Proxy t)) # dataCast2 :: Typeable t0 => (forall d e. (Data d, Data e) => c (t0 d e)) -> Maybe (c (Proxy t)) # gmapT :: (forall b. Data b => b -> b) -> Proxy t -> Proxy t # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Proxy t -> r # gmapQ :: (forall d. Data d => d -> u) -> Proxy t -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Proxy t -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Proxy t -> m (Proxy t) # | |
| Monoid (Proxy s) | Since: base-4.7.0.0 |
| Semigroup (Proxy s) | Since: base-4.9.0.0 |
| Bounded (Proxy t) | Since: base-4.7.0.0 |
| Enum (Proxy s) | Since: base-4.7.0.0 |
| Generic (Proxy t) | |
| Ix (Proxy s) | Since: base-4.7.0.0 |
Defined in Data.Proxy | |
| Read (Proxy t) | Since: base-4.7.0.0 |
| Show (Proxy s) | Since: base-4.7.0.0 |
| NFData (Proxy a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| Eq (Proxy s) | Since: base-4.7.0.0 |
| Ord (Proxy s) | Since: base-4.7.0.0 |
| Hashable (Proxy a) | |
Defined in Data.Hashable.Class | |
| type Rep1 (Proxy :: k -> Type) | Since: base-4.6.0.0 |
| type Rep (Proxy t) | Since: base-4.6.0.0 |
class a ~# b => (a :: k) ~ (b :: k) infix 4 #
Lifted, homogeneous equality. By lifted, we mean that it
can be bogus (deferred type error). By homogeneous, the two
types a and b must have the same kinds.
The class Typeable allows a concrete representation of a type to
be calculated.
Minimal complete definition
typeRep#
Uninhabited data type
Since: base-4.8.0.0
Instances
| Data Void | Since: base-4.8.0.0 |
Defined in Data.Data Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Void -> c Void # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Void # dataTypeOf :: Void -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Void) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Void) # gmapT :: (forall b. Data b => b -> b) -> Void -> Void # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Void -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Void -> r # gmapQ :: (forall d. Data d => d -> u) -> Void -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Void -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Void -> m Void # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Void -> m Void # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Void -> m Void # | |
| Semigroup Void | Since: base-4.9.0.0 |
| Exception Void | Since: base-4.8.0.0 |
Defined in GHC.Exception.Type Methods toException :: Void -> SomeException # fromException :: SomeException -> Maybe Void # displayException :: Void -> String # | |
| Generic Void | |
| Read Void | Reading a Since: base-4.8.0.0 |
| Show Void | Since: base-4.8.0.0 |
| NFData Void | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
| Eq Void | Since: base-4.8.0.0 |
| Ord Void | Since: base-4.8.0.0 |
| Hashable Void | |
Defined in Data.Hashable.Class | |
| Lift Void | Since: template-haskell-2.15.0.0 |
| type Rep Void | Since: base-4.8.0.0 |
Since Void values logically don't exist, this witnesses the
logical reasoning tool of "ex falso quodlibet".
>>>let x :: Either Void Int; x = Right 5>>>:{case x of Right r -> r Left l -> absurd l :} 5
Since: base-4.8.0.0
Basic type classes
seq :: forall {r :: RuntimeRep} a (b :: TYPE r). a -> b -> b infixr 0 #
The value of is bottom if seq a ba 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 does
not guarantee that seq a ba 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.
($!) :: forall (r :: RuntimeRep) a (b :: TYPE r). (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.
Representable types of kind *.
This class is derivable in GHC with the DeriveGeneric flag on.
A Generic instance must satisfy the following laws:
from.to≡idto.from≡id
Instances
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
showis 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
showsPrecwill produce infix applications of the constructor. - the representation will be enclosed in parentheses if the
precedence of the top-level constructor in
xis less thand(associativity is ignored). Thus, ifdis0then the result is never surrounded in parentheses; ifdis11it is always surrounded in parentheses, unless it is an atomic expression. - If the constructor is defined using record syntax, then
showwill 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 = 5Note that right-associativity of :^: is ignored. For example,
produces the stringshow(Leaf 1 :^: Leaf 2 :^: Leaf 3)"Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
Instances
GHC-specific functionality
This class gives the integer associated with a type-level natural. There are instances of the class for every concrete literal: 0, 1, 2, etc.
Since: base-4.7.0.0
Minimal complete definition
type family CmpNat (a :: Natural) (b :: Natural) :: Ordering where ... #
Comparison of type-level naturals, as a function.
Since: base-4.7.0.0
This type represents unknown type-level natural numbers.
Since: base-4.10.0.0
A type synonym for Natural.
Prevously, this was an opaque data type, but it was changed to a type synonym.
Since: base-4.16.0.0
someNatVal :: Natural -> SomeNat #
Convert an integer into an unknown type-level natural.
Since: base-4.10.0.0
getStackTrace :: IO (Maybe [Location]) #
Get a trace of the current execution stack state.
Returns Nothing if stack trace support isn't available on host machine.
showStackTrace :: IO (Maybe String) #
Get a string representation of the current execution stack state.
CallStacks are a lightweight method of obtaining a
partial call-stack at any point in the program.
A function can request its call-site with the HasCallStack constraint.
For example, we can define
putStrLnWithCallStack :: HasCallStack => String -> IO ()
as a variant of putStrLn that will get its call-site and print it,
along with the string given as argument. We can access the
call-stack inside putStrLnWithCallStack with callStack.
>>>:{putStrLnWithCallStack :: HasCallStack => String -> IO () putStrLnWithCallStack msg = do putStrLn msg putStrLn (prettyCallStack callStack) :}
Thus, if we call putStrLnWithCallStack we will get a formatted call-stack
alongside our string.
>>>putStrLnWithCallStack "hello"hello CallStack (from HasCallStack): putStrLnWithCallStack, called at <interactive>:... in interactive:Ghci...
GHC solves HasCallStack constraints in three steps:
- If there is a
CallStackin scope -- i.e. the enclosing function has aHasCallStackconstraint -- GHC will append the new call-site to the existingCallStack. - If there is no
CallStackin scope -- e.g. in the GHCi session above -- and the enclosing definition does not have an explicit type signature, GHC will infer aHasCallStackconstraint for the enclosing definition (subject to the monomorphism restriction). - If there is no
CallStackin scope and the enclosing definition has an explicit type signature, GHC will solve theHasCallStackconstraint for the singletonCallStackcontaining just the current call-site.
CallStacks do not interact with the RTS and do not require compilation
with -prof. On the other hand, as they are built up explicitly via the
HasCallStack constraints, they will generally not contain as much
information as the simulated call-stacks maintained by the RTS.
A CallStack is a [(String, SrcLoc)]. The String is the name of
function that was called, the SrcLoc is the call-site. The list is
ordered with the most recently called function at the head.
NOTE: The intrepid user may notice that HasCallStack is just an
alias for an implicit parameter ?callStack :: CallStack. This is an
implementation detail and should not be considered part of the
CallStack API, we may decide to change the implementation in the
future.
Since: base-4.8.1.0
type HasCallStack = ?callStack :: CallStack #
Request a CallStack.
NOTE: The implicit parameter ?callStack :: CallStack is an
implementation detail and should not be considered part of the
CallStack API, we may decide to change the implementation in the
future.
Since: base-4.9.0.0
callStack :: HasCallStack => CallStack #
getCallStack :: CallStack -> [([Char], SrcLoc)] #
Extract a list of call-sites from the CallStack.
The list is ordered by most recent call.
Since: base-4.8.1.0
currentCallStack :: IO [String] #
Returns a [String] representing the current call stack. This
can be useful for debugging.
The implementation uses the call-stack simulation maintained by the
profiler, so it only works if the program was compiled with -prof
and contains suitable SCC annotations (e.g. by using -fprof-auto).
Otherwise, the list returned is likely to be empty or
uninformative.
Since: base-4.5.0.0
prettySrcLoc :: SrcLoc -> String #
Pretty print a SrcLoc.
Since: base-4.9.0.0
prettyCallStack :: CallStack -> String #
Pretty print a CallStack.
Since: base-4.9.0.0
withFrozenCallStack :: HasCallStack => (HasCallStack => a) -> a #
Perform some computation without adding new entries to the CallStack.
Since: base-4.9.0.0