
It sounds a little as though you want a family of n-ary union type constructor. A crude first attempt would be: data Either2 t1 t2 = In1 t1 | In2 t2 data Either3 t1 t2 t3 = In1 t1 | In2 t2 | In3 t3 ... but this would be a bit tedious to use because the names are a bit meaningless - you'd be relying heavily on type checking to keep you straight. e.g., it's kinds hard to read: f :: Either String Bool -> Either String Bool f (In1 "Fred") = In1 "Frederick" f (In2 m) = In2 (not m) Proposals for records gives you an easy way to define arbitrary product types with convenient syntax: { name = "Fred", married = True } :: { name :: String, married :: Bool } Maybe what you really want here is a way to define union types with some convenient syntax. In the following made up syntax, |[ ... |] contains a list of types to be unioned together with each type labelled by a constructor name. f :: |[ Name :: String, Married :: Bool |] -> |[ Name :: String, Married :: Bool |] f |[ Name = "Fred" |] = |[ Name = "Frederick |] f [| Married = m |] = [| Married = not m |] I wonder if an extension like this would be generally useful? (Would it be useful for defining a compiler/interpreter by first giving a simple language and then adding further operations?) -- Alastair Reid