Closed j14159 closed 6 years ago
In Elm this distinction is made explicit with the alias
keyword, i.e.
type alias MyRecord = { a : Int, b : String }
type MyAdt = One | Two | Three
I think the rules you give to distinguish type aliases from ADTs are clear enough, though.
Something like:
is currently represented as:
in the typer. This causes issues when used by another type in a record transformation. Here's a failing test example:
This crashes for two reasons:
rec
inrebind_y
to be a record type (empty record) puts a link in the environment which is unanticipated by a pattern match.The record dumped to the console:
I'd like to make the change that any user-defined type with a single member and no type constructor will be a type alias internally, not an ADT.