[Haskell-cafe] Template Haskell a Permanent solution?

Christian Maeder Christian.Maeder at dfki.de
Tue Jan 4 14:14:45 CET 2011


Am 27.12.2010 08:44, schrieb Henning Thielemann:
> 
> On Mon, 27 Dec 2010, Jonathan Geddes wrote:
> 
>> #1 Parse a string at compile-time so that a custom syntax for
>> representing data can be used. At the extreme, this "data" might even
>> be an EDSL.
> 
> I think it would be enough, if the compiler could be told to unfold an
> expression like
>   parse "text in a domain specific language"
>  at compile time.
> 
>> #2 Provide instances automatically.
> 
> http://www.haskell.org/ghc/docs/7.0-latest/html/users_guide/generic-classes.html

I see the text below and have no idea where the package lang or the
module Generic comes from. Can someone enlighten me?

I didn't find package lang on hackage.

Cheers Christian

7.16.1.  Using generics

To use generics you need to

    *

      Use the flags -fglasgow-exts (to enable the extra syntax),
-XGenerics (to generate extra per-data-type code), and -package lang (to
make the Generics library available.
    *

      Import the module Generics from the lang package. This import
brings into scope the data types Unit, :*:, and :+:. (You don't need
this import if you don't mention these types explicitly; for example, if
you are simply giving instance declarations.)






More information about the Haskell-Cafe mailing list