[Haskell-cafe] Why aren't there anonymous sum types in Haskell?

Casey McCann syntaxglitch at gmail.com
Wed Jun 22 04:48:52 CEST 2011

On Tue, Jun 21, 2011 at 9:51 PM, wren ng thornton <wren at freegeek.org> wrote:
> I don't think there are any problems[1].
> [1] modulo the A:+:A ~ A issue.

That issue is exactly my concern, though, and it seems a bit too
thorny to handwave aside. For instance, doesn't this also cause
problems for anything of the form (A :+: B) :+: (A :+: C)? I don't
doubt there exist formulations that make sense, but it's not
immediately obvious to me what they would be, and how they'd behave
used as types in something like Haskell. You wouldn't be able to have
a straightforward function with the type "forall a b c. (a -> b) -> (a
:+: c -> b :+: c)", among other things.

In contrast, ordered pairs and disjoint unions are tidy, simple, and obvious.

- C.

More information about the Haskell-Cafe mailing list