Is it possible to add type annotations for module params, maybe it's not implemented yet?
I expected to be able to do something like this but I get parsing errors.
module {
stdin : {} -> Task {} _,
stdout : {} -> Task {} _,
time : {} -> Task U128 _,
} -> [Solution, solve]
$ roc check package/AoC.roc
── UNFINISHED RECORD PATTERN in package/AoC.roc ────────────────────────────────
I am partway through parsing a record pattern, but I got stuck here:
1│ module {
2│ stdin : {} -> Task {} _,
^
I was expecting to see a closing curly brace before this, so try
adding a } and see if that helps?%
Try putting the function type in parentheses?
They usually don't like being bare in record types
I might spend some time consolidating our record parsing this weekend
No joy
module {
stdin : ({} -> Task {} _),
stdout : ({} -> Task {} _),
time : ({} -> Task U128 _),
} -> [Solution, solve]
── UNFINISHED PARENTHESES in package/AoC.roc ───────────────────────────────────
I am partway through parsing a pattern in parentheses, but I got stuck
here:
2│ stdin : ({} -> Task {} _),
^
I was expecting to see a closing parenthesis before this, so try
adding a ) and see if that helps?%
Try making an alias?
There’s no syntax for annotating module params in the proposal. That part of the header is literally parsed as a record pattern now.
I agree it’d be nice to be able to do that, though
Last updated: Jul 06 2025 at 12:14 UTC