[Haskell-cafe] Over general types are too easy to make.
Tim Docker
tim at dockerz.net
Sun Sep 2 14:03:36 CEST 2012
On 02/09/12 20:35, timothyhobbs at seznam.cz wrote:
>
> It seems to be a probability approaching law, that I run into this for
> a given multi-constructor type. Regardless of it's purpose.
>
Maybe your large multi-constructor types are too monolithic? Again it's
hard to know given a fabricated example, but I would have been satisfied
with something like:
data Foo = Foo {...}
data Bar = Bar {...}
data Frog = Frog {...}
data LargeUnion = UFoo Foo
| UBar Bar
| UFrog Frog
case largeUnion of
(UFoo foo) -> processFoo foo
(UBar bar) -> processBar bar
(UFrog frog) -> processFrog frog
But I think from your original mail, you find this ugly in some way?
Tim
More information about the Haskell-Cafe
mailing list