[Haskell-cafe] Why aren't there anonymous sum types in Haskell?
dmbarbour at gmail.com
Wed Jun 22 01:48:29 CEST 2011
On Tue, Jun 21, 2011 at 2:24 PM, pipoca <eliyahu.ben.miney at gmail.com> wrote:
> On Jun 21, 4:57 pm, Alexey Khudyakov <alexey.sklad... at gmail.com>
> > Types may be same.
> > oops :: Int :+: Int -> Int
> > oops <Int i> = mmm which one?
> If you were to have your anonymous sum types be a union instead of the
> disjoint union, then you could say that A :+: A has no meaning.
That sort of union would not be parametric, and would play havoc with
E.g. consider taking a list [(t,Int)] and [(t,a)] and generating a list of
[(t,Int :+: a)], then processing this with a function of the form Int ->
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe