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 |
Reexports from Data.*
and GHC.*
modules of
base package.
Synopsis
- data Char
- chr :: Int -> Char
- module Data.Eq
- 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
- module Data.Coerce
- type Type = TYPE LiftedRep
- type Constraint = CONSTRAINT LiftedRep
- data Proxy (t :: k) = Proxy
- class a ~# b => (a :: k) ~ (b :: k)
- class Typeable (a :: k)
- module Data.Void
- seq :: a -> b -> b
- ord :: Char -> Int
- ($!) :: (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
- module GHC.OverloadedLabels
- getStackTrace :: IO (Maybe [Location])
- showStackTrace :: IO (Maybe String)
- data CallStack
- type HasCallStack = ?callStack :: CallStack
- getCallStack :: CallStack -> [([Char], SrcLoc)]
- currentCallStack :: IO [String]
- prettySrcLoc :: SrcLoc -> String
- prettyCallStack :: CallStack -> String
- callStack :: HasCallStack => CallStack
- withFrozenCallStack :: HasCallStack => (HasCallStack => a) -> a
Base types
The character type Char
represents Unicode codespace
and its elements are code points as in definitions
D9 and D10 of the Unicode Standard.
Character literals in Haskell are single-quoted: 'Q'
, 'Я'
or 'Ω'
.
To represent a single quote itself use '\''
, and to represent a backslash
use '\\'
. The full grammar can be found in the section 2.6 of the
Haskell 2010 Language Report.
To specify a character by its code point one can use decimal, hexadecimal
or octal notation: '\65'
, '\x41'
and '\o101'
are all alternative forms
of 'A'
. The largest code point is '\x10ffff'
.
There is a special escape syntax for ASCII control characters:
Escape | Alternatives | Meaning |
---|---|---|
'\NUL' | '\0' | null character |
'\SOH' | '\1' | start of heading |
'\STX' | '\2' | start of text |
'\ETX' | '\3' | end of text |
'\EOT' | '\4' | end of transmission |
'\ENQ' | '\5' | enquiry |
'\ACK' | '\6' | acknowledge |
'\BEL' | '\7' , '\a' | bell (alert) |
'\BS' | '\8' , '\b' | backspace |
'\HT' | '\9' , '\t' | horizontal tab |
'\LF' | '\10' , '\n' | line feed (new line) |
'\VT' | '\11' , '\v' | vertical tab |
'\FF' | '\12' , '\f' | form feed |
'\CR' | '\13' , '\r' | carriage return |
'\SO' | '\14' | shift out |
'\SI' | '\15' | shift in |
'\DLE' | '\16' | data link escape |
'\DC1' | '\17' | device control 1 |
'\DC2' | '\18' | device control 2 |
'\DC3' | '\19' | device control 3 |
'\DC4' | '\20' | device control 4 |
'\NAK' | '\21' | negative acknowledge |
'\SYN' | '\22' | synchronous idle |
'\ETB' | '\23' | end of transmission block |
'\CAN' | '\24' | cancel |
'\EM' | '\25' | end of medium |
'\SUB' | '\26' | substitute |
'\ESC' | '\27' | escape |
'\FS' | '\28' | file separator |
'\GS' | '\29' | group separator |
'\RS' | '\30' | record separator |
'\US' | '\31' | unit separator |
'\SP' | '\32' , ' ' | space |
'\DEL' | '\127' | delete |
Instances
IsChar Char | Since: base-2.1 | ||||
PrintfArg Char | Since: base-2.1 | ||||
Defined in Text.Printf formatArg :: Char -> FieldFormatter # parseFormat :: Char -> ModifierParser # | |||||
NFData Char | |||||
Defined in Control.DeepSeq | |||||
Data Char | @since base-4.0.0.0 | ||||
Defined in GHC.Internal.Data.Data 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.01 | ||||
Enum Char | @since base-2.01 | ||||
Read Char | @since base-2.01 | ||||
Show Char | @since base-2.01 | ||||
Eq Char | |||||
Ord Char | |||||
Hashable Char | |||||
Defined in Data.Hashable.Class | |||||
ToLText String Source # | |||||
ToString String Source # | |||||
ToText String Source # | |||||
ConvertUtf8 String ByteString Source # | |||||
Defined in Relude.String.Conversion 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 | |||||
ConvertUtf8 String LByteString Source # | Converting | ||||
Defined in Relude.String.Conversion | |||||
Lift Char | |||||
Generic1 (URec Char :: k -> Type) | |||||
Defined in GHC.Internal.Generics
| |||||
Foldable (UChar :: Type -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Data.Foldable 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) | |||||
Defined in GHC.Internal.Generics
| |||||
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.Internal.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 GHC.Internal.Data.Type.Ord | |||||
type Rep1 (URec Char :: k -> Type) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics | |||||
type Rep (URec Char p) | @since base-4.9.0.0 | ||||
Defined in GHC.Internal.Generics |
Base type classes
module Data.Eq
Instances
NFData Ordering | |
Defined in Control.DeepSeq | |
Monoid Ordering | @since base-2.01 |
Semigroup Ordering | @since base-4.9.0.0 |
Data Ordering | @since base-4.0.0.0 |
Defined in GHC.Internal.Data.Data 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 # | |
Bounded Ordering | @since base-2.01 |
Enum Ordering | @since base-2.01 |
Generic Ordering | |
Defined in GHC.Internal.Generics | |
Read Ordering | @since base-2.01 |
Show Ordering | @since base-2.01 |
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 <= 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.
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 |
Defined in Data.Array.Byte | |
Ord ByteString | |
Defined in Data.ByteString.Internal.Type 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 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 | Lexicographic order. |
Defined in Data.ByteString.Short.Internal 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 BigNat | |
Ord Extension | |
Defined in GHC.LanguageExtensions.Type | |
Ord Void | @since base-4.8.0.0 |
Ord BlockReason | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync 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.Internal.Conc.Sync | |
Ord ThreadStatus | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync 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 All | @since base-2.01 |
Ord Any | @since base-2.01 |
Ord SomeTypeRep | |
Defined in GHC.Internal.Data.Typeable.Internal 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.01 |
Ord ErrorCall | @since base-4.7.0.0 |
Defined in GHC.Internal.Exception | |
Ord ArithException | @since base-3.0 |
Defined in GHC.Internal.Exception.Type 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.Internal.Generics 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.Internal.Generics 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.Internal.Generics 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.Internal.Generics 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.Internal.IO.Exception 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.Internal.IO.Exception 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.Internal.IO.Exception | |
Ord BufferMode | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Handle.Types 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 |
Defined in GHC.Internal.IO.Handle.Types | |
Ord NewlineMode | @since base-4.3.0.0 |
Defined in GHC.Internal.IO.Handle.Types 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.01 |
Ord Int32 | @since base-2.01 |
Ord Int64 | @since base-2.01 |
Ord Int8 | @since base-2.01 |
Ord SomeNat | @since base-4.7.0.0 |
Ord Word16 | @since base-2.01 |
Ord Word32 | @since base-2.01 |
Ord Word64 | @since base-2.01 |
Ord Word8 | @since base-2.01 |
Ord Ordering | |
Defined in GHC.Classes | |
Ord TyCon | |
Ord OsChar | Byte ordering of the internal representation. |
Ord OsString | Byte ordering of the internal representation. |
Defined in System.OsString.Internal.Types | |
Ord PosixChar | |
Defined in System.OsString.Internal.Types | |
Ord PosixString | |
Defined in System.OsString.Internal.Types 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 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 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 Undefined Source # | |
Defined in Relude.Debug | |
Ord AnnLookup | |
Defined in Language.Haskell.TH.Syntax | |
Ord AnnTarget | |
Defined in Language.Haskell.TH.Syntax | |
Ord Bang | |
Ord BndrVis | |
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 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 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 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 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 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 | |
Ord FunDep | |
Ord Guard | |
Ord Info | |
Ord InjectivityAnn | |
Defined in Language.Haskell.TH.Syntax 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 | |
Ord Module | |
Ord ModuleInfo | |
Defined in Language.Haskell.TH.Syntax 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 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 | |
Defined in Language.Haskell.TH.Syntax | |
Ord NamespaceSpecifier | |
Defined in Language.Haskell.TH.Syntax compare :: NamespaceSpecifier -> NamespaceSpecifier -> Ordering # (<) :: NamespaceSpecifier -> NamespaceSpecifier -> Bool # (<=) :: NamespaceSpecifier -> NamespaceSpecifier -> Bool # (>) :: NamespaceSpecifier -> NamespaceSpecifier -> Bool # (>=) :: NamespaceSpecifier -> NamespaceSpecifier -> Bool # max :: NamespaceSpecifier -> NamespaceSpecifier -> NamespaceSpecifier # min :: NamespaceSpecifier -> NamespaceSpecifier -> NamespaceSpecifier # | |
Ord OccName | |
Ord Overlap | |
Ord Pat | |
Ord PatSynArgs | |
Defined in Language.Haskell.TH.Syntax 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 | |
Defined in Language.Haskell.TH.Syntax | |
Ord Phases | |
Ord PkgName | |
Ord Pragma | |
Ord Range | |
Ord Role | |
Ord RuleBndr | |
Defined in Language.Haskell.TH.Syntax | |
Ord RuleMatch | |
Defined in Language.Haskell.TH.Syntax | |
Ord Safety | |
Ord SourceStrictness | |
Defined in Language.Haskell.TH.Syntax 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 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 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 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 I8 | |
Ord Builder | |
Ord Integer | |
Ord Natural | |
Ord () | |
Ord Bool | |
Ord Char | |
Ord Double | IEEE 754 IEEE 754-2008, section 5.11 requires that if at least one of arguments of
IEEE 754-2008, section 5.10 defines Thus, users must be extremely cautious when using Moving further, the behaviour of IEEE 754-2008 compliant |
Ord Float | See |
Ord Int | |
Ord Word | |
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 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 (IntMap a) | |
Defined in Data.IntMap.Internal | |
Ord a => Ord (Seq a) | |
Ord a => Ord (ViewL a) | |
Ord a => Ord (ViewR a) | |
Ord a => Ord (Intersection a) | |
Defined in Data.Set.Internal 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 (NonEmpty a) | @since base-4.9.0.0 |
Ord a => Ord (Identity a) | @since base-4.8.0.0 |
Defined in GHC.Internal.Data.Functor.Identity | |
Ord a => Ord (First a) | @since base-2.01 |
Ord a => Ord (Last a) | @since base-2.01 |
Ord a => Ord (Down a) | @since base-4.6.0.0 |
Ord a => Ord (Dual a) | @since base-2.01 |
Ord a => Ord (Product a) | @since base-2.01 |
Defined in GHC.Internal.Data.Semigroup.Internal | |
Ord a => Ord (Sum a) | @since base-2.01 |
Ord a => Ord (ZipList a) | @since base-4.7.0.0 |
Defined in GHC.Internal.Functor.ZipList | |
Ord p => Ord (Par1 p) | @since base-4.7.0.0 |
Integral a => Ord (Ratio a) | @since base-2.0.1 |
Ord (SNat n) | @since base-4.19.0.0 |
Ord a => Ord (Hashed a) | |
Defined in Data.Hashable.Class | |
Ord a => Ord (HashSet a) | |
Defined in Data.HashSet.Internal | |
Ord flag => Ord (TyVarBndr flag) | |
Defined in Language.Haskell.TH.Syntax 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 (Stream a) | |
Defined in Data.Text.Internal.Fusion.Types | |
Ord a => Ord (Maybe a) | @since base-2.01 |
Ord a => Ord (Solo a) | |
Ord a => Ord [a] | |
Ord (Fixed a) | Since: base-2.1 |
Ord a => Ord (Arg a b) | Since: base-4.9.0.0 |
(Ord k, Ord v) => Ord (Map k v) | |
(Ord a, Ord b) => Ord (Either a b) | @since base-2.01 |
Ord (Proxy s) | @since base-4.7.0.0 |
Ord (TypeRep a) | @since base-4.4.0.0 |
Defined in GHC.Internal.Data.Typeable.Internal | |
Ord (U1 p) | @since base-4.7.0.0 |
Ord (V1 p) | @since base-4.9.0.0 |
(Ord k, Ord v) => Ord (HashMap k v) | The ordering is total and consistent with the |
Defined in Data.HashMap.Internal | |
(Ord1 f, Ord a) => Ord (Lift f a) | |
Defined in Control.Applicative.Lift | |
(Ord1 m, Ord a) => Ord (MaybeT m a) | |
(Ord a, Ord b) => Ord (a, b) | |
Ord a => Ord (Const a b) | @since base-4.9.0.0 |
Defined in GHC.Internal.Data.Functor.Const | |
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 GHC.Internal.Data.Semigroup.Internal | |
(Generic1 f, Ord (Rep1 f a)) => Ord (Generically1 f a) | @since base-4.18.0.0 |
Defined in GHC.Internal.Generics 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.Internal.Generics | |
Ord (URec (Ptr ()) p) | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics 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.Internal.Generics | |
Ord (URec Double p) | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics 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.Internal.Generics | |
Ord (URec Int p) | @since base-4.9.0.0 |
Ord (URec Word p) | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics | |
(Ord1 f, Ord a) => Ord (Backwards f a) | |
Defined in Control.Applicative.Backwards compare :: Backwards f a -> Backwards f a -> Ordering # (<) :: Backwards f a -> Backwards f a -> Bool # (<=) :: Backwards f a -> Backwards f a -> Bool # (>) :: Backwards f a -> Backwards f a -> Bool # (>=) :: Backwards f a -> Backwards f a -> Bool # | |
(Ord e, Ord1 m, Ord a) => Ord (ExceptT e m a) | |
Defined in Control.Monad.Trans.Except 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 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 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 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 (Constant a b) | |
Defined in Data.Functor.Constant | |
(Ord1 f, Ord a) => Ord (Reverse f a) | |
Defined in Data.Functor.Reverse | |
(Ord a, Ord b, Ord c) => Ord (a, b, c) | |
Defined in GHC.Classes | |
(Ord (f a), Ord (g a)) => Ord (Product f g a) | Since: base-4.18.0.0 |
Defined in Data.Functor.Product 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 |
Defined in Data.Functor.Sum | |
(Ord (f p), Ord (g p)) => Ord ((f :*: g) p) | @since base-4.7.0.0 |
Defined in GHC.Internal.Generics | |
(Ord (f p), Ord (g p)) => Ord ((f :+: g) p) | @since base-4.7.0.0 |
Defined in GHC.Internal.Generics | |
Ord c => Ord (K1 i c p) | @since base-4.7.0.0 |
Defined in GHC.Internal.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 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.Internal.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 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 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 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 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 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 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 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 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 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 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 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: Ord
then sortWith by
.Down
x
>>>
compare True False
GT
>>>
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 Int
Down 9223372036854775807
All other instances of
behave as they do for Down
aa
.
@since base-4.6.0.0
Instances
MonadZip Down | Since: base-4.12.0.0 | ||||
Foldable1 Down | Since: base-4.18.0.0 | ||||
Defined in Data.Foldable1 fold1 :: Semigroup m => Down m -> m # foldMap1 :: Semigroup m => (a -> m) -> Down a -> m # foldMap1' :: Semigroup m => (a -> m) -> Down a -> m # toNonEmpty :: Down a -> NonEmpty a # maximum :: Ord a => Down a -> a # minimum :: Ord a => Down a -> a # foldrMap1 :: (a -> b) -> (a -> b -> b) -> Down a -> b # foldlMap1' :: (a -> b) -> (b -> a -> b) -> Down a -> b # foldlMap1 :: (a -> b) -> (b -> a -> b) -> Down a -> b # foldrMap1' :: (a -> b) -> (a -> b -> b) -> Down a -> b # | |||||
Eq1 Down | Since: base-4.12.0.0 | ||||
Ord1 Down | Since: base-4.12.0.0 | ||||
Defined in Data.Functor.Classes | |||||
Read1 Down | Since: base-4.12.0.0 | ||||
Defined in Data.Functor.Classes | |||||
Show1 Down | Since: base-4.12.0.0 | ||||
NFData1 Down | Since: deepseq-1.4.3.0 | ||||
Defined in Control.DeepSeq | |||||
Applicative Down | @since base-4.11.0.0 | ||||
Functor Down | @since base-4.11.0.0 | ||||
Monad Down | @since base-4.11.0.0 | ||||
Foldable Down | @since base-4.12.0.0 | ||||
Defined in GHC.Internal.Data.Foldable 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 | ||||
Generic1 Down | |||||
Defined in GHC.Internal.Generics
| |||||
NFData a => NFData (Down a) | Since: deepseq-1.4.0.0 | ||||
Defined in Control.DeepSeq | |||||
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 GHC.Internal.Data.Ord (.&.) :: 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 GHC.Internal.Data.Ord finiteBitSize :: Down a -> Int # countLeadingZeros :: Down a -> Int # countTrailingZeros :: Down a -> Int # | |||||
Data a => Data (Down a) | @since base-4.12.0.0 | ||||
Defined in GHC.Internal.Data.Data 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) # | |||||
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 GHC.Internal.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 GHC.Internal.Data.Ord 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 # | |||||
Storable a => Storable (Down a) | @since base-4.14.0.0 | ||||
Generic (Down a) | |||||
Defined in GHC.Internal.Generics
| |||||
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 GHC.Internal.Data.Ord 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 | ||||
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.Internal.Generics | |||||
type Rep (Down a) | @since base-4.12.0.0 | ||||
Defined in GHC.Internal.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
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
module Data.Coerce
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 Either
Proxy
>>>
Proxy :: Proxy Functor
Proxy
>>>
Proxy :: Proxy complicatedStructure
Proxy
Instances
Generic1 (Proxy :: k -> Type) | |
Defined in GHC.Internal.Generics | |
MonadZip (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Eq1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Ord1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
Read1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Defined in Data.Functor.Classes | |
Show1 (Proxy :: Type -> Type) | Since: base-4.9.0.0 |
Contravariant (Proxy :: Type -> Type) | |
NFData1 (Proxy :: Type -> Type) | Since: deepseq-1.4.3.0 |
Defined in Control.DeepSeq | |
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 |
Foldable (Proxy :: Type -> Type) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Foldable 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 # | |
Traversable (Proxy :: Type -> Type) | @since base-4.7.0.0 |
Hashable1 (Proxy :: Type -> Type) | |
Defined in Data.Hashable.Class | |
NFData (Proxy a) | Since: deepseq-1.4.0.0 |
Defined in Control.DeepSeq | |
Monoid (Proxy s) | @since base-4.7.0.0 |
Semigroup (Proxy s) | @since base-4.9.0.0 |
Data t => Data (Proxy t) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Data 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) # | |
Bounded (Proxy t) | @since base-4.7.0.0 |
Enum (Proxy s) | @since base-4.7.0.0 |
Generic (Proxy t) | |
Defined in GHC.Internal.Generics | |
Ix (Proxy s) | @since base-4.7.0.0 |
Defined in GHC.Internal.Data.Proxy | |
Read (Proxy t) | @since base-4.7.0.0 |
Show (Proxy s) | @since base-4.7.0.0 |
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.
typeRep#
module Data.Void
Basic type classes
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.
($!) :: (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
≡id
to
.from
≡id
Instances
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 ByteArray | Since: base-4.17.0.0 |
Show Timeout | Since: base-4.0 |
Show FormatMode | |
Show ByteString | |
Defined in Data.ByteString.Internal.Type showsPrec :: Int -> ByteString -> ShowS # show :: ByteString -> String # showList :: [ByteString] -> ShowS # | |
Show SizeOverflowException | |
Defined in Data.ByteString.Internal.Type showsPrec :: Int -> SizeOverflowException -> ShowS # show :: SizeOverflowException -> String # showList :: [SizeOverflowException] -> ShowS # | |
Show ByteString | |
Defined in Data.ByteString.Lazy.Internal showsPrec :: Int -> ByteString -> ShowS # show :: ByteString -> String # showList :: [ByteString] -> ShowS # | |
Show ShortByteString | |
Defined in Data.ByteString.Short.Internal showsPrec :: Int -> ShortByteString -> ShowS # show :: ShortByteString -> String # showList :: [ShortByteString] -> ShowS # | |
Show IntSet | |
Show BitQueue | |
Show BitQueueB | |
Show ForeignSrcLang | |
Defined in GHC.ForeignSrcLang.Type showsPrec :: Int -> ForeignSrcLang -> ShowS # show :: ForeignSrcLang -> String # showList :: [ForeignSrcLang] -> ShowS # | |
Show Extension | |
Show Void | @since base-4.8.0.0 |
Show BlockReason | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync showsPrec :: Int -> BlockReason -> ShowS # show :: BlockReason -> String # showList :: [BlockReason] -> ShowS # | |
Show ThreadId | @since base-4.2.0.0 |
Show ThreadStatus | @since base-4.3.0.0 |
Defined in GHC.Internal.Conc.Sync showsPrec :: Int -> ThreadStatus -> ShowS # show :: ThreadStatus -> String # showList :: [ThreadStatus] -> ShowS # | |
Show Constr | @since base-4.0.0.0 |
Show ConstrRep | @since base-4.0.0.0 |
Show DataRep | @since base-4.0.0.0 |
Show DataType | @since base-4.0.0.0 |
Show Fixity | @since base-4.0.0.0 |
Show All | @since base-2.01 |
Show Any | @since base-2.01 |
Show SomeTypeRep | @since base-4.10.0.0 |
Defined in GHC.Internal.Data.Typeable.Internal showsPrec :: Int -> SomeTypeRep -> ShowS # show :: SomeTypeRep -> String # showList :: [SomeTypeRep] -> ShowS # | |
Show Version | @since base-2.01 |
Show ErrorCall | @since base-4.0.0.0 |
Show ArithException | @since base-4.0.0.0 |
Defined in GHC.Internal.Exception.Type showsPrec :: Int -> ArithException -> ShowS # show :: ArithException -> String # showList :: [ArithException] -> ShowS # | |
Show SomeException | Since: ghc-internal-3.0 |
Defined in GHC.Internal.Exception.Type showsPrec :: Int -> SomeException -> ShowS # show :: SomeException -> String # showList :: [SomeException] -> ShowS # | |
Show Associativity | @since base-4.6.0.0 |
Defined in GHC.Internal.Generics showsPrec :: Int -> Associativity -> ShowS # show :: Associativity -> String # showList :: [Associativity] -> ShowS # | |
Show DecidedStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics showsPrec :: Int -> DecidedStrictness -> ShowS # show :: DecidedStrictness -> String # showList :: [DecidedStrictness] -> ShowS # | |
Show Fixity | @since base-4.6.0.0 |
Show SourceStrictness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics showsPrec :: Int -> SourceStrictness -> ShowS # show :: SourceStrictness -> String # showList :: [SourceStrictness] -> ShowS # | |
Show SourceUnpackedness | @since base-4.9.0.0 |
Defined in GHC.Internal.Generics showsPrec :: Int -> SourceUnpackedness -> ShowS # show :: SourceUnpackedness -> String # showList :: [SourceUnpackedness] -> ShowS # | |
Show MaskingState | @since base-4.3.0.0 |
Defined in GHC.Internal.IO showsPrec :: Int -> MaskingState -> ShowS # show :: MaskingState -> String # showList :: [MaskingState] -> ShowS # | |
Show AllocationLimitExceeded | @since base-4.7.1.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> AllocationLimitExceeded -> ShowS # show :: AllocationLimitExceeded -> String # showList :: [AllocationLimitExceeded] -> ShowS # | |
Show ArrayException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> ArrayException -> ShowS # show :: ArrayException -> String # showList :: [ArrayException] -> ShowS # | |
Show AssertionFailed | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> AssertionFailed -> ShowS # show :: AssertionFailed -> String # showList :: [AssertionFailed] -> ShowS # | |
Show AsyncException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> AsyncException -> ShowS # show :: AsyncException -> String # showList :: [AsyncException] -> ShowS # | |
Show BlockedIndefinitelyOnMVar | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> BlockedIndefinitelyOnMVar -> ShowS # show :: BlockedIndefinitelyOnMVar -> String # showList :: [BlockedIndefinitelyOnMVar] -> ShowS # | |
Show BlockedIndefinitelyOnSTM | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> BlockedIndefinitelyOnSTM -> ShowS # show :: BlockedIndefinitelyOnSTM -> String # showList :: [BlockedIndefinitelyOnSTM] -> ShowS # | |
Show CompactionFailed | @since base-4.10.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> CompactionFailed -> ShowS # show :: CompactionFailed -> String # showList :: [CompactionFailed] -> ShowS # | |
Show Deadlock | @since base-4.1.0.0 |
Show ExitCode | |
Show FixIOException | @since base-4.11.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> FixIOException -> ShowS # show :: FixIOException -> String # showList :: [FixIOException] -> ShowS # | |
Show IOErrorType | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> IOErrorType -> ShowS # show :: IOErrorType -> String # showList :: [IOErrorType] -> ShowS # | |
Show IOException | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> IOException -> ShowS # show :: IOException -> String # showList :: [IOException] -> ShowS # | |
Show SomeAsyncException | @since base-4.7.0.0 |
Defined in GHC.Internal.IO.Exception showsPrec :: Int -> SomeAsyncException -> ShowS # show :: SomeAsyncException -> String # showList :: [SomeAsyncException] -> ShowS # | |
Show HandlePosn | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Handle showsPrec :: Int -> HandlePosn -> ShowS # show :: HandlePosn -> String # showList :: [HandlePosn] -> ShowS # | |
Show BufferMode | @since base-4.2.0.0 |
Defined in GHC.Internal.IO.Handle.Types showsPrec :: Int -> BufferMode -> ShowS # show :: BufferMode -> String # showList :: [BufferMode] -> ShowS # | |
Show Handle | @since base-4.1.0.0 |
Show HandleType | @since base-4.1.0.0 |
Defined in GHC.Internal.IO.Handle.Types showsPrec :: Int -> HandleType -> ShowS # show :: HandleType -> String # showList :: [HandleType] -> ShowS # | |
Show Newline | @since base-4.3.0.0 |
Show NewlineMode | @since base-4.3.0.0 |
Defined in GHC.Internal.IO.Handle.Types showsPrec :: Int -> NewlineMode -> ShowS # show :: NewlineMode -> String # showList :: [NewlineMode] -> ShowS # | |
Show IOMode | @since base-4.2.0.0 |
Show Int16 | @since base-2.01 |
Show Int32 | @since base-2.01 |
Show Int64 | @since base-2.01 |
Show Int8 | @since base-2.01 |
Show CCFlags | @since base-4.8.0.0 |
Show ConcFlags | @since base-4.8.0.0 |
Show DebugFlags | @since base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags showsPrec :: Int -> DebugFlags -> ShowS # show :: DebugFlags -> String # showList :: [DebugFlags] -> ShowS # | |
Show DoCostCentres | @since base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags showsPrec :: Int -> DoCostCentres -> ShowS # show :: DoCostCentres -> String # showList :: [DoCostCentres] -> ShowS # | |
Show DoHeapProfile | @since base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags showsPrec :: Int -> DoHeapProfile -> ShowS # show :: DoHeapProfile -> String # showList :: [DoHeapProfile] -> ShowS # | |
Show DoTrace | @since base-4.8.0.0 |
Show GCFlags | @since base-4.8.0.0 |
Show GiveGCStats | @since base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags showsPrec :: Int -> GiveGCStats -> ShowS # show :: GiveGCStats -> String # showList :: [GiveGCStats] -> ShowS # | |
Show HpcFlags | @since base-4.20.0.0 |
Show IoSubSystem | |
Defined in GHC.Internal.RTS.Flags showsPrec :: Int -> IoSubSystem -> ShowS # show :: IoSubSystem -> String # showList :: [IoSubSystem] -> ShowS # | |
Show MiscFlags | @since base-4.8.0.0 |
Show ParFlags | @since base-4.8.0.0 |
Show ProfFlags | @since base-4.8.0.0 |
Show RTSFlags | @since base-4.8.0.0 |
Show TickyFlags | @since base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags showsPrec :: Int -> TickyFlags -> ShowS # show :: TickyFlags -> String # showList :: [TickyFlags] -> ShowS # | |
Show TraceFlags | @since base-4.8.0.0 |
Defined in GHC.Internal.RTS.Flags showsPrec :: Int -> TraceFlags -> ShowS # show :: TraceFlags -> String # showList :: [TraceFlags] -> ShowS # | |
Show FractionalExponentBase | |
Defined in GHC.Internal.Real showsPrec :: Int -> FractionalExponentBase -> ShowS # show :: FractionalExponentBase -> String # showList :: [FractionalExponentBase] -> ShowS # | |
Show CallStack | @since base-4.9.0.0 |
Show SrcLoc | @since base-4.9.0.0 |
Show Lexeme | @since base-2.01 |
Show Number | @since base-4.6.0.0 |
Show SomeNat | @since base-4.7.0.0 |
Show Word16 | @since base-2.01 |
Show Word32 | @since base-2.01 |
Show Word64 | @since base-2.01 |
Show Word8 | @since base-2.01 |
Show KindRep | |
Show Module | @since base-4.9.0.0 |
Show Ordering | @since base-2.01 |
Show TrName | @since base-4.9.0.0 |
Show TyCon | @since base-2.01 |
Show TypeLitSort | @since base-4.11.0.0 |
Defined in GHC.Internal.Show showsPrec :: Int -> TypeLitSort -> ShowS # show :: TypeLitSort -> String # showList :: [TypeLitSort] -> ShowS # | |
Show SubHashPath | |
Defined in Data.HashMap.Internal.Debug showsPrec :: Int -> SubHashPath -> ShowS # show :: SubHashPath -> String # showList :: [SubHashPath] -> ShowS # | |
Show OsChar | |
Show OsString | On windows, decodes as UCS-2. On unix prints the raw bytes without decoding. |
Show PosixChar | |
Show PosixString | Prints the raw bytes without decoding. |
Defined in System.OsString.Internal.Types showsPrec :: Int -> PosixString -> ShowS # show :: PosixString -> String # showList :: [PosixString] -> ShowS # | |
Show WindowsChar | |
Defined in System.OsString.Internal.Types showsPrec :: Int -> WindowsChar -> ShowS # show :: WindowsChar -> String # showList :: [WindowsChar] -> ShowS # | |
Show WindowsString | Decodes as UCS-2. |
Defined in System.OsString.Internal.Types showsPrec :: Int -> WindowsString -> ShowS # show :: WindowsString -> String # showList :: [WindowsString] -> ShowS # | |
Show Mode | |
Show Style | |
Show TextDetails | |
Defined in Text.PrettyPrint.Annotated.HughesPJ showsPrec :: Int -> TextDetails -> ShowS # show :: TextDetails -> String # showList :: [TextDetails] -> ShowS # | |
Show Doc | |
Show Undefined Source # | |
Show Bug Source # | |
Show AnnLookup | |
Show AnnTarget | |
Show Bang | |
Show BndrVis | |
Show Body | |
Show Bytes | |
Show Callconv | |
Show Clause | |
Show Con | |
Show Dec | |
Show DecidedStrictness | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> DecidedStrictness -> ShowS # show :: DecidedStrictness -> String # showList :: [DecidedStrictness] -> ShowS # | |
Show DerivClause | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> DerivClause -> ShowS # show :: DerivClause -> String # showList :: [DerivClause] -> ShowS # | |
Show DerivStrategy | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> DerivStrategy -> ShowS # show :: DerivStrategy -> String # showList :: [DerivStrategy] -> ShowS # | |
Show DocLoc | |
Show Exp | |
Show FamilyResultSig | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> FamilyResultSig -> ShowS # show :: FamilyResultSig -> String # showList :: [FamilyResultSig] -> ShowS # | |
Show Fixity | |
Show FixityDirection | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> FixityDirection -> ShowS # show :: FixityDirection -> String # showList :: [FixityDirection] -> ShowS # | |
Show Foreign | |
Show FunDep | |
Show Guard | |
Show Info | |
Show InjectivityAnn | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> InjectivityAnn -> ShowS # show :: InjectivityAnn -> String # showList :: [InjectivityAnn] -> ShowS # | |
Show Inline | |
Show Lit | |
Show Loc | |
Show Match | |
Show ModName | |
Show Module | |
Show ModuleInfo | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> ModuleInfo -> ShowS # show :: ModuleInfo -> String # showList :: [ModuleInfo] -> ShowS # | |
Show Name | |
Show NameFlavour | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> NameFlavour -> ShowS # show :: NameFlavour -> String # showList :: [NameFlavour] -> ShowS # | |
Show NameSpace | |
Show NamespaceSpecifier | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> NamespaceSpecifier -> ShowS # show :: NamespaceSpecifier -> String # showList :: [NamespaceSpecifier] -> ShowS # | |
Show OccName | |
Show Overlap | |
Show Pat | |
Show PatSynArgs | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> PatSynArgs -> ShowS # show :: PatSynArgs -> String # showList :: [PatSynArgs] -> ShowS # | |
Show PatSynDir | |
Show Phases | |
Show PkgName | |
Show Pragma | |
Show Range | |
Show Role | |
Show RuleBndr | |
Show RuleMatch | |
Show Safety | |
Show SourceStrictness | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> SourceStrictness -> ShowS # show :: SourceStrictness -> String # showList :: [SourceStrictness] -> ShowS # | |
Show SourceUnpackedness | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> SourceUnpackedness -> ShowS # show :: SourceUnpackedness -> String # showList :: [SourceUnpackedness] -> ShowS # | |
Show Specificity | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> Specificity -> ShowS # show :: Specificity -> String # showList :: [Specificity] -> ShowS # | |
Show Stmt | |
Show TyLit | |
Show TySynEqn | |
Show Type | |
Show TypeFamilyHead | |
Defined in Language.Haskell.TH.Syntax showsPrec :: Int -> TypeFamilyHead -> ShowS # show :: TypeFamilyHead -> String # showList :: [TypeFamilyHead] -> ShowS # | |
Show Decoding | |
Show UnicodeException | |
Defined in Data.Text.Encoding.Error showsPrec :: Int -> UnicodeException -> ShowS # show :: UnicodeException -> String # showList :: [UnicodeException] -> ShowS # | |
Show I8 | |
Show Builder | |
Show PartialUtf8CodePoint | |
Show Utf8State | |
Show DecoderState | |
Defined in Data.Text.Internal.Encoding.Utf8 showsPrec :: Int -> DecoderState -> ShowS # show :: DecoderState -> String # showList :: [DecoderState] -> ShowS # | |
Show Size | |
Show FPFormat | |
Show Iter | |
Show Integer | @since base-2.01 |
Show Natural | @since base-4.8.0.0 |
Show () | @since base-2.01 |
Show Bool | @since base-2.01 |
Show Char | @since base-2.01 |
Show Int | @since base-2.01 |
Show Levity | @since base-4.15.0.0 |
Show RuntimeRep | @since base-4.11.0.0 |
Defined in GHC.Internal.Show showsPrec :: Int -> RuntimeRep -> ShowS # show :: RuntimeRep -> String # showList :: [RuntimeRep] -> ShowS # | |
Show VecCount | @since base-4.11.0.0 |
Show VecElem | @since base-4.11.0.0 |
Show Word | @since base-2.01 |
Show a => Show (Complex a) | Since: base-2.1 |
Show a => Show (First a) | Since: base-4.9.0.0 |
Show a => Show (Last a) | Since: base-4.9.0.0 |
Show a => Show (Max a) | Since: base-4.9.0.0 |
Show a => Show (Min a) | Since: base-4.9.0.0 |
Show m => Show (WrappedMonoid m) | Since: base-4.9.0.0 |
Defined in Data.Semigroup showsPrec :: Int -> WrappedMonoid m -> ShowS # show :: WrappedMonoid m -> String # showList :: [WrappedMonoid m] -> ShowS # | |
Show vertex => Show (SCC vertex) | Since: containers-0.5.9 |
Show a => Show (IntMap a) | |
Show a => Show (Seq a) | |
Show a => Show (ViewL a) | |
Show a => Show (ViewR a) | |
Show a => Show (Intersection a) | |
Defined in Data.Set.Internal showsPrec :: Int -> Intersection a -> ShowS # show :: Intersection a -> String # showList :: [Intersection a] -> ShowS # | |
Show a => Show (Set a) | |
Show a => Show (Tree a) | |
Show a => Show (NonEmpty a) | @since base-4.11.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 a => Show (First a) | @since base-2.01 |
Show a => Show (Last a) | @since base-2.01 |
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 (Dual a) | @since base-2.01 |
Show a => Show (Product a) | @since base-2.01 |
Show a => Show (Sum a) | @since base-2.01 |
Show a => Show (ExceptionWithContext a) | |
Defined in GHC.Internal.Exception.Type showsPrec :: Int -> ExceptionWithContext a -> ShowS # show :: ExceptionWithContext a -> String # showList :: [ExceptionWithContext a] -> ShowS # | |
Show e => Show (NoBacktrace e) | |
Defined in GHC.Internal.Exception.Type showsPrec :: Int -> NoBacktrace e -> ShowS # show :: NoBacktrace e -> String # showList :: [NoBacktrace e] -> ShowS # | |
Show a => Show (ZipList a) | @since base-4.7.0.0 |
Show p => Show (Par1 p) | @since base-4.7.0.0 |
Show a => Show (Ratio a) | @since base-2.0.1 |
Show (SNat n) | @since base-4.18.0.0 |
Show a => Show (Hashed a) | |
Show a => Show (Array a) | |
Show k => Show (Error k) | |
Show k => Show (Validity k) | |
Show a => Show (HashSet a) | |
Show a => Show (AnnotDetails a) | |
Defined in Text.PrettyPrint.Annotated.HughesPJ showsPrec :: Int -> AnnotDetails a -> ShowS # show :: AnnotDetails a -> String # showList :: [AnnotDetails a] -> ShowS # | |
Show (Doc a) | |
Show a => Show (Span a) | |
Show flag => Show (TyVarBndr flag) | |
Show a => Show (Maybe a) | @since base-2.01 |
Show a => Show (Solo a) | @since base-4.15 |
Show a => Show [a] | @since base-2.01 |
HasResolution a => Show (Fixed a) | Since: base-2.1 |
(Show a, Show b) => Show (Arg a b) | Since: base-4.9.0.0 |
(Show k, Show a) => Show (Map k a) | |
(Show a, Show b) => Show (Either a b) | @since base-3.0 |
Show (Proxy s) | @since base-4.7.0.0 |
Show (TypeRep a) | |
Show (U1 p) | @since base-4.9.0.0 |
Show (V1 p) | @since base-4.9.0.0 |
(Show k, Show v) => Show (HashMap k v) | |
(Show1 f, Show a) => Show (Lift f a) | |
(Show1 m, Show a) => Show (MaybeT m a) | |
(Show a, Show b) => Show (a, b) | @since base-2.01 |
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 (OrderingI a b) | |
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 |
(Show1 f, Show a) => Show (Backwards f a) | |
(Show e, Show1 m, Show a) => Show (ExceptT e m a) | |
(Show1 f, Show a) => Show (IdentityT f a) | |
(Show w, Show1 m, Show a) => Show (WriterT w m a) | |
(Show w, Show1 m, Show a) => Show (WriterT w m a) | |
Show a => Show (Constant a b) | |
(Show1 f, Show a) => Show (Reverse f a) | |
(Show a, Show b, Show c) => Show (a, b, c) | @since base-2.01 |
(Show (f a), Show (g a)) => Show (Product f g a) | Since: base-4.18.0.0 |
(Show (f a), Show (g a)) => Show (Sum f g a) | Since: base-4.18.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 c => Show (K1 i c p) | @since base-4.7.0.0 |
(Show a, Show b, Show c, Show d) => Show (a, b, c, d) | @since base-2.01 |
Show (f (g a)) => Show (Compose f g a) | Since: base-4.18.0.0 |
Show (f (g p)) => Show ((f :.: g) p) | @since base-4.7.0.0 |
Show (f p) => Show (M1 i c f 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.01 |
(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f) | @since base-2.01 |
(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.01 |
(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.01 |
(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.01 |
(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.01 |
(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.01 |
(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.01 |
(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.01 |
(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.01 |
(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.01 |
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
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
.
Previously, 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
module GHC.OverloadedLabels
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.
CallStack
s 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
CallStack
in scope -- i.e. the enclosing function has aHasCallStack
constraint -- GHC will append the new call-site to the existingCallStack
. - If there is no
CallStack
in scope -- e.g. in the GHCi session above -- and the enclosing definition does not have an explicit type signature, GHC will infer aHasCallStack
constraint for the enclosing definition (subject to the monomorphism restriction). - If there is no
CallStack
in scope and the enclosing definition has an explicit type signature, GHC will solve theHasCallStack
constraint for the singletonCallStack
containing just the current call-site.
CallStack
s 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
Instances
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
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: ghc-internal-4.9.0.0
prettyCallStack :: CallStack -> String #
Pretty print a CallStack
.
Since: ghc-internal-4.9.0.0
callStack :: HasCallStack => CallStack #
withFrozenCallStack :: HasCallStack => (HasCallStack => a) -> a #
Perform some computation without adding new entries to the CallStack
.
@since base-4.9.0.0