Changes between Version 35 and Version 36 of Holes


Ignore:
Timestamp:
May 16, 2012 12:27:23 PM (3 years ago)
Author:
spl
Comment:

Respond to SLPJ on runtime error

Legend:

Unmodified
Added
Removed
Modified
  • Holes

    v35 v36  
    226226
    227227When using holes (i.e. {{{-XHoles}}} is set), we expect the following:
    228   1. The program should type-check as if every hole {{{_?h}}} is replaced with {{{undefined}}}. There is an exception to this rule: see [#Ambiguoustypes Ambiguous types] below.
     228  1. The program should type-check as if every hole {{{_?h}}} is replaced with {{{undefined}}}. See [#Ambiguoustypes Ambiguous types] for an exception to this rule.
    229229  1. If the program is well-typed (as above), then:
    230230    * The types of all holes should be reported.
    231     * Reporting the hole types should not cause type-checking (or compiling in general) to stop (in error). '''SLPJ what does this mean? ''' A type error *never* causes type checking to stop.  Do you mean that a program with holes (but no other errors) should compile and run, falling over at runtime only if you evaluate a hole?  Please give an example.  '''End of SLPJ'''
     231    * Assuming no other errors, the program should compile and run.
     232    * If running a program causes a hole to be evaluated, the evaluation should fail with an runtime error. See [#Runtimeerror Runtime error] for an example.
    232233  1. (optional) If the program is ill-typed, then:
    233234    * The types of all holes should be reported.
     
    259260
    260261The 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 been 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}}}).
     262
     263=== Runtime error ===
     264
     265Given the following module:
     266{{{
     267main = _?x
     268}}}
     269we expect (something like) the runtime error:
     270{{{
     271blah: blah.hs:2:1:
     272    Found the hole `_?x' with type `IO t'
     273    In the expression: _?x
     274    In the definition of `main': main = _?x
     275}}}