Ticket #5624 (closed feature request: fixed)
Delay Errors Until Runtime
| Reported by: | atnnn | Owned by: | pcapriotti |
|---|---|---|---|
| Priority: | high | Milestone: | 7.6.1 |
| Component: | Compiler | Version: | 7.3 |
| Keywords: | Cc: | ||
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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 ','
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

