From 2d4a00233762ff9b5944e4bd0451d9dc6fe974a5 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 22 Mar 2001 11:00:54 +0000 Subject: [PATCH] [project @ 2001-03-22 11:00:54 by simonpj] Add a bit more info about -fno-implicit-prelude --- ghc/docs/users_guide/glasgow_exts.sgml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index 8589b04..951b59c 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -240,8 +240,8 @@ program), you may wish to check if there are libraries that provide a "Prelude.fromInteger 1", which is what the Haskell Report specifies. So the flag causes the - following pieces of built-in syntax to refer to whatever - is in scope, not the Prelude versions: + following pieces of built-in syntax to refer to whatever + is in scope, not the Prelude versions: @@ -260,13 +260,25 @@ program), you may wish to check if there are libraries that provide a In an n+k pattern, the standard Prelude - Ord class is used for comparison, + Ord class is still used for comparison, but the necessary subtraction uses whatever "(-)" is in scope (not "Prelude.(-)"). + Note: Negative literals, such as -3, are + specified by (a careful reading of) the Haskell Report as + meaning Prelude.negate (Prelude.fromInteger 3). + However, GHC deviates from this slightly, and treats them as meaning + fromInteger (-3). One particular effect of this + slightly-non-standard reading is that there is no difficulty with + the literal -2147483648 at type Int; + it means fromInteger (-2147483648). The strict interpretation + would be negate (fromInteger 21474836483), + and the call to fromInteger would overflow (at type Int, remember). + + -- 1.7.10.4