Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 5.6k
    • Issues 5.6k
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 663
    • Merge requests 663
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #5624

Delay Errors Until Runtime

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 ','
Trac metadata
Trac field Value
Version 7.3
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking