To me, List(1, "a") should be a type error as it is in Haskell ([1, "a"]),
and to denote a HList you should (and do) need to use something other than
List. Similarly, to create a List<Integer|String> you should need some
other syntax. Otherwise, especially with type inference, you can end up
with surprising type errors elsewhere, and code that's hard to read the
types of.


On Fri, Feb 21, 2014 at 5:04 PM, Cédric Beust ♔ <ced...@beust.com> wrote:

> On Fri, Feb 21, 2014 at 2:02 PM, Kevin Wright <kev.lee.wri...@gmail.com>
> wrote:
>
>
>>>  That's something I definitely want for tuples but probably not for
>>> lists, although there's definitely a bit of room for interpretation, here
>>> (the regular interpretation for a list expects the ordering to be preserved
>>> but if you look at List from the monad perspective, a list is just an
>>> enumeration of multiple outcomes, and the ordering is meaningless).
>>>
>>
>> Not so!  A list has a very definite concept of maintaining its sequence;
>> it's Set that doesn't.
>>
>  Yes for values, more disputable for types.
>
> Basically, it’s not quite clear to me what the type of List(1, "a") is:
> is it a sequence of an integer followed by a string (and in that order
> exclusively) or is it a list of anything as long as it’s an integer or a
> string?
>  --
> Cédric
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Java Posse" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to javaposse+unsubscr...@googlegroups.com.
> To post to this group, send email to javaposse@googlegroups.com.
> Visit this group at http://groups.google.com/group/javaposse.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups "Java 
Posse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to javaposse+unsubscr...@googlegroups.com.
To post to this group, send email to javaposse@googlegroups.com.
Visit this group at http://groups.google.com/group/javaposse.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to