|
Re: Union Types for Haskell!?: msg#00080lang.haskell.general
Hi Bernd, > data B = ... > data C = ... > type A = B | C | D -- A accepts values of either B or C or D (cf. the > "Either a" type in the Prelude) What about the construction of a union type in Haskell like this?: data B = B1 | B2 data C = C1 | C2 | C3 data D = D1 | D2 data A = UB B | UC C | UD D -- here's the union type For instance a list of type [A] may look like this: [UB B1,UC C2,UC C1,UD D1] Christian |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Union Types for Haskell!?: 00080, Pixel |
|---|---|
| Next by Date: | Re: Union Types for Haskell!?: 00080, Johan Nordlander |
| Previous by Thread: | Re: Union Types for Haskell!?i: 00080, Ashley Yakeley |
| Next by Thread: | Re: Union Types for Haskell!?: 00080, Bernd Holzmüller |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |