Copyright | (C) 2012-15 Edward Kmett, 2008-2009 Lennart Augustsson |
---|---|

License | BSD-style (see the file LICENSE) |

Maintainer | Edward Kmett <ekmett@gmail.com> |

Stability | experimental |

Portability | non-portable |

Safe Haskell | None |

Language | Haskell2010 |

- data Traced a
- traced :: Traceable a => a -> Traced a
- named :: Traceable a => String -> a -> Traced a
- nameTraced :: Traceable a => String -> Traced a -> Traced a
- unknown :: Traceable a => String -> Traced a
- unTraced :: Traced a -> a
- tracedD :: Traceable a => Traced a -> TracedD
- data TraceLevel
- class (Typeable a, Show a) => Traceable a where
- trPPrint :: TraceLevel -> Int -> a -> Doc

- data TracedD
- unTracedD :: Traceable a => TracedD -> Maybe (Traced a)
- binOp :: (Traceable a, Traceable b, Traceable c) => (a -> b -> c) -> (String, Fixity) -> Traced a -> Traced b -> Traced c
- unOp :: (Traceable a, Traceable b) => (a -> b) -> String -> Traced a -> Traced b
- apply :: Traceable a => a -> Name -> Fixity -> [TracedD] -> Traced a
- liftT :: Liftable a b => Name -> Fixity -> a -> b
- liftFun :: Liftable a b => Name -> a -> b
- class Liftable a b | a -> b, b -> a where
- baseLiftT :: Traceable a => Name -> Fixity -> [TracedD] -> a -> Traced a
- data Fixity
- showAsExp :: Traceable a => Traced a -> String
- showAsExpFull :: Traceable a => Traced a -> String
- pPrintTraced :: Traceable a => TraceLevel -> Int -> Traced a -> Doc
- reShare :: Traceable a => Traced a -> Traced a
- simplify :: Traced a -> Traced a

# Documentation

Traced values of some type.

Liftable Bool (Traced Bool) | |

Liftable Double (Traced Double) | |

Liftable Float (Traced Float) | |

Liftable Int (Traced Int) | |

Liftable Integer (Traced Integer) | |

Liftable Ordering (Traced Ordering) | |

Liftable () (Traced ()) | |

(Traceable a, Enum a) => Enum (Traced a) | |

Eq a => Eq (Traced a) | |

(Traceable a, Floating a) => Floating (Traced a) | |

(Traceable a, Fractional a) => Fractional (Traced a) | |

(Traceable a, Integral a) => Integral (Traced a) | |

Data a => Data (Traced a) | |

(Traceable a, Num a) => Num (Traced a) | |

Ord a => Ord (Traced a) | |

(Read a, Traceable a) => Read (Traced a) | |

(Traceable a, Real a) => Real (Traced a) | |

(Traceable a, RealFloat a) => RealFloat (Traced a) | |

(Traceable a, RealFrac a) => RealFrac (Traced a) | |

Show a => Show (Traced a) | |

Typeable (* -> *) Traced | |

(Traceable a, Liftable b tb) => Liftable (a -> b) (Traced a -> tb) |

unknown :: Traceable a => String -> Traced a Source

Create a named thing with no value. Cannot be used where a real value is needed.

tracedD :: Traceable a => Traced a -> TracedD Source

Extract the expression tree from a traced value.

data TraceLevel Source

class (Typeable a, Show a) => Traceable a where Source

trPPrint :: TraceLevel -> Int -> a -> Doc Source

Expression tree for a traced value.

unTracedD :: Traceable a => TracedD -> Maybe (Traced a) Source

Convert an expression tree to a traced value, if the types are correct.

binOp :: (Traceable a, Traceable b, Traceable c) => (a -> b -> c) -> (String, Fixity) -> Traced a -> Traced b -> Traced c Source

apply :: Traceable a => a -> Name -> Fixity -> [TracedD] -> Traced a Source

Create a traced value with an `Apply`

expression tree.

Fixity for identifier.

showAsExpFull :: Traceable a => Traced a -> String Source

Show the expression tree of a traced value, also show the value of each variable.

pPrintTraced :: Traceable a => TraceLevel -> Int -> Traced a -> Doc Source