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

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.

Thoughts appreciated.

Rob
-- 
--
Rob Turner, Dept. of Computer Science, University of Hull, UK.
Internet: [EMAIL PROTECTED]   Phone: (0482) 465212

Reply via email to