[Fwd: Re: [Haskell-cafe] Typeclasses and GADT [Was: Regular Expressions without GADTs]]

Tomasz Zielonka tomasz.zielonka at gmail.com
Wed Oct 26 13:22:42 EDT 2005


On 26 Oct 2005 10:11:25 -0400, kahl at cas.mcmaster.ca
<kahl at cas.mcmaster.ca> wrote:
> Tomasz Zielonka <tomasz.zielonka at gmail.com> wrote
> Wed, 26 Oct 2005 13:37:29 +0200:
>  >
>  > Speaking about casts, I was playing with using GADTs to create a
>  > non-extensible version of Data.Typeable and Data.Dynamic.
>  > I wonder if it's possible to write such a thing without GADTs (and
>  > unsafeCoerce, which is used in Data.Dynamic, IIRC).
>
> It is possible to get even closer to Typeable by using
> the same interface --- which is sufficient for some applications.

Hmmm... but you use unsafeCoerce, don't you? ;-)

I might have been unclear about it - I didn't want to use unsafeCoerce.
With unsafeCoerce you can easily implement Typeable/Dynamic without
GADTs, don't you?

Best regards
Tomasz


More information about the Haskell-Cafe mailing list