giml-language-0.1.0.0: A purely functional programming language with emphasis on structural typing
Safe HaskellSafe-Inferred
LanguageGHC2021

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.

Synopsis

Documentation

rewrite :: Data a => File a -> File a Source #

rewrite' :: forall f a. Data a => Data (f a) => f a -> f a Source #

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