X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fdocs%2Fusers_guide%2Fglasgow_exts.vsgml;h=b29df6211ae7fe7be15baf7e32840e443486cc95;hb=297f714906efa8a76378c6fa6db3cd592f896749;hp=f5cdbd257647821c925708347acc0fd4c0ac95dc;hpb=e1a833412aa72cdabf4bd04dcde52a0aca0e1274;p=ghc-hetmet.git diff --git a/ghc/docs/users_guide/glasgow_exts.vsgml b/ghc/docs/users_guide/glasgow_exts.vsgml index f5cdbd2..b29df62 100644 --- a/ghc/docs/users_guide/glasgow_exts.vsgml +++ b/ghc/docs/users_guide/glasgow_exts.vsgml @@ -1,5 +1,5 @@ % -% $Id: glasgow_exts.vsgml,v 1.6 1999/03/16 17:07:21 simonm Exp $ +% $Id: glasgow_exts.vsgml,v 1.20 1999/11/25 10:28:41 simonpj Exp $ % % GHC Language Extensions. % @@ -36,7 +36,7 @@ classes" id="multi-param-type-classes">. Local universal quantification: -GHC's type system supports explicit unversal quantification in +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 . @@ -66,6 +66,17 @@ 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., @@ -234,13 +245,16 @@ may be just the ticket (NB: no chance of such code going through a native-code generator): +import Addr +import CString + oldGetEnv name - = _casm_ ``%r = getenv((char *) %0);'' name >>= \ litstring@(A# str#) -> + = _casm_ ``%r = getenv((char *) %0);'' name >>= \ litstring -> return ( - if (litstring == ``NULL'') then + if (litstring == nullAddr) then Left ("Fail:oldGetEnv:"++name) else - Right (unpackCString# str#) + Right (unpackCString litstring) ) @@ -273,6 +287,35 @@ inlining of C code (GHC - A Better C Compiler :-), the option %************************************************************************ %* * +Literal-literals +