utility function converting a Char to a show function that simply prepends the character unchanged.
Moduleshow-combinators-0.2.0.0Haskell2010
Text.Show.Combinators
Combinators to write Show instances.
The following type illustrates the common use cases.
data MyType a
= C a a -- a regular constructor
| a :+: a -- an infix constructor
| R { f1 :: a, f2 :: a } -- a record
infixl 4 :+:
instance Show a => Show (MyType a) where
showsPrec = flip precShows where
precShows (C a b) = showCon "C" @| a @| b
precShows (c :+: d) = showInfix' ":+:" 4 c d
precShows (R {f1 = e, f2 = f}) =
showRecord "R" ("f1" .=. e &| "f2" .=. f)
- 3 types
- 1 class
- 20 values
- Packageshow-combinators-0.2.0.0
- Exports24
- LanguageHaskell2010
- LicenceMIT
- SourceCombinators.hs
utility function that surrounds the inner show function with
parentheses when the Bool parameter is True.
utility function converting a String to a show function that simply prepends the string unchanged.
equivalent to showsPrec with a precedence of 0.
Show a list (using square brackets and commas), given a function for showing elements.
Conversion of values to readable Strings.
Derived instances of Show have the following properties, which
are compatible with derived instances of Text.Read.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
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 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 athe 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,
show (Leaf 1 :^: Leaf 2 :^: Leaf 3)produces the string"Leaf 1 :^: (Leaf 2 :^: Leaf 3)".
Methods
Instances363Show, …
Show ByteArrayDefined in base-4.23.0.0 · Data.Array.ByteShow CCFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow ConcFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow DebugFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow DoCostCentresDefined in base-4.23.0.0 · GHC.RTS.FlagsShow DoHeapProfileDefined in base-4.23.0.0 · GHC.RTS.FlagsShow DoTraceDefined in base-4.23.0.0 · GHC.RTS.FlagsShow GCFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow GiveGCStatsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow HpcFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow IoManagerFlagDefined in base-4.23.0.0 · GHC.RTS.FlagsShow MiscFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow ParFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow ProfFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow RTSFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow TickyFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow TraceFlagsDefined in base-4.23.0.0 · GHC.RTS.FlagsShow GCDetailsDefined in base-4.23.0.0 · GHC.StatsShow RTSStatsDefined in base-4.23.0.0 · GHC.StatsShow TimeoutDefined in base-4.23.0.0 · System.TimeoutShow VoidDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow IntegerDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow NaturalDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow ByteOrderDefined in ghc-internal-10.0.0 · GHC.Internal.ByteOrderShow ClosureTypeDefined in ghc-internal-10.0.0 · GHC.Internal.ClosureTypesShow BlockReasonDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncShow ThreadIdDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncShow ThreadStatusDefined in ghc-internal-10.0.0 · GHC.Internal.Conc.SyncShow NestedAtomicallyDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow NoMatchingContinuationPromptDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow NoMethodErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow NonTerminationDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow PatternMatchFailDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow RecConErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow RecSelErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow RecUpdErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow TypeErrorDefined in ghc-internal-10.0.0 · GHC.Internal.Control.Exception.BaseShow ConstrDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow ConstrRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow DataRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow DataTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow FixityDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DataShow DynamicDefined in ghc-internal-10.0.0 · GHC.Internal.Data.DynamicShow AllDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow AnyDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow SomeTypeRepDefined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.InternalShow VersionDefined in ghc-internal-10.0.0 · GHC.Internal.Data.VersionShow ControlMessageDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ControlShow EPollFdDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollShow EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollShow EventTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.EPollShow EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesShow EventLifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesShow LifetimeDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesShow TimeoutDefined in ghc-internal-10.0.0 · GHC.Internal.Event.Internal.TypesShow FdKeyDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ManagerShow StateDefined in ghc-internal-10.0.0 · GHC.Internal.Event.ManagerShow EventDefined in ghc-internal-10.0.0 · GHC.Internal.Event.PollShow PollFdDefined in ghc-internal-10.0.0 · GHC.Internal.Event.PollShow StateDefined in ghc-internal-10.0.0 · GHC.Internal.Event.TimerManagerShow UniqueDefined in ghc-internal-10.0.0 · GHC.Internal.Event.UniqueShow ErrorCallDefined in ghc-internal-10.0.0 · GHC.Internal.ExceptionShow ArithExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow SomeExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow WhileHandlingDefined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow FingerprintDefined in ghc-internal-10.0.0 · GHC.Internal.Fingerprint.TypeShow CBoolDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CClockDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CDoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CFloatDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CLLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CPtrdiffDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CSCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CSUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CSigAtomicDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CSizeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CTimeDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUCharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUIntDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUIntMaxDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUIntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CULLongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CULongDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUSecondsDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CUShortDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow CWcharDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.TypesShow IntPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrShow WordPtrDefined in ghc-internal-10.0.0 · GHC.Internal.Foreign.PtrShow ForeignSrcLangDefined in ghc-internal-10.0.0 · GHC.Internal.ForeignSrcLangShow AssociativityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow FixityDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow BoxDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow PrimTypeDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow TsoFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow WhatNextDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow WhyBlockedDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow HalfWordDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesShow StgInfoTableDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.InfoTable.TypesShow CostCentreDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesShow CostCentreStackDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesShow IndexTableDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesShow StgTSOProfInfoDefined in ghc-internal-10.0.0 · GHC.Internal.Heap.ProfInfo.TypesShow MaskingStateDefined in ghc-internal-10.0.0 · GHC.Internal.IOShow SeekModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.DeviceShow CodingFailureModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Encoding.FailureShow CodingProgressDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Encoding.TypesShow TextEncodingDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Encoding.TypesShow AllocationLimitExceededDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow ArrayExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow AssertionFailedDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow AsyncExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow BlockedIndefinitelyOnMVarDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow BlockedIndefinitelyOnSTMDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow CompactionFailedDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow DeadlockDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow ExitCodeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow FixIOExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow IOErrorTypeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow IOExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow SomeAsyncExceptionDefined in ghc-internal-10.0.0 · GHC.Internal.IO.ExceptionShow FDDefined in ghc-internal-10.0.0 · GHC.Internal.IO.FDShow HandlePosnDefined in ghc-internal-10.0.0 · GHC.Internal.IO.HandleShow FileLockingNotSupportedDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.Lock.CommonShow BufferModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow HandleDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow HandleTypeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow NewlineDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow NewlineModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.Handle.TypesShow IOModeDefined in ghc-internal-10.0.0 · GHC.Internal.IO.IOModeShow IoSubSystemDefined in ghc-internal-10.0.0 · GHC.Internal.IO.SubSystemShow InfoProvDefined in ghc-internal-10.0.0 · GHC.Internal.InfoProv.TypesShow Int16Defined in ghc-internal-10.0.0 · GHC.Internal.IntShow Int32Defined in ghc-internal-10.0.0 · GHC.Internal.IntShow Int64Defined in ghc-internal-10.0.0 · GHC.Internal.IntShow Int8Defined in ghc-internal-10.0.0 · GHC.Internal.IntShow ExtensionDefined in ghc-internal-10.0.0 · GHC.Internal.LanguageExtensionsShow CCFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow ConcFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow DebugFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow DoCostCentresDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow DoHeapProfileDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow DoTraceDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow GCFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow GiveGCStatsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow HpcFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow IoManagerFlagDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow MiscFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow ParFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow ProfFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow RTSFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow TickyFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow TraceFlagsDefined in ghc-internal-10.0.0 · GHC.Internal.RTS.FlagsShow FractionalExponentBaseDefined in ghc-internal-10.0.0 · GHC.Internal.RealShow ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsShow WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsShow ByteOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfShow WordOffsetDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.ConstantsProfShow PointernessDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.DecodeShow StackEntryDefined in ghc-internal-10.0.0 · GHC.Internal.Stack.DecodeShow CallStackDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow SrcLocDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow StaticPtrInfoDefined in ghc-internal-10.0.0 · GHC.Internal.StaticPtrShow GCDetailsDefined in ghc-internal-10.0.0 · GHC.Internal.StatsShow RTSStatsDefined in ghc-internal-10.0.0 · GHC.Internal.StatsShow CBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CBlkSizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CCcDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CClockIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CDevDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CFsBlkCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CFsFilCntDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CGidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CIdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CInoDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CKeyDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CModeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CNfdsDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CNlinkDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow COffDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CPidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CRLimDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CSocklenDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CSpeedDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CSsizeDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CTcflagDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CTimerDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow CUidDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow FdDefined in ghc-internal-10.0.0 · GHC.Internal.System.Posix.TypesShow AnnLookupDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow AnnTargetDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow BangDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow BndrVisDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow BodyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow BytesDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow CallconvDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ClauseDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ConDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DecDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DecidedStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DerivClauseDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DerivStrategyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow DocLocDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ExpDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow FamilyResultSigDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow FixityDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow FixityDirectionDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ForeignDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow FunDepDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow GuardDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow InfoDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow InjectivityAnnDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow InlineDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow LitDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow LocDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow MatchDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ModNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ModuleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow ModuleInfoDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow NameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow NameFlavourDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow NameSpaceDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow NamespaceSpecifierDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow OccNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow OverlapDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PatDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PatSynArgsDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PatSynDirDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PhasesDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PkgNameDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow PragmaDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow RangeDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow RoleDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow RuleBndrDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow RuleMatchDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow SafetyDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow SourceStrictnessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow SourceUnpackednessDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow SpecificityDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow StmtDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow TyLitDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow TySynEqnDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow TypeDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow TypeFamilyHeadDefined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow LexemeDefined in ghc-internal-10.0.0 · GHC.Internal.Text.Read.LexShow NumberDefined in ghc-internal-10.0.0 · GHC.Internal.Text.Read.LexShow SomeCharDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsShow SomeSymbolDefined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsShow SomeNatDefined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsShow BoolDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow CharDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow DoubleDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanShow FloatDefined in ghc-internal-10.0.0 · GHC.Internal.Float · orphanShow IntDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow KindRepDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow LevityDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow ModuleDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow OrderingDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow RuntimeRepDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow TrNameDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow TyConDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow TypeLitSortDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow VecCountDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow VecElemDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow WordDefined in ghc-internal-10.0.0 · GHC.Internal.ShowShow GeneralCategoryDefined in ghc-internal-10.0.0 · GHC.Internal.UnicodeShow Word16Defined in ghc-internal-10.0.0 · GHC.Internal.WordShow Word32Defined in ghc-internal-10.0.0 · GHC.Internal.WordShow Word64Defined in ghc-internal-10.0.0 · GHC.Internal.WordShow Word8Defined in ghc-internal-10.0.0 · GHC.Internal.WordShow ()Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow (ConstPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.Foreign.C.ConstPtrShow (ForeignPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.ForeignPtrShow (FunPtr a)Defined in ghc-internal-10.0.0 · GHC.Internal.PtrShow (Ptr a)Defined in ghc-internal-10.0.0 · GHC.Internal.PtrShow (SChar c)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsShow (SSymbol s)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeLitsShow (SNat n)Defined in ghc-internal-10.0.0 · GHC.Internal.TypeNatsShow a => Show (Complex a)Defined in base-4.23.0.0 · Data.ComplexShow a => Show (First a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (Last a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (Max a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (Min a)Defined in base-4.23.0.0 · Data.SemigroupShow a => Show (NonEmpty a)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow a => Show (And a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsShow a => Show (Iff a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsShow a => Show (Ior a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsShow a => Show (Xor a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.BitsShow a => Show (Identity a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.IdentityThis instance would be equivalent to the derived instances of the Identity newtype if the runIdentity field were removed
Show a => Show (First a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidShow a => Show (Last a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidShow a => Show (Down a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.OrdShow a => Show (Dual a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (Product a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (Sum a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow a => Show (ExceptionWithContext a)Defined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow a => Show (ZipList a)Defined in ghc-internal-10.0.0 · GHC.Internal.Functor.ZipListShow a => Show (Maybe a)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow a => Show (Ratio a)Defined in ghc-internal-10.0.0 · GHC.Internal.RealShow a => Show (a)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow a => Show [a]Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow b => Show (GenClosure b)Defined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow b => Show (GenStackField b)Defined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow b => Show (GenStackFrame b)Defined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow b => Show (GenStgStackClosure b)Defined in ghc-internal-10.0.0 · GHC.Internal.Heap.ClosuresShow e => Show (NoBacktrace e)Defined in ghc-internal-10.0.0 · GHC.Internal.Exception.TypeShow flag => Show (TyVarBndr flag)Defined in ghc-internal-10.0.0 · GHC.Internal.TH.SyntaxShow m => Show (WrappedMonoid m)Defined in base-4.23.0.0 · Data.SemigroupShow p => Show (Par1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsHasResolution a => Show (Fixed a)Defined in base-4.23.0.0 · Data.FixedShow (Proxy s)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.ProxyShow (TypeRep a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Typeable.InternalShow (U1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (UAddr p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (V1 p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (ST s a)Defined in ghc-internal-10.0.0 · GHC.Internal.STShow (a -> b)Defined in base-4.23.0.0 · Text.Show.Functions · orphan(Ix a, Show a, Show b) => Show (Array a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Arr(Show a, Show b) => Show (Arg a b)Defined in base-4.23.0.0 · Data.Semigroup(Show a, Show b) => Show (Either a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Either(Show a, Show b) => Show (a, b)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow (Coercion a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.CoercionShow (OrderingI a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.OrdShow (URec Char p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Double p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Float p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Int p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (URec Word p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (a :~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityShow (f a) => Show (Ap f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.MonoidShow (f a) => Show (Alt f a)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Semigroup.InternalShow (f p) => Show (Rec1 f p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow a => Show (Const a b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Functor.Const(Show a, Show b, Show c) => Show (a, b, c)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow (a :~~: b)Defined in ghc-internal-10.0.0 · GHC.Internal.Data.Type.EqualityShow c => Show (K1 i c p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Show (f a), Show (g a)) => Show (Product f g a)Defined in base-4.23.0.0 · Data.Functor.Product(Show (f a), Show (g a)) => Show (Sum f g a)Defined in base-4.23.0.0 · Data.Functor.Sum(Show (f p), Show (g p)) => Show ((:*:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Show (f p), Show (g p)) => Show ((:+:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Show a, Show b, Show c, Show d) => Show (a, b, c, d)Defined in ghc-internal-10.0.0 · GHC.Internal.ShowShow (f (g a)) => Show (Compose f g a)Defined in base-4.23.0.0 · Data.Functor.ComposeShow (f (g p)) => Show ((:.:) f g p)Defined in ghc-internal-10.0.0 · GHC.Internal.GenericsShow (f p) => Show (M1 i c f p)Defined in ghc-internal-10.0.0 · GHC.Internal.Generics(Show a, Show b, Show c, Show d, Show e) => Show (a, b, c, d, e)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f) => Show (a, b, c, d, e, f)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(Show a, Show b, Show c, Show d, Show e, Show f, Show g) => Show (a, b, c, d, e, f, g)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(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)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(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)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(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)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(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)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(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)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(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)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(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)Defined in ghc-internal-10.0.0 · GHC.Internal.Show(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)Defined in ghc-internal-10.0.0 · GHC.Internal.Show
Simple constructors and applications
3 declarationsShow a constructor.
Possible constructor names are:
regular constructors (e.g.,
"Left");parenthesized infix constructors (e.g.,
"(:)");smart constructors, for abstract types (e.g.,
"Map.fromList").
Example with smart constructor
instance (Show k, Show v) => Show (Map k v) where
showsPrec = flip precShows where
precShows m = showCon "Map.fromList" @| Map.toList m
-- Example output:
-- > Map.fromList [(33, True), (55, False)]
Show a function application.
Infix constructors
2 declarationsShow an applied infix operator with a given precedence.
Combinators for associative operators
Use with care, see warning under showInfixl.
Show an applied infix operator which is left associative (infixl).
Use with care.
Warning
This combinator assumes that, if there is another infix operator to the left, it is either left associative with the same precedence, or it has a different precedence. An expression containing two operators at the same level with different associativities is ambiguous and will not be shown correctly with showInfixl and showInfixr.
By default, prefer showInfix and showInfix'.
Show an applied infix operator which is left associative (infixl).
Use with care, see showInfixl.
This is a shorthand for showInfixl when the arguments types are instances of Show.
By default, prefer showInfix and showInfix'.
Show an applied infix operator which is right associative (infixr).
Use with care.
Warning
This combinator assumes that, if there is another infix operator to the right, it is either right associative with the same precedence, or it has a different precedence. An expression containing two operators at the same level with different associativities is ambiguous and will not be shown correctly with showInfixl and showInfixr.
By default, prefer showInfix and showInfix'.
Example usage
showList :: Show a => [a] -> PrecShowS
showList [] = showCon "[]"
showList (x : xs) = showInfixr ":" 5 (flip showsPrec x) (showList xs)
-- Example output:
-- > 0 : 1 : 2 : 3 : []
Show an applied infix operator which is right associative (infixr).
Use with care, see showInfixr.
This is a shorthand for showInfixr when the arguments types are instances of Show.
By default, prefer showInfix and showInfix'.
Records
7 declarationsStrings representing a set of record fields separated by commas. They can be constructed using (.=.) and (@|), or using showField and appendFields.
Show a record. The first argument is the constructor name. The second represents the set of record fields.
Show a single record field: a field name and a value separated by '='.
Empty set of record fields.
Separate two nonempty sets of record fields by a comma.
An infix synonym of appendFields.