<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 29, 2013 at 8:51 PM, Chris King <span dir="ltr"><<a href="mailto:email@example.com" target="_blank">firstname.lastname@example.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">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.</blockquote>
</div><br>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.<br>
<br clear="all"><div>I really dislike not using atoms for this. Intuitively and because of the inherent type complexity (yes, I have a bias here).</div><div><br></div>-- <br>J.