archives

Specializing values in a functional language

Assume a Haskell-like language. Say you have a value of an unknown (abstract) type, but you know it is either an integer, a string, or a tree node.

Are there (/have there been) extensions to Haskell that you can safely inspect and specialize the type of that given value?