[Haskell-cafe] Over general types are too easy to make.

Kristopher Micinski krismicinski at gmail.com
Sun Sep 2 21:10:20 CEST 2012


On Sun, Sep 2, 2012 at 12:06 PM, Alexander Solla <alex.solla at gmail.com> wrote:
>
>
> On Sun, Sep 2, 2012 at 9:40 AM, <timothyhobbs at seznam.cz> wrote:
>>
>> The thing is, that one ALWAYS wants to create a union of types, and not
>> merely an ad-hock list of data declarations.  So why does it take more code
>> to do "the right thing(tm)" than to do "the wrong thing(r)"?
>
>
> Because a union type is a complex union of parts, and the parts need to be
> deconstructed in order to be acted upon.  There is not a unique way to do
> this -- different "unwrappings" have different properties and must match
> your use case.
>
> Perhaps you should read "Data types ala carte" (W. Swiestra) [1], which
> provides an approach to constructing "open" data types (i.e., sum types to
> which new summands can be added)
>
>
> [1] http://www.cs.ru.nl/~W.Swierstra/Publications/DataTypesALaCarte.pdf
>

If you're going to suggest that line of thinking you might also the
concept of rows in general.., though I'm not sure that's really quite
what he wants.

kris



More information about the Haskell-Cafe mailing list