
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

On 10 September 2011 07:41, Vasili I. Galchin
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.Miljenovic@gmail.com IvanMiljenovic.wordpress.com

On Fri, Sep 9, 2011 at 23:41, Vasili I. Galchin
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.ht...
participants (3)
-
Erik Hesselink
-
Ivan Lazar Miljenovic
-
Vasili I. Galchin