Skip to content
Snippets Groups Projects
  1. Aug 17, 2017
  2. Aug 16, 2017
  3. Aug 15, 2017
  4. Aug 12, 2017
    • Ryan Scott's avatar
      Add test for #14101 · c6462ab0
      Ryan Scott authored
      I forgot to do this in
      0bb1e840.
      c6462ab0
    • Ryan Scott's avatar
      Expand type synonyms during role inference · 0bb1e840
      Ryan Scott authored
      Summary:
      During role inference, we need to expand type synonyms, since
      oversaturated applications of type synonym tycons would otherwise have overly
      conservative roles inferred for its arguments.
      
      Fixes #14101.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, austin, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14101
      
      Differential Revision: https://phabricator.haskell.org/D3838
      0bb1e840
    • Ryan Scott's avatar
      Change isClosedAlgType to be TYPE-aware, and rename it to pmIsClosedType · 4f1f9868
      Ryan Scott authored
      Summary:
      In a267580e, I somewhat awkwardly
      inserted a special case for `TYPE` in the `EmptyCase` coverage checker.
      Instead of placing it there, @mpickering noted that `isClosedAlgType` would
      be a better fit for it. I do just that in this patch.
      
      I also renamed `isClosedAlgType` to `pmIsClosedType`, reflecting the fact that
      `TYPE` technically isn't an algebraic type (it's a primitive one), and that its
      behavior is pattern-match coverage checking-oriented. I also moved it to
      `Check`, which is a better home for this function than `Type`. Luckily,
      the only call sites for `isClosedAlgType` were in the pattern-match coverage
      checker anyways, so this change is simple enough.
      
      Test Plan: ./validate
      
      Reviewers: mpickering, austin, goldfire, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: rwbarton, thomie, mpickering
      
      GHC Trac Issues: #14086
      
      Differential Revision: https://phabricator.haskell.org/D3830
      4f1f9868
    • Ryan Scott's avatar
      Use NonEmpty lists to represent lists of duplicate elements · 7d699782
      Ryan Scott authored
      Summary:
      Three functions in `ListSetOps` which compute duplicate elements
      represent lists of duplicates of `[a]`. This is a really bad way to go about
      things, because these lists are guaranteed to always have at least one element
      (the "representative" of the duplicates), and several places in the GHC API
      call `head` (a partial function) on these lists of duplicates to retrieve the
      representative.
      
      This changes the representation of duplicates to `NonEmpty` lists instead,
      which allow for many partial uses of `head` to be made total.
      
      Fixes #13823.
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin, goldfire
      
      Reviewed By: bgamari
      
      Subscribers: goldfire, rwbarton, thomie
      
      GHC Trac Issues: #13823
      
      Differential Revision: https://phabricator.haskell.org/D3823
      7d699782
    • Ryan Scott's avatar
      Don't suppress unimplemented type family warnings with DeriveAnyClass · 3f05e5f6
      Ryan Scott authored
      Summary:
      For some asinine reason, we were suppressing warnings when
      deriving associated type family instances with `DeriveAnyClass`. That seems
      like a bad idea. Let's not do that.
      
      Along the way, I noticed that the error contexts associated with these
      newly emitted warnings were less than ideal, so I did some minor refactoring
      to improve the story there.
      
      Fixes #14094
      
      Test Plan: ./validate
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14094
      
      Differential Revision: https://phabricator.haskell.org/D3828
      3f05e5f6
    • Ryan Scott's avatar
      Split out inferConstraintsDataConArgs from inferConstraints · a4f347c2
      Ryan Scott authored
      Summary:
      Addresses point (1) of https://phabricator.haskell.org/D3337#107865.
      
      Before, `inferConstraints` awkwardly combined all of the logic needed to handle
      stock, newtype, and anyclass deriving. Really, though, the stock/newtype logic
      is quite different from the anyclass logic, so this splits off
      `inferConstraintsDataConArgs` (so named because it infers constraints by
      inspecting the types of the arguments to data constructors) from
      `inferConstraints` to handle the stock/newtype-specific bits.
      
      Aside from making the code somewhat clearer, this allows us to factor out
      superclass constraint inference, which is done regardless of deriving strategy.
      
      Test Plan: If it builds, ship it
      
      Reviewers: bgamari, austin
      
      Subscribers: rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3827
      a4f347c2
  5. Aug 07, 2017
  6. Aug 06, 2017
Loading