hedgehog-1.5: Release with confidence.

Safe Haskell | Safe-Inferred
Language | Haskell2010

Hedgehog.Internal.Show

Synopsis

- type Name = String
- data Value
  - = Con Name [Value]
  - | InfixCons Value [(Name, Value)]
  - | Rec Name [(Name, Value)]
  - | Tuple [Value]
  - | List [Value]
  - | Neg Value
  - | Ratio Value Value
  - | Integer String
  - | Float String
  - | Char String
  - | String String
  - | Date String
  - | Time String
  - | Quote String
- data ValueDiff
  - = ValueCon Name [ValueDiff]
  - | ValueRec Name [(Name, ValueDiff)]
  - | ValueTuple [ValueDiff]
  - | ValueList [ValueDiff]
  - | ValueSame Value
  - | ValueDiff Value Value
- data LineDiff
  - = LineSame String
  - | LineRemoved String
  - | LineAdded String
- 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

type Name = String Source #

A name.

data Value Source #

Generic Haskell values. `NaN` and `Infinity` are represented as constructors. The `String` 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)])]`.

Constructors

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

time|2003-02-01T08:30:21Z|

#### Instances

Instances details

Show Value |
Instance details Defined in Text.Show.Value Methods showsPrec :: Int -> Value -> ShowS Source # show :: Value -> String Source # showList :: [Value] -> ShowS Source #
Eq Value |
Instance details Defined in Text.Show.Value Methods (==) :: Value -> Value -> Bool Source # (/=) :: Value -> Value -> Bool Source #

data ValueDiff Source #

Constructors

ValueCon Name [ValueDiff] |
ValueRec Name [(Name, ValueDiff)] |
ValueTuple [ValueDiff] |
ValueList [ValueDiff] |
ValueSame Value |
ValueDiff Value Value |

#### Instances

Instances details

Show ValueDiff Source # |
Instance details Defined in Hedgehog.Internal.Show Methods showsPrec :: Int -> ValueDiff -> ShowS Source # show :: ValueDiff -> String Source # showList :: [ValueDiff] -> ShowS Source #
Eq ValueDiff Source # |
Instance details Defined in Hedgehog.Internal.Show Methods (==) :: ValueDiff -> ValueDiff -> Bool Source # (/=) :: ValueDiff -> ValueDiff -> Bool Source #

data LineDiff Source #

Constructors

LineSame String |
LineRemoved String |
LineAdded String |

#### Instances

Instances details

Show LineDiff Source # |
Instance details Defined in Hedgehog.Internal.Show Methods showsPrec :: Int -> LineDiff -> ShowS Source # show :: LineDiff -> String Source # showList :: [LineDiff] -> ShowS Source #
Eq LineDiff Source # |
Instance details Defined in Hedgehog.Internal.Show Methods (==) :: LineDiff -> LineDiff -> Bool Source # (/=) :: LineDiff -> LineDiff -> Bool Source #

mkValue :: Show a => a -> Maybe Value Source #

showPretty :: Show a => a -> String Source #

valueDiff :: Value -> Value -> ValueDiff Source #

lineDiff :: Value -> Value -> [LineDiff] Source #

toLineDiff :: ValueDiff -> [LineDiff] Source #

renderValue :: Value -> String Source #

renderValueDiff :: ValueDiff -> String Source #

renderLineDiff :: LineDiff -> String Source #

takeLeft :: ValueDiff -> Value Source #

takeRight :: ValueDiff -> Value Source #