[Haskell] Deferred instance declarations (serialization of existential boxes)

Taral taralx at gmail.com
Wed Sep 20 23:13:46 EDT 2006


On 9/20/06, Misha Aizatulin <avatar at hot.ee> wrote:
>   What I need it for is serialization of datatypes with existential
> constructors (see
> http://haskell.org/pipermail/haskell-cafe/2006-September/018041.html)
>   I am having a box like
> > data Box = forall a. Cxt a => Box a
>   and want to write a Read instances for it.

Can you define instance Cxt a => Read (Box a)? If not, then you need
typecase and Haskell does not really support that.

-- 
Taral <taralx at gmail.com>
"You can't prove anything."
    -- Gödel's Incompetence Theorem


More information about the Haskell mailing list