#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:  Other           
  Difficulty:  Unknown                  |    Testcase:                  
   Blockedby:                           |    Blocking:                  
     Related:                           |  
----------------------------------------+-----------------------------------
Changes (by spl):

  * failure:  Incorrect warning at compile-time => Other


Comment:

 If {{{-XHoles}}} is set, we want the following:
   * The program should be type-checked as if every hole {{{_?h}}} is
 replaced by {{{undefined}}}, except:
     * If type-checking would fail due to unsolved constraints that could
 be solved by giving a type to a hole.
   * If the program is well-typed, then:
     * The types of all holes should be reported.
     * Reporting the hole types should not cause type-checking (or
 compiling in general) to stop (in error).
   * (optional) If the program is ill-typed, then:
     * The types of all holes should be reported.

 The above should hold true with and without the monomorphism restriction.
 In particular, if an {{{undefined}}} somewhere in a program type-checked
 with the monomorphism restriction would cause type-checking to fail, then
 a hole in that same position should also cause type-checking to fail.

 The type of a hole should be the resolved type with minimum constraints.
 That is, the type of a hole should only have constraints that have not be
 solved but are either inferred from the context (e.g. {{{show _?h}}}) or
 given in a type annotation/signature (e.g. {{{_?h :: Show a => a}}}.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to