[GHC] #5910: Holes with other constraints

GHC cvs-ghc at haskell.org
Thu Mar 8 11:58:43 CET 2012


#5910: Holes with other constraints
----------------------------------------+-----------------------------------
    Reporter:  xnyhps                   |       Owner:                                   
        Type:  feature request          |      Status:  new                              
    Priority:  normal                   |   Milestone:                                   
   Component:  Compiler (Type checker)  |     Version:  7.5                              
    Keywords:  holes                    |          Os:  Unknown/Multiple                 
Architecture:  Unknown/Multiple         |     Failure:  Incorrect warning at compile-time
  Difficulty:  Unknown                  |    Testcase:                                   
   Blockedby:                           |    Blocking:                                   
     Related:                           |  
----------------------------------------+-----------------------------------

Comment(by simonpj):

 Replying to [comment:3 xnyhps]:

 > Hmm. My intent was to allow typechecking to continue when there are
 holes (so compiling them, similar to {{{undefined}}}, to something like
 {{{throw#}}}). If I understand your suggestion correctly, we should abort
 compilation and show the hole's type as errors when an unresolved hole is
 found.

 No, not at all.  Your new stuff will integrate beautifully with `-fdefer-
 type-errors`.  With this flag, `TcErrors` will build an error thunk for
 any unsolved constraints, thereby deferring the error until runtime just
 as you wanted.  So you can use the holes as to-dos.  Look at
 `TcErrors.reportTidyWanteds`, and note the call to `deferToRuntime`.

 If you want to defer only '''holes''', but not other type errors, until
 runtime, you’d need another flag, but I think as a first cut deferring
 '''all''' type errors (including holes) would do.  Or alternatively you
 could by-default defer holes but not other errors.  But then you’d still
 want a flag to say “don’t defer holes”.

 I strongly urge you to use the `TcErrors` stuff.  It does precisely what
 you want.  If you don’t see how, ask more.

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



More information about the Glasgow-haskell-bugs mailing list