Rodrigo Kumpera wrote:
> Encoding some construct from functional languages like type classes 
> can be quite tricky,
> specially if the objective is to produce fast code.

As you and I discussed another time, it's certainly possible to do a 
sufficiently straightforward encoding:
http://lambda-the-ultimate.org/node/3531#comment-50431

Using this encoding is a little unwieldy in C# because type inference 
doesn't work very well with these nested generic types, but BitC could 
manage.

> The CLI type system is not expressible enough to support tag-less safe 
> unions.
> Mostly because it's undecidable which element is been used without 
> either tags
> or explicit checks.

I don't think the idea is tag-less unions, but tagged unions. Tagless 
unions are one step beyond, but I can see how they could be useful. A 
phantom type as a type tag would work, assuming the compiler was aware 
of its meaning.

Sandro

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to