[Haskell-cafe] Template Haskell sees into abstract data types

David Menendez dave at zednenem.com
Sat Jul 3 20:43:23 EDT 2010

On Sat, Jul 3, 2010 at 7:20 PM, Ivan Lazar Miljenovic
<ivan.miljenovic at gmail.com> wrote:
> Serguey Zefirov <sergueyz at gmail.com> writes:
>>>> I cannot directly create my own class instances for them because of
>>>> that. But I found that I can write Template Haskell code that could do
>>>> that - those data types could be reified just fine.
>>>> This is somewhat strange situation.  Was it a design decision?
>>> The reason that they are exported abstractly is so that you don't see
>>> the internals of the data structure, because 1) you don't need to, and
>>> 2) to stop you from doing anything stupid with them.
>> I was talking about successful reification of abstract data types.
>> That way I can do anything stupid with them.
> Why do you want to?

I believe the point is that Template Haskell can see the internal
structure of a type even when the constructors are not exported. The
question is whether or not that is intentional.

Dave Menendez <dave at zednenem.com>

More information about the Haskell-Cafe mailing list