Re: [Haskell-cafe] compiler pragma's

2011-09-10 Thread Erik Hesselink
On Fri, Sep 9, 2011 at 23:41, Vasili I. Galchin vigalc...@gmail.com wrote:
    Is there a list of compiler pragmas? Specifically I am looking at how to
 specify more than one type variable in a class definition. Also I have
 forgotten the meta syntax for specifying a pragma ... some kind of Haskell
 comment?

If you're using GHC, there is a list of language extensions in the
user's guide chapter 7 [1]. Specifically, 7.13 specifies the language
pragma's. To turn on a language extension, you use the LANGUAGE pragma
with the specific extension(s) you want. In this case, you want
MultiParamTypeClasses, section 7.6.1.1. So the exact syntax will be:

{-# LANGUAGE MultiParamTypeClasses #-}

Put this at the top of your source file.

Note that the link is to the documentation for the latest version of
GHC (7.2.1 as of this writing). There are also links to specific
version, that might be more appropriate depending on the version of
GHC you have.

Erik

[1] 
http://haskell.org/ghc/docs/latest/html/users_guide/ghc-language-features.html

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] compiler pragma's

2011-09-09 Thread Vasili I. Galchin
Hello,

   Is there a list of compiler pragmas? Specifically I am looking at how to
specify more than one type variable in a class definition. Also I have
forgotten the meta syntax for specifying a pragma ... some kind of Haskell
comment?

Thanks,

Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] compiler pragma's

2011-09-09 Thread Ivan Lazar Miljenovic
On 10 September 2011 07:41, Vasili I. Galchin vigalc...@gmail.com wrote:
 Hello,

    Is there a list of compiler pragmas?

They are located in the documentation for the implementation that
you're using.  In particular, ghci will suggest possible pragmas.

 Specifically I am looking at how to
 specify more than one type variable in a class definition. Also I have
 forgotten the meta syntax for specifying a pragma ... some kind of Haskell
 comment?

At the top of your file:

{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}

(You want the first pragma, and may want the second.)

-- 
Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com
IvanMiljenovic.wordpress.com

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe