Extensible downcasts impossible in Haskell? (was Re: Monomorphism, monomorphism...)

Tom Pledger Tom.Pledger@peace.com
Tue, 9 Oct 2001 10:50:19 +1300

Marcin 'Qrczak' Kowalczyk writes:
 | Since OO languages often use subtypes to emulate constructors of
 | algebraic types, they need downcasts. In Haskell it's perhaps less
 | needed but it's a pity that it's impossible to translate an OO
 | scheme which makes use of downcasts into Haskell in an extensible
 | way (algebraic types are "closed").


I'm curious about this impossibility.

  - Is it well known?  If so, would someone please refer me to a paper
    or posting which explains it?

  - Does it just affect Haskell 98, or does it have deep implications
    for any future language extensions?

  - How does it relate to the alternative record mechanism idea you
    mentioned a while ago?