[GHC] #1200: ghci scripts ending in printf lines fail with Exception: Prelude.undefined

GHC trac at galois.com
Wed Mar 14 06:23:58 EDT 2007


#1200: ghci scripts ending in printf lines fail with Exception: Prelude.undefined
----------------------------+-----------------------------------------------
 Reporter:  dons            |          Owner:  igloo  
     Type:  bug             |         Status:  new    
 Priority:  normal          |      Milestone:  6.6.1  
Component:  libraries/base  |        Version:  6.6    
 Severity:  normal          |     Resolution:         
 Keywords:                  |     Difficulty:  Unknown
 Testcase:                  |   Architecture:  Unknown
       Os:  Unknown         |  
----------------------------+-----------------------------------------------
Changes (by simonmar):

  * type:  merge => bug

Comment:

 There's oddness certainly, but I think it's different oddness.  In GHCi
 there's no concept of `Main.main`; the normal rules for main don't apply.

 What I think is odd is that you can't just use `printf` from the prompt in
 GHCi without getting an exception.  GHCi is defaulting the return type of
 `printf` to `Integer` and then trying to print it.  I just talked to Simon
 PJ about this, and we think it would be sensible to add `()` to the list
 of default types in GHCi, which would have the effect of making `printf`'s
 result default to `()` and thereby not get printed.

 I've change the ticket back to a bug - we should still merge my patch
 above, but Simon and I are going to make the above change (for 6.8).

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/1200>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list