Open Mesabloo opened 3 years ago
The retained grammar for zilch effect constructs, as originally discussed in the linked discussion (at the bottom of the linked issue), is:
effect handlers (potentially parameterized):
forall-quantification ::= '<' (id+ ':' kind | id)*_',' ('|' type+_',')? '>'
handler ::=
'handler' id forall-quantification? ('(' (id (':' type)?)*_',' ')')? ':=' { handler-branch+_; }
handler-branch ::= 'return' id ('->' | '→') expr
| id '(' id*_, ')' ('->' | '→') expr
effect ::= 'effect' id ('(' id*_',' ')')? ':=' { (id ':' type)*_; }
effect-row ::= '{' type*_',' ('|' id+_',')? '}'
arrow-type ::= type-atom effect-row? ('->' | '→') type
| '(' type+_',' ')' effect-row? ('->' | '→') type
where type-atom
is specifically defined not to include some types (e.g. arrow-type
) and ->
is equivalent to {}->
x*_s
is a shortcut for (x (s x)*)?
x+_s
is a shortcut for x (s x)*
To do: