traced-2009.7.20: Simple evaluation trace

Debug.TracedInternal

Synopsis

Documentation

data Traced a Source

Traced values of some type.

traced :: Traceable a => a -> Traced aSource

Create a traced value.

named :: Traceable a => String -> a -> Traced aSource

Create a named traced value.

nameTraced :: Traceable a => String -> Traced a -> Traced aSource

Add a named to a traced value.

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

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

unTraced :: Traced a -> aSource

Extract the real value from a traced value.

tracedD :: Traceable a => Traced a -> TracedDSource

Extract the expression tree from a traced value.

class (Typeable a, Show a) => Traceable a whereSource

Methods

trPPrint :: TraceLevel -> Int -> a -> DocSource

Instances

(Typeable a, Show a) => Traceable a 

data TracedD Source

Expression tree for a traced value.

Constructors

NoValue

unknown value

forall a . Name Bool Name TracedD

value with a name

forall a . Traceable a => Con a

constant

forall a . Traceable a => Apply a Name Fixity [TracedD]

application

forall a . Let [(Name, TracedD)] TracedD

(recovered) let expression

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 cSource

unOp :: (Traceable a, Traceable b) => (a -> b) -> String -> Traced a -> Traced bSource

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

Create a traced value with an Apply expression tree.

liftT :: Liftable a b => Name -> Fixity -> a -> bSource

liftFun :: Liftable a b => Name -> a -> bSource

class Liftable a b | a -> b, b -> a whereSource

Methods

liftT' :: Name -> Fixity -> [TracedD] -> a -> bSource

baseLiftT :: Traceable a => Name -> Fixity -> [TracedD] -> a -> Traced aSource

data Fixity Source

Fixity for identifier.

Constructors

InfixL Int 
InfixR Int 
Infix Int 
Nonfix 

Instances

showAsExp :: Traceable a => Traced a -> StringSource

Show the expression tree of a traced value.

showAsExpFull :: Traceable a => Traced a -> StringSource

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

simplify :: Traced a -> Traced aSource

Simplify an expression tree.