Home
Reading
Searching
Subscribe
Sponsors
Statistics
Posting
Contact
Spam
Lists
Links
About
Hosting
Filtering
Features Download
Marketing
Archives
FAQ
Blog
 
Gmane
From: Simon Peyton Jones <simonpj <at> microsoft.com>
Subject: [commit: ghc] master: Document eta expansion under GHC bugs and infelicities (2822e00)
Newsgroups: gmane.comp.lang.haskell.cvs.ghc
Date: Monday 30th April 2012 15:51:26 UTC (over 4 years ago)
Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/2822e00d3e126e30c3ed2ca8dc90a075180e42ec

>---------------------------------------------------------------

commit 2822e00d3e126e30c3ed2ca8dc90a075180e42ec
Author: Simon Peyton Jones 
Date:   Mon Apr 30 16:43:02 2012 +0100

    Document eta expansion under GHC bugs and infelicities

>---------------------------------------------------------------

 docs/users_guide/bugs.xml |   26 ++++++++++++++++++++------
 1 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/docs/users_guide/bugs.xml b/docs/users_guide/bugs.xml
index c2abe45..49d6a8d 100644
--- a/docs/users_guide/bugs.xml
+++ b/docs/users_guide/bugs.xml
@@ -107,17 +107,31 @@ main = do args <- getArgs
   
       Expressions and patterns
 
-	None known.
+    In its default mode, GHC makes some programs sligtly more
defined 
+    than they should be. For example, consider
+    
+f :: [a] -> b -> b
+f [] = error "urk"
+f (x:xs) = \v -> v
+
+main = print (f [] `seq` True)
+    
+This should call error but actually prints
True.
+Reason: GHC eta-expands f to
+    
+f :: [a] -> b -> b
+f []     v = error "urk"
+f (x:xs) v = v
+    
+This improves efficiency slightly but significantly for most programs, and
+is bad for only a few.  To suppress this bogus "optimisation" use
.
+
+
     
 
     
       Declarations and bindings
 
-      GHC's typechecker makes all pattern bindings monomorphic
-      by default; this behaviour can be disabled with
-      .  See .
-
       In its default mode, GHC does not accept datatype contexts,
       as it has been decided to remove them from the next version of the
       language standard. This behaviour can be controlled with the
 
CD: 4ms