data-treify-0.3.1: Reify a recursive data structure into an explicit graph.

Exp

Synopsis

Documentation

data Op whereSource

Constructors

Add :: Num a => Op (a -> a -> a) 
Mul :: Num a => Op (a -> a -> a) 
Lit :: Show a => a -> Op a 

Instances

ShowF Op 
Show (Op a) 

data E whereSource

Constructors

Op :: Op a -> E v a 
:^ :: (Typeable a, Typeable b) => E v (a -> b) -> E v a -> E v b 
Let :: v a -> E v a -> E v b -> E v b 
Var :: v a -> E v a 

Instances

MuRef Ty (E v) 
Eq (E v a) 
(Typeable a, Num a) => Num (E (V Ty) a) 
Show (E (V Ty) a) 

data N whereSource

Constructors

ON :: Op a -> N v a 
App :: (Typeable a, Typeable b) => v (a -> b) -> v a -> N v b 

Instances

ShowF v => ShowF (N v) 

nodeE :: N v a -> E v aSource

unGraph :: Typeable a => Graph Ty N a -> E (V Ty) aSource

ssa :: Typeable a => E (V Ty) a -> IO (E (V Ty) a)Source

children :: N (V Ty) a -> [Id]Source

uses :: [Bind Ty N] -> Id -> IntSource

bindsF' :: [Bind Ty N] -> V Ty a -> N (V Ty) aSource

bindsF :: forall n a. [Bind Ty n] -> V Ty a -> n (V Ty) aSource

unGraph2 :: Graph Ty N a -> E (V Ty) aSource

cse :: Typeable a => E (V Ty) a -> IO (E (V Ty) a)Source

Common subexpression elimination

op2 :: (Typeable a, Typeable b, Typeable c) => Op (a -> b -> c) -> E v a -> E v b -> E v cSource

sqr :: Num a => a -> aSource

reify :: (MuRef Ty h, Typeable a) => h a -> IO (Graph Ty (DeRef h) a)Source