Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- type Name = String
- data Value
- data ValueDiff
- data LineDiff
- mkValue :: Show a => a -> Maybe Value
- showPretty :: Show a => a -> String
- valueDiff :: Value -> Value -> ValueDiff
- lineDiff :: Value -> Value -> [LineDiff]
- toLineDiff :: ValueDiff -> [LineDiff]
- renderValue :: Value -> String
- renderValueDiff :: ValueDiff -> String
- renderLineDiff :: LineDiff -> String
- takeLeft :: ValueDiff -> Value
- takeRight :: ValueDiff -> Value
Documentation
Generic Haskell values.
NaN
and Infinity
are represented as constructors.
The Value
in the literals is the text for the literals "as is".
A chain of infix constructors means that they appeared in the input string without parentheses, i.e
1 :+: 2 :*: 3
is represented with InfixCons 1 [(":+:",2),(":*:",3)]
, whereas
1 :+: (2 :*: 3)
is represented with InfixCons 1 [(":+:",InfixCons 2 [(":*:",3)])]
.
Con Name [Value] | Data constructor |
InfixCons Value [(Name, Value)] | Infix data constructor chain |
Rec Name [(Name, Value)] | Record value |
Tuple [Value] | Tuple |
List [Value] | List |
Neg Value | Negated value |
Ratio Value Value | Rational |
Integer String | Non-negative integer |
Float String | Non-negative floating num. |
Char String | Character |
String String | String |
Date String | 01-02-2003 |
Time String | 08:30:21 |
Quote String |
|
ValueCon Name [ValueDiff] | |
ValueRec Name [(Name, ValueDiff)] | |
ValueTuple [ValueDiff] | |
ValueList [ValueDiff] | |
ValueSame Value | |
ValueDiff Value Value |
showPretty :: Show a => a -> String Source #
toLineDiff :: ValueDiff -> [LineDiff] Source #
renderValue :: Value -> String Source #
renderValueDiff :: ValueDiff -> String Source #
renderLineDiff :: LineDiff -> String Source #