Type Pattern-Matching for Existential Types
Ashley Yakeley
ashley@semantic.org
Tue, 30 Jan 2001 23:31:36 -0800
At 2001-01-30 23:11, Johan Nordlander wrote:
>However, this whole idea gets forfeited if it's possible to look behind
>the abstraction barrier by pattern-matching on the representation.
Isn't this information-hiding more appropriately achieved by hiding the
constructor?
--
data IntOrChar = MkInt Int | MkChar Char
data Any = forall a. MkAny a
--
Surely simply hiding MkInt, MkChar and MkAny prevents peeking?
--
Ashley Yakeley, Seattle WA