Safe Haskell | None |
---|
"Syntactic sugar"
For details, see Combining Deep and Shallow Embedding for EDSL (TFP 2013, http://www.cse.chalmers.se/~emax/documents/svenningsson2013combining.pdf).
Documentation
(Syntactic a, ~ (* -> *) (Domain a) dom, Syntactic b, ~ (* -> *) (Domain b) dom, :<: Binding dom) => Syntactic (a -> b) | |
(Syntactic a, ~ (* -> *) (Domain a) dom, Syntactic b, ~ (* -> *) (Domain b) dom, :<: BindingT dom, Typeable (Internal a)) => Syntactic (a -> b) | |
Syntactic (ASTF sym a) | |
(Syntactic a, ~ (* -> *) (Domain a) sym, :<: Binding sym, :<: (MONAD m) sym, Monad m) => Syntactic (Remon sym m a) | |
(Syntactic a, ~ (* -> *) (Domain a) sym, :<: BindingT sym, :<: (MONAD m) sym, Monad m, Typeable (Internal a)) => Syntactic (Remon sym m a) |
resugar :: (Syntactic a, Syntactic b, Domain a ~ Domain b, Internal a ~ Internal b) => a -> bSource
Syntactic type casting
class SyntacticN f internal | f -> internal whereSource
N-ary syntactic functions
desugarN
has any type of the form:
desugarN :: ( Syntactic a , Syntactic b , ... , Syntactic x , Domain a ~ sym , Domain b ~ sym , ... , Domain x ~ sym ) => (a -> b -> ... -> x) -> ( ASTF sym (Internal a) -> ASTF sym (Internal b) -> ... -> ASTF sym (Internal x) )
...and vice versa for sugarN
.
(Syntactic f, ~ (* -> *) (Domain f) sym, ~ * fi (AST sym (Full (Internal f)))) => SyntacticN f fi | |
(Syntactic a, ~ (* -> *) (Domain a) sym, ~ * ia (Internal a), SyntacticN f fi) => SyntacticN (a -> f) (AST sym (Full ia) -> fi) |
sugarSym :: (Signature sig, fi ~ SmartFun sup sig, sig ~ SmartSig fi, sup ~ SmartSym fi, SyntacticN f fi, sub :<: sup) => sub sig -> fSource
"Sugared" symbol application
sugarSym
has any type of the form:
sugarSym :: ( sub :<: AST sup , Syntactic a , Syntactic b , ... , Syntactic x , Domain a ~ Domain b ~ ... ~ Domain x ) => sub (Internal a :-> Internal b :-> ... :-> Full (Internal x)) -> (a -> b -> ... -> x)