1. 18 Jun, 2015 8 commits
    • Simon Peyton Jones's avatar
      Refactor filterAlts into two parts · ee643698
      Simon Peyton Jones authored
      This splits filterAlts into two:
       - filterAlts
       - refineDefaultAlt
      No change in functionality
    • Simon Peyton Jones's avatar
      Comments plus tiny refactoring · 0899911c
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      A bit more tracing · 760b079d
      Simon Peyton Jones authored
    • Simon Peyton Jones's avatar
      Remove some horrible munging of origins for Coercible · 02bac025
      Simon Peyton Jones authored
      I just didn't think it was buying enough for all the cruft it caused.
      We can put some back if people start complaining about poor error
      messages. I forget quite how I tripped over this but I got sucked in.
      * Lots of tidying up in TcErrors
      * Rename pprArisingAt to pprCtLoc, by analogy with pprCtOrigin
      * Remove CoercibleOrigin data constructor from CtOrigin
      * Make relevantBindings return a Ct with a zonked
        and tidied CtOrigin
      * Add to TcRnTypes
            ctOrigin   :: Ct -> CtOrigin
            ctEvOrigin :: CtEvidence -> CtOrigin
            setCtLoc   :: Ct -> CtLoc -> Ct
    • Simon Peyton Jones's avatar
      Rename getCtLoc, setCtLoc · 4a7a6c3a
      Simon Peyton Jones authored
      getCtLoc -> getCtLocM
      setCtLoc -> setCtLocM
      These operations are monadic, and I want to introduce a
      pure version of setCtLoc :: Ct -> CtLoc -> Ct
    • Simon Peyton Jones's avatar
      Comments only · f4370c61
      Simon Peyton Jones authored
      Rewording in
        Note [Decomposing equality]
        Note [Decomposing newtypes at representational role]
      Richard you may want to check, but I think it's fine.
    • Simon Peyton Jones's avatar
      Report arity errors correctly despite kinds · 5879d5aa
      Simon Peyton Jones authored
      Trac #10516 pointed out that when reporting arity errors
      (like "T needs 2 arguments but has been given 1"), we should
      not count kind arguments, since they are implicit.  If we
      include kind args in the count, we get very confusing error
      messages indeed.
      I did a little bit of refactoring which make some
      error messages wobble around.  But the payload of
      this fix is in TcValidity.tyConArityErr
    • Simon Peyton Jones's avatar
      Care with impossible-cons in combineIdenticalAlts · 023a0ba9
      Simon Peyton Jones authored
      This was a nasty, long-standing bug exposed in Trac #10538.
      Symptoms were that we had an empty case
         case (x :: Either a) of {}
      Core Lint correctly picked this bogus code up.
      Here is what happened
      * In SimplUtils.prepareAlts, we call
      * We had    case x of { Left _ -> e1; Right _ -> e1 }
      * filterAlts did nothing, but correctly retuned imposs_deflt_cons
        saying that 'x' cannot be {Left, Right} in the DEFAULT branch,
        if any (there isn't one.)
      * combineIdentialAlts correctly combines the identical alts, to give
           case x of { DEFAULT -> e1 }
      * BUT combineIdenticalAlts did no adjust imposs_deft_cons
      * Result: when compiling e1 we did so in the belief that 'x'
        could not be {Left,Right}.  Disaster.
      Easily fixed.
      (It is hard to trigger; I can't construct a simple test case.)
  2. 16 Jun, 2015 24 commits
  3. 15 Jun, 2015 8 commits