Changes between Version 39 and Version 40 of Holes


Ignore:
Timestamp:
May 17, 2012 8:35:29 AM (3 years ago)
Author:
spl
Comment:

Respond to SLPJ

Legend:

Unmodified
Added
Removed
Modified
  • Holes

    v39 v40  
    162162Inferred type: MonadPlus m => m b 
    163163}}} 
    164 Again, note that the type variables are universally quantified over all reports, not each report separately.  '''SLPJ''' I have no idea what this sentence means.  '''End of SLPJ'''. 
     164Again, note that the type variables are universally quantified over all reports, not each report separately.  '''SLPJ''' I have no idea what this sentence means.  '''End of SLPJ'''. '''SPL''' It means that the `m` in the first report is the same `m` as in the second. Likewise for the `b`. '''End of SPL''' 
    165165 
    166166'''SLPJ'''.  I am very uncomfortable with saying anything like 
     
    182182'''End of SLPJ''' 
    183183 
     184'''SPL''' I don't understand the problem. 
     185 
     186 1. When I try the following, it works fine: 
     187{{{ 
     188import Control.Monad 
     189 
     190f x = do 
     191  y <- undefined x 
     192  y `mplus` boo 
     193 
     194boo :: MonadPlus m => m b 
     195boo = undefined 
     196}}} 
     197 1. Perhaps it's not technically correct to call `MonadPlus m => m b` the "inferred type," but it is the type with the minimum set of constraints that type needs to fulfill to be accepted. Or maybe I'm missing something. 
     198 1. How would you report the type of the holes? The above wording is merely a suggestion, but I think all that information should be there. 
     199 
     200'''End of SPL''' 
    184201 
    185202=== Comparison === 
     
    285302'''End of SLPJ''' 
    286303 
     304'''SPL''' 
     305This is the approach that we have been going with. However, the result seems unintuitive when you consider the `Foo` example below, because the deferred type error would pop up at the `show` applied to `(Foo ...)` and not at the hole itself. When I write such code, I would expect an error at the hole `_?h` and not a different error at some (potentially distant?) other point due to a unexpectedly deferred ambiguity type error.  
     306'''End of SPL''' 
     307 
    287308A hole with an ambiguous type should probably be treated as a hole runtime error and not a deferred type error (see [#Runtimeerror Runtime error] for an example); however, not all holes are the immediate cause of ambiguity type errors. For example, consider: 
    288309{{{