pragmatic-show-0.1.2.0: Alternative Show class that gives shorter view if possible.

Copyright(c) Justus Sagemüller 2017
LicenseGPL v3
Maintainer(@) jsagemue $ uni-koeln.de
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Text.Show.Pragmatic

Contents

Description

 

Synopsis

Replacement for the standard class

class Show a where Source #

A drop-in replacement for Show. The behaviour is mostly the same: the result of show should be valid Haskell code, and reading back such a value should give the original value – but, unlike in Show, we don't require this in an exact sense, i.e. read (show x) == x is not necessarily fulfilled.

Notably for floating-point values, we allow a slight deviation if it considerably shortens the shown representation: for example, 0.90000004 :: Float, which can easily come up as the result of a computation which should in principle be exactly 0.9, is shown as 0.9 instead. We do however not commit to any particular fixed precision; it depends on the type and the order of magnitude which amount of rounding is appropriate. See the test suite for some examples.

Minimal complete definition

showsPrec | show

Methods

showsPrec :: Int -> a -> ShowS Source #

show :: a -> String Source #

showList :: [a] -> ShowS Source #

Instances

Show Bool Source # 
Show Char Source # 
Show Double Source # 
Show Float Source # 
Show Int Source # 
Show Int8 Source # 
Show Int16 Source # 
Show Int32 Source # 
Show Int64 Source # 
Show Integer Source # 
Show Natural Source # 
Show Ordering Source # 
Show Word Source # 
Show Word8 Source # 
Show Word16 Source # 
Show Word32 Source # 
Show Word64 Source # 
Show CallStack Source # 
Show SomeTypeRep Source # 
Show () Source # 

Methods

showsPrec :: Int -> () -> ShowS Source #

show :: () -> String Source #

showList :: [()] -> ShowS Source #

Show TyCon Source # 
Show Module Source # 
Show Handle Source # 
Show Void Source # 
Show StaticPtrInfo Source # 
Show DataType Source # 
Show Constr Source # 
Show DataRep Source # 
Show ConstrRep Source # 
Show Fixity Source # 
Show GiveGCStats Source # 
Show GCFlags Source # 
Show ConcFlags Source # 
Show MiscFlags Source # 
Show DebugFlags Source # 
Show DoCostCentres Source # 
Show CCFlags Source # 
Show DoHeapProfile Source # 
Show ProfFlags Source # 
Show DoTrace Source # 
Show TraceFlags Source # 
Show TickyFlags Source # 
Show ParFlags Source # 
Show RTSFlags Source # 
Show RTSStats Source # 
Show Version Source # 
Show HandlePosn Source # 
Show FileLockingNotSupported Source # 
Show FdKey Source # 
Show PatternMatchFail Source # 
Show RecSelError Source # 
Show RecConError Source # 
Show RecUpdError Source # 
Show NoMethodError Source # 
Show TypeError Source # 
Show NonTermination Source # 
Show NestedAtomically Source # 
Show ThreadId Source # 
Show BlockReason Source # 
Show ThreadStatus Source # 
Show Dynamic Source # 
Show Event Source # 
Show Lifetime Source # 
Show CDev Source # 
Show CIno Source # 
Show CMode Source # 
Show COff Source # 
Show CPid Source # 
Show CSsize Source # 
Show CGid Source # 
Show CNlink Source # 
Show CUid Source # 
Show CCc Source # 
Show CSpeed Source # 
Show CTcflag Source # 
Show CRLim Source # 
Show CBlkSize Source # 
Show CBlkCnt Source # 
Show CClockId Source # 
Show CFsBlkCnt Source # 
Show CFsFilCnt Source # 
Show CId Source # 
Show CKey Source # 
Show CTimer Source # 
Show Fd Source # 
Show CodingFailureMode Source # 
Show BlockedIndefinitelyOnMVar Source # 
Show BlockedIndefinitelyOnSTM Source # 
Show Deadlock Source # 
Show AllocationLimitExceeded Source # 
Show CompactionFailed Source # 
Show AssertionFailed Source # 
Show SomeAsyncException Source # 
Show AsyncException Source # 
Show ArrayException Source # 
Show ExitCode Source # 
Show IOErrorType Source # 
Show BufferMode Source # 
Show Newline Source # 
Show NewlineMode Source # 
Show SeekMode Source # 
Show TextEncoding Source # 
Show CodingProgress Source # 
Show MaskingState Source # 
Show IOException Source # 
Show ErrorCall Source # 
Show ArithException Source # 
Show All Source # 
Show Any Source # 
Show Fixity Source # 
Show Associativity Source # 
Show SourceUnpackedness Source # 
Show SourceStrictness Source # 
Show DecidedStrictness Source # 
Show SomeSymbol Source # 
Show SomeNat Source # 
Show CChar Source # 
Show CSChar Source # 
Show CUChar Source # 
Show CShort Source # 
Show CUShort Source # 
Show CInt Source # 
Show CUInt Source # 
Show CLong Source # 
Show CULong Source # 
Show CLLong Source # 
Show CULLong Source # 
Show CBool Source # 
Show CFloat Source # 
Show CDouble Source # 
Show CPtrdiff Source # 
Show CSize Source # 
Show CWchar Source # 
Show CSigAtomic Source # 
Show CClock Source # 
Show CTime Source # 
Show CUSeconds Source # 
Show CSUSeconds Source # 
Show CIntPtr Source # 
Show CUIntPtr Source # 
Show CIntMax Source # 
Show CUIntMax Source # 
Show WordPtr Source # 
Show IntPtr Source # 
Show IOMode Source # 
Show Fingerprint Source # 
Show Lexeme Source # 
Show Number Source # 
Show GeneralCategory Source # 
Show SomeException Source # 
Show SrcLoc Source # 
Show IntSet Source # 
Show a => Show [a] Source # 

