[erlang-questions] Maps branch and disclaimers
Jesper Louis Andersen
Tue Oct 29 21:33:22 CET 2013
On Tue, Oct 29, 2013 at 8:51 PM, Chris King <> wrote:
> No it's not. Unless you define the input type as :- type order() :: eq |
> lt | gt. Well, you can do the same thing with integers in Erlang: :- type
> order() :: -1 | 0 | 1.
Depending on the type system, this is either possible or it is not. A type
system based on success types can allow it, but then you have the problem
that it isn't a traditional type system. If you want a traditional static
type system, then I'd bet that it won't be trivial to handle -1 | 0 | 1 as
a subtype of the integers. You need either dependent types or refinement
types. And that will be a beast to tackle.
I really dislike not using atoms for this. Intuitively and because of the
inherent type complexity (yes, I have a bias here).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions