CF normalisation to ANF doesn't support pattern function arguments
- Dominant language
- Standard ML
- Stars
- 1.2k
- Forks
- 104
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 16
Description
This code:
```sml
fun supervisor x = (
FirstFunc.firstFunc ();
SecondFunc.secondFunc ()
);
```
Produces this s-expr, which parses fine (with `cake --sexp=true`)
```
(Tdec (Dletrec (0 0 0 0 0 0) (("supervisor" "x" Let (SOME "a") (Con NONE nil) (Let NONE (App Opapp ((Var (Long "FirstFunc" (Short "firstFunc"))) (Var (Short "a")))) (Let (SOME "b") (Con NONE nil) (App Opapp ((Var (Long "SecondFunc" (Short "secondFunc"))) (Var (Short "b"))))))))))
```
Whereas the same function, with an `_` in place of the function argument, produces this s-expr, which fails to parse:
```
(Tdec (Dletrec (0 0 0 0 0 0) (("supervisor" nil Mat (Var (Short nil)) ((Pany Let (SOME "a") (Con NONE nil) (Let NONE (App Opapp ((Var (Long "FirstFunc" (Short "firstFunc"))) (Var (Short "a")))) (Let (SOME "b") (Con NONE nil) (App Opapp ((Var (Long "SecondFunc" (Short "secondFunc"))) (Var (Short "b"))))))))))))
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.