You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.
Scilla's semantics for function applications follows currying semantics.
i.e., when we have let foo = fun (a : Int32) => fun (b : Int32) => ... and an application foo a b, then it is evaluated as "apply a to foo to get function, and b is applied to this result function". In the case of foo never being applied partially, we should replace the curried functions with a single function that takes two arguments fun (a : Int32, b : Int32).
PR #25 defines types and AST to accommodate functions (and function types) that take multiple arguments. Passes after it (ex: closure conversion) are already designed to work on functions with multiple arguments (and type applications having non-currying semantics).
Therefore, an optimization is needed to combine curried functions without partial application uses.
This requires
An analysis to figure out which functions aren't partially applied.
Combine the function funs into a single definition taking multiple arguments.
Scilla's semantics for function applications follows currying semantics.
i.e., when we have
let foo = fun (a : Int32) => fun (b : Int32) => ...
and an applicationfoo a b
, then it is evaluated as "applya
tofoo
to get function, andb
is applied to this result function". In the case offoo
never being applied partially, we should replace the curried functions with a single function that takes two argumentsfun (a : Int32, b : Int32)
.PR #25 defines types and AST to accommodate functions (and function types) that take multiple arguments. Passes after it (ex: closure conversion) are already designed to work on functions with multiple arguments (and type applications having non-currying semantics).
Therefore, an optimization is needed to combine curried functions without partial application uses.
This requires
fun
s into a single definition taking multiple arguments.App
sequences (which represent a sequence of partial applications: see Explicitize partial applications of functions. #23, Define an AST with no currying semantics and translate to it #25 ) into anApp
with multiple arguments.The transformation can likely be written in
Uncurry.ml
, after the translation intoUncurried_Syntax
.The text was updated successfully, but these errors were encountered: