data Prog a b
= MkProg { globals :: [(Name,Ty,Maybe (Exp b))]
, comp :: Comp a b }
However, <let-decl>includes a letref case, so there is no need to separately allow for a list of declarations (vars). Similarly, we have for function definitions
LetFunC :: Name
-> [(Name, CallArg Ty CTy0)] -- params (could include computation types)
-> [(Name,Ty,Maybe (Exp b))] -- locals
-> Comp a b -- body
-> Comp a b -- rhs
-> Comp0 a b
but again here too the Comp can include its own let refs.
In both cases the separate list of vars is redundant, and removing them is a simplification without loss of generality (though we need to exercise some care or we might incur a performance regression).
The top-level grammar rule is currently
with corresponding AST
However,
<let-decl>
includes aletref
case, so there is no need to separately allow for a list of declarations (var
s). Similarly, we have for function definitionswith corresponding AST
but again here too the
Comp
can include its ownlet refs
.In both cases the separate list of
var
s is redundant, and removing them is a simplification without loss of generality (though we need to exercise some care or we might incur a performance regression).