syntactic-1.16.1: Generic abstract syntax, and utilities for embedded languages

Safe HaskellNone




codeMotion2 Source


:: (ConstrainedBy dom Typeable, AlphaEq dom dom dom [(VarId, VarId)], AlphaEq dom dom (NodeDomain dom) [(VarId, VarId)], Equality dom, MonadState VarId m) 
=> (forall c. ASTF dom c -> Bool)

Control wether a sub-expression can be hoisted over the given expression

-> PrjDict dom 
-> MkInjDict dom 
-> ASTF dom a 
-> m (ASTF dom a) 

reifySmart2 :: forall dom p pVar a. (AlphaEq dom dom (NodeDomain (FODomain dom p pVar)) [(VarId, VarId)], AlphaEq dom dom (FODomain dom p pVar) [(VarId, VarId)], Equality dom, Syntactic a, Domain a ~ HODomain dom p pVar, p :< Typeable) => (forall c. ASTF (FODomain dom p pVar) c -> Bool) -> MkInjDict (FODomain dom p pVar) -> a -> ASTF (FODomain dom p pVar) (Internal a) Source

Like reify but with common sub-expression elimination and variable hoisting