[GHC] #5624: Delay Errors Until Runtime

GHC cvs-ghc at haskell.org
Thu Nov 10 23:02:14 CET 2011


#5624: Delay Errors Until Runtime
---------------------------------+------------------------------------------
    Reporter:  atnnn             |       Owner:  atnnn       
        Type:  feature request   |      Status:  new         
    Priority:  normal            |   Component:  Compiler    
     Version:  7.3               |    Keywords:              
    Testcase:                    |   Blockedby:              
          Os:  Unknown/Multiple  |    Blocking:              
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown
---------------------------------+------------------------------------------
 I would like to add an -XDelayErrors flag to GHC that
 - changes most type errors into warnings
 - replaces the faulty expressions with runtime exceptions

 This would make haskell development a lot easier. For example, this
 makes it possible to load buggy code into ghci to be able to execute
 it and show inferred types.

 {{{
 $ cat hello.lhs
 > main = putStr "Hello World" >> putStr ','

 $ inplace/bin/ghc-stage2 --make hello -XDelayErrors
 [1 of 1] Compiling Main             ( hello.lhs, hello.o )
 Linking hello ...

 $ ./hello
 Hello World
 hello: hello.lhs:1:41:
     Couldn't match expected type `GHC.Base.String'
                 with actual type `GHC.Types.Char'
     In the first argument of `System.IO.putStr', namely ','
     In the second argument of `(GHC.Base.>>)', namely
       System.IO.putStr ','
     In the expression:
       System.IO.putStr "Hello World" GHC.Base.>> System.IO.putStr ','

 }}}

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



More information about the Glasgow-haskell-bugs mailing list