X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fglasgow_exts.xml;h=c9dfaf0a12ebc574b964f12222d9f60772bb0a72;hb=8bbcb41030b261c5070593d31760a01216dea441;hp=7dca09a2b382dc709eebc6653abffc64066ffef8;hpb=9bc17c05ec0ef9820a3561c280d4062712e52260;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/glasgow_exts.xml b/ghc/docs/users_guide/glasgow_exts.xml index 7dca09a..c9dfaf0 100644 --- a/ghc/docs/users_guide/glasgow_exts.xml +++ b/ghc/docs/users_guide/glasgow_exts.xml @@ -1092,8 +1092,12 @@ because GHC does not allow unboxed tuples on the left of a function arrow. The idea of using existential quantification in data type declarations -was suggested by Laufer (I believe, thought doubtless someone will -correct me), and implemented in Hope+. It's been in Lennart +was suggested by Perry, and implemented in Hope+ (Nigel Perry, The Implementation +of Practical Functional Programming Languages, PhD Thesis, University of +London, 1991). It was later formalised by Laufer and Odersky +(Polymorphic type inference and abstract data types, +TOPLAS, 16(5), pp1411-1430, 1994). +It's been in Lennart Augustsson's hbc Haskell compiler for several years, and proved very useful. Here's the idea. Consider the declaration: @@ -4365,12 +4369,13 @@ can still define and use your own versions of -To have the compiler ignore uses of assert, use the compiler option -. -fignore-asserts -option That is, expressions of the form +GHC ignores assertions when optimisation is turned on with the + flag. That is, expressions of the form assert pred e will be rewritten to -e. - +e. You can also disable assertions using the + + option + . Assertion failures can be caught, see the documentation for the @@ -4633,6 +4638,29 @@ key_function :: Int -> String -> (Bool, Double) + + LANGUAGE pragma + + LANGUAGEpragma + pragmaLANGUAGE + + This allows language extensions to be enabled in a portable way. + It is the intention that all Haskell compilers support the + LANGUAGE pragma with the same syntax, although not + all extensions are supported by all compilers, of + course. The LANGUAGE pragma should be used instead + of OPTIONS_GHC, if possible. + + For example, to enable the FFI and preprocessing with CPP: + +{-# LANGUAGE ForeignFunctionInterface, CPP #-} + + Any extension from the Extension type defined in + Language.Haskell.Extension may be used. GHC will report an error if any of the requested extensions are not supported. + + + LINE pragma @@ -4643,9 +4671,7 @@ key_function :: Int -> String -> (Bool, Double) code. It lets you specify the line number and filename of the original code; for example - -{-# LINE 42 "Foo.vhs" #-} - +{-# LINE 42 "Foo.vhs" #-} if you'd generated the current file from something called Foo.vhs and this line corresponds to line