Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Language.Giml.Rewrites.PreInfer.Currying
Description
Convert functions of multiple arguments to a chain of functions of a single argument
a b c -> add (add a b) c
should become:
a -> b -> c -> add (add a b) c
And function application should change too:
EFunCall "add" [EVar "a", EVar "b"]
should become:
EFunCall (EFunCall "add" [EVar "a"]) [EVar "b"]
Maybe EFunCall should be converted to a different constructor?
Such as EApp (Expr a) (Expr a)
, but we might do that later.
Documentation
impl :: Data a => Expr a -> Expr a Source #
Convert functions of multiple arguments to a chain of functions of a single argument And application of functions of multiple arguments to a chain of applications
desugarFun :: TermDef a -> TermDef a Source #
Desugar a Function term definition to a single parameter functions with a lambda