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
The online demo doesn't have sum type support. There's some experimental support for sum types in the master branch, but the syntax isn't exactly stable. At the moment, it looks like this:
def map(f, list) = match list {
case 'nil => 'nil
case 'cons(hd = x, tl = xs) => 'cons(hd = f(x), tl = map(f, xs))
}
Yes, they're similar to OCaml's polymorphic variants in that the variant names are just labels, not defined identifiers. Internally they use subtyping, rather than the row variables used by OCaml.
Are sum types supported? If so, would it be possible to document the syntax used in the demo?
The text was updated successfully, but these errors were encountered: