Subtypes

1999-11-17 Thread Rob Turner
em is possibly solved by inheritance in the class system, but that only works for pre-defined classes. Or does it? Maybe subtypes don't fit elegantly into the functional model. Maybe they aren't necessary anyway. Thoughts appreciated. Rob -- -- Rob Turner, Dept. of Computer Science, Uni

Re: Subtypes

1999-11-17 Thread Rob Turner
In article <[EMAIL PROTECTED]> [EMAIL PROTECTED] writes: > >datatype weekday = mon | tue | wed | thu | fri; >datatype weekend = sat | sun; >datatype day = wd of weekday | we of weekend; > >Essentially, if you think of your subtypes as "disjoint unions", then

Re: Subtypes

1992-07-23 Thread Thomas Hallgren
d + weekday | | It springs to mind that this kind of problem is possibly solved by | inheritance in the class system, but that only works for pre-defined | classes. Or does it? | | Maybe subtypes don't fit elegantly into the functional model. Maybe | they aren't necessary anyway. | |

Subtypes

1992-07-22 Thread Stephen Ma
> How do you get a subtype in Haskell (or any other functional language > come to that)? I'm thinking along the lines of (pseudo-notation): > > type weekday = {Mon, Tue, Wed, Thur, Fri} > type weekend = {Sat, Sun} > type day = weekend + weekday >