% % $Id: glasgow_exts.vsgml,v 1.20 1999/11/25 10:28:41 simonpj Exp $ % % GHC Language Extensions. % As with all known Haskell systems, GHC implements some extensions to the language. To use them, you'll need to give a @-fglasgow-exts@% -fglasgow-exts option option. Virtually all of the Glasgow extensions serve to give you access to the underlying facilities with which we implement Haskell. Thus, you can get at the Raw Iron, if you are willing to write some non-standard code at a more primitive level. You need not be ``stuck'' on performance because of the implementation costs of Haskell's ``high-level'' features---you can always code ``under'' them. In an extreme case, you can write all your time-critical code in C, and then just glue it together with Haskell! Executive summary of our extensions: Unboxed types and primitive operations: You can get right down to the raw machine types and operations; included in this are ``primitive arrays'' (direct access to Big Wads of Bytes). Please see Section and following. Multi-parameter type classes: GHC's type system supports extended type classes with multiple parameters. Please see Section . Local universal quantification: GHC's type system supports explicit universal quantification in constructor fields and function arguments. This is useful for things like defining @runST@ from the state-thread world. See Section . Extistentially quantification in data types: Some or all of the type variables in a datatype declaration may be existentially quantified. More details in Section . Scoped type variables: Scoped type variables enable the programmer to supply type signatures for some nested declarations, where this would not be legal in Haskell 98. Details in Section . Calling out to C: Just what it sounds like. We provide lots of rope that you can dangle around your neck. Please see Section . Pragmas Pragmas are special instructions to the compiler placed in the source file. The pragmas GHC supports are described in Section . Rewrite rules: The programmer can specify rewrite rules as part of the source program (in a pragma). GHC applies these rewrite rules wherever it can. Details in Section . Pattern guards add a more flexible syntax and semantics for guards in function definitions. This gives expressiveness somewhat comparable to that of ``views''. Before you get too carried away working at the lowest level (e.g., sloshing @MutableByteArray#@s around your program), you may wish to check if there are system libraries that provide a ``Haskellised veneer'' over the features you want. See Section . %************************************************************************ %* * Unboxed types