1. 24 Feb, 2019 3 commits
    • Simon Peyton Jones's avatar
      Add AnonArgFlag to FunTy · 6cce36f8
      Simon Peyton Jones authored
      The big payload of this patch is:
      
        Add an AnonArgFlag to the FunTy constructor
        of Type, so that
          (FunTy VisArg   t1 t2) means (t1 -> t2)
          (FunTy InvisArg t1 t2) means (t1 => t2)
      
      The big payoff is that we have a simple, local test to make
      when decomposing a type, leading to many fewer calls to
      isPredTy. To me the code seems a lot tidier, and probably
      more efficient (isPredTy has to take the kind of the type).
      
      See Note [Function types] in TyCoRep.
      
      There are lots of consequences
      
      * I made FunTy into a record, so that it'll be easier
        when we add a linearity field, something that is coming
        down the road.
      
      * Lots of code gets touched in a routine way, simply because it
        pattern matches on FunTy.
      
      * I wanted to make a pattern synonym for (FunTy2 arg res), which
        picks out just the argument and result type from the record. But
        alas the pattern-match overlap checker has a heart attack, and
        either reports false positives, or takes too long.  In the end
        I gave up on pattern synonyms.
      
        There's some commented-out code in TyCoRep that shows what I
        wanted to do.
      
      * Much more clarity about predicate types, constraint types
        and (in particular) equality constraints in kinds.  See TyCoRep
        Note [Types for coercions, predicates, and evidence]
        and Note [Constraints in kinds].
      
        This made me realise that we need an AnonArgFlag on
        AnonTCB in a TyConBinder, something that was really plain
        wrong before. See TyCon Note [AnonTCB InivsArg]
      
      * When building function types we must know whether we
        need VisArg (mkVisFunTy) or InvisArg (mkInvisFunTy).
        This turned out to be pretty easy in practice.
      
      * Pretty-printing of types, esp in IfaceType, gets
        tidier, because we were already recording the (->)
        vs (=>) distinction in an ad-hoc way.  Death to
        IfaceFunTy.
      
      * mkLamType needs to keep track of whether it is building
        (t1 -> t2) or (t1 => t2).  See Type
        Note [mkLamType: dictionary arguments]
      
      Other minor stuff
      
      * Some tidy-up in validity checking involving constraints;
        Trac #16263
      6cce36f8
    • Simon Peyton Jones's avatar
      Remove bogus assertion · ac34e784
      Simon Peyton Jones authored
      Remove a bogus assertion in FamInst.newFamInst
      (There is a comment to explain.)
      
      This fixes Trac #16112.
      ac34e784
    • syd@cs-syd.eu's avatar
      hWaitForInput-accurate-socket test · 2e9426df
      syd@cs-syd.eu authored
      2e9426df
  2. 23 Feb, 2019 4 commits
  3. 22 Feb, 2019 9 commits
  4. 21 Feb, 2019 4 commits
  5. 20 Feb, 2019 9 commits
  6. 19 Feb, 2019 6 commits
  7. 18 Feb, 2019 4 commits
    • Alec Theriault's avatar
      Uphold AvailTC Invariant for associated data fams · 2a431640
      Alec Theriault authored
      The AvailTC was not be upheld for explicit export module
      export lists when the module contains associated data families.
      
          module A (module A) where
          class    C a  where { data T a }
          instance C () where { data T () = D }
      
      Used to (incorrectly) report avails as `[C{C, T;}, T{D;}]`. Note that
      although `T` is exported, the avail where it is the parent does _not_
      list it as its first element. This avail is now correctly listed as
      `[C{C, T;}, T{T, D;}]`.
      
      This was induces a [crash in Haddock][0].
      
      See #16077.
      
      [0]: https://github.com/haskell/haddock/issues/979
      2a431640
    • Vladislav Zavialov's avatar
      Fix warnings and fatal parsing errors · 1ffee940
      Vladislav Zavialov authored
      1ffee940
    • Simon Peyton Jones's avatar
      Get rid of tcm_smart from TyCoMapper · 1f1b9e35
      Simon Peyton Jones authored
      Following a succession of refactorings of the type checker,
      culminating in the patch
             Make a smart mkAppTyM
      we have got rid of mkNakedAppTy etc.  And that in turn
      meant that the tcm_smart field of the generic TyCoMapper
      (in Type.hs) was entirely unused.  It was always set to True.
      
      So this patch just gets rid of it completely.  Less code,
      less complexity, and more efficient because fewer higher-order
      function calls.  Everyone wins.
      
      No change in behaviour; this does not cure any bugs!
      1f1b9e35
    • Tamar Christina's avatar
      Testsuite: implement use_specs. · 0fff3ae6
      Tamar Christina authored
      0fff3ae6
  8. 17 Feb, 2019 1 commit
    • Alec Theriault's avatar
      Run some of Haddock's tests in the testsuite · 4a09d30b
      Alec Theriault authored
      The 4 main testsuites in Haddock don't have many dependencies, but are
      regularly broken in small ways by changes to the GHC AST or the GHC API.
      The main gotcha is that we'll have to make sure that `haddock-test` and
      the test suite don't add modules without modifying this test. Then again,
      if that happens, the test will fail and someone will noticed.
      4a09d30b