Methods

showsPrec :: Int -> [a] -> ShowS Source #

show :: [a] -> String Source #

showList :: [[a]] -> ShowS Source #

(Integral i, Show i) => Show (Ratio i) Source # 
Show (Complex Double) Source # 
Show (Complex Float) Source # 
Show b => Show (IntMap b) Source # 
Show a => Show (Tree a) Source # 

Methods

showsPrec :: Int -> Tree a -> ShowS Source #

show :: Tree a -> String Source #

showList :: [Tree a] -> ShowS Source #

(Show a, Ord a) => Show (Seq a) Source # 

Methods

showsPrec :: Int -> Seq a -> ShowS Source #

show :: Seq a -> String Source #

showList :: [Seq a] -> ShowS Source #

(Show a, Ord a) => Show (Set a) Source # 

Methods

showsPrec :: Int -> Set a -> ShowS Source #

show :: Set a -> String Source #

showList :: [Set a] -> ShowS Source #

(Show a, Show b) => Show (a, b) Source # 

Methods

showsPrec :: Int -> (a, b) -> ShowS Source #

show :: (a, b) -> String Source #

showList :: [(a, b)] -> ShowS Source #

(Show a, Ord a, Show b) => Show (Map a b) Source # 

Methods

showsPrec :: Int -> Map a b -> ShowS Source #

show :: Map a b -> String Source #

showList :: [Map a b] -> ShowS Source #

(Show a, Show b, Show c) => Show (a, b, c) Source # 

Methods

showsPrec :: Int -> (a, b, c) -> ShowS Source #

show :: (a, b, c) -> String Source #

showList :: [(a, b, c)] -> ShowS Source #

(Show a, Show b, Show c, Show d) => Show (a, b, c, d) Source # 

Methods

showsPrec :: Int -> (a, b, c, d) -> ShowS Source #

show :: (a, b, c, d) -> String Source #

showList :: [(a, b, c, d)] -> ShowS Source #

print :: Show a => a -> IO () Source #

Utility (unstable)

ltdPrecShowsPrec :: RealFloat n => Int -> Int -> n -> ShowS Source #

ltdPrecShowsPrec prcn displays floating-point values with a precision of at least prcn digits. That does not mean it will necessarily display that many digits, rather it tries to always choose the shortest representation with the required precision.

showsPrecWithSharedPrecision Source #

Arguments

:: (ShowMagnitudeRangeLimited n, RealFloat sn, Traversable list) 
=> (n -> sn)

Magnitude-function. Should be a norm.

-> Int

Precision of the type, in significant decimals. This will be used to trim the length of all entries to match the expected numerical uncertainty of the biggest one.

-> Int

Precedence of the enclosing context in which the values are to be shown.

-> list n

Values to show

-> list ShowS

Individual values' string representation.