Overlapping types

2000-08-23 Thread Tom Pledger
Tom Pledger writes: > [...] > > --Subtype should be transitive; I may have done something evil > --here, because Classic Hugs (November 1999) with the `-98' flag > --rejects this decl with the message `Undefined type variable "b"' > instance (Subtype a b, Subtype b c) => Sub

Re: Overlapping types

2000-08-21 Thread Tom Pledger
Keith Wansbrough writes: > > class Subtype sub super where > > up :: sub -> super > > down :: super -> Maybe sub > > See the extensible union types of [Sheng Liang, Paul Hudak and Mark > Jones: Monad Transformers and Modular Interpreters] > > From the abstract: >

Re: Overlapping types

2000-08-21 Thread Keith Wansbrough
> class Subtype sub super where > up :: sub -> super > down :: super -> Maybe sub See the extensible union types of @InProceedings{ Liang*95:Monad, author="Sheng Liang and Paul Hudak and Mark Jones", title="Monad Transformers and Modular Interpreters", crossre

Overlapping types

2000-08-20 Thread Tom Pledger
The recent suggestion that OO and FP are somewhat out of phase reminds me of a pet topic: overlapping types. This is (IMHO) the only feature of OO for which there is (AFAICS) no FP equivalent. Here's a more concrete proposal than my previous vague rants on the subject. module Treat