Type alias without all type arguments specified (type Alias MyList = List) #196
Unanswered
edwardpeters
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It's not intended. This is a missing check in the Elm frontend. Originally we started out by making the assumption that users call the Elm compiler before running We don't have semantics documented to this level. Unless stated otherwise Elm's semantics apply for now. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I try to compile
type alias MyList = List
in native elm, it fails with
The
Listtype needs 1 argument, but I see 0 instead:
The same in morphir-elm compiles without issue, but I have not found any way to create a valid example (I cannot seem to instantiate a
MyList Int
, for instanceI'm not sure whether this functionality - allowing aliasing of generic types without all parameters specified - is intended or not. Is this a case where the compiler lets invalid type definitions through, or is there a valid implementation/use of the type as defined that I just haven't found?
On a general note, is there a place where semantics and type rules are documented at this level of specificity?
(For context, I'm working on a scala type checker and need to know if I should support this case.)
Beta Was this translation helpful? Give feedback.
All reactions