Skip to content
Snippets Groups Projects
  1. Aug 17, 2017
    • Chris Martin's avatar
      Remove extra ` from "kind-indexed GADTs" doc · af9f3fab
      Chris Martin authored and Ben Gamari's avatar Ben Gamari committed
      af9f3fab
    • Ryan Scott's avatar
      Fix #11785 by making reifyKind = reifyType · c948b786
      Ryan Scott authored
      Summary:
      This ties up the last loose end in Template Haskell's separate
      code paths for types and kinds. By making `reifyKind = reifyType` in
      `TcSplice`, types and kinds are now treated on equal terms in TH.
      
      This is itself a small patch, but most of the heavy lifting to make this
      possible was done in ad7b9452.
      
      Test Plan: ./validate
      
      Reviewers: goldfire, austin, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #11785
      
      Differential Revision: https://phabricator.haskell.org/D3854
      c948b786
    • Ryan Scott's avatar
      Suggest how to fix illegally nested foralls in GADT constructor type signatures · 039fa1b9
      Ryan Scott authored
      Summary:
      Although the code from #12087 isn't accepted by GHC, we can at least
      do a better job of letting users know what the problem is, and how to fix it.
      
      Test Plan: make test TEST=T12087
      
      Reviewers: goldfire, austin, bgamari
      
      Reviewed By: goldfire
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #12087
      
      Differential Revision: https://phabricator.haskell.org/D3851
      039fa1b9
    • Ryan Scott's avatar
      Fix #13972 by producing tidier errors · 38260a9e
      Ryan Scott authored
      Summary:
      Previously, one could experience an error message like this:
      
      ```
      Expected: T (a -> Either a b)
        Actual: T (a -> Either a b)
      ```
      
      This makes the error message an iota clearer by tidying it first, which will
      instead produce:
      
      ```
      Expected: T (a1 -> Either a1 b1)
        Actual: T (a -> Either a b)
      ```
      
      Which steers users towards the understanding that the two sets of tyvars are
      actually different.
      
      Test Plan: make test TEST=T13972
      
      Reviewers: simonpj, austin, bgamari, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: goldfire, rwbarton, thomie
      
      GHC Trac Issues: #13972
      
      Differential Revision: https://phabricator.haskell.org/D3820
      38260a9e
  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
  7. Aug 05, 2017
    • Ryan Scott's avatar
      Don't warn when empty casing on Type · a267580e
      Ryan Scott authored
      Summary:
      `Type` (a.k.a. `TYPE LiftedRep`) can be used at the type level thanks
      to `TypeInType`. However, expressions like
      
      ```lang=haskell
      f :: Type -> Int
      f x = case x of {}
      ```
      
      were falsely claiming that the empty case on the value of type `Type` was
      non-exhaustive. The reason is a bit silly: `TYPE` is technically not an empty
      datatype in GHC's eyes, since it's a builtin, primitive type. To convince the
      pattern coverage checker otherwise, this adds a special case for `TYPE`.
      
      Test Plan: make test TEST=T14086
      
      Reviewers: gkaracha, austin, bgamari, goldfire
      
      Reviewed By: goldfire
      
      Subscribers: goldfire, rwbarton, thomie
      
      GHC Trac Issues: #14086
      
      Differential Revision: https://phabricator.haskell.org/D3819
      a267580e
    • Ryan Scott's avatar
      Remove the deprecated Typeable{1..7} type synonyms · a81b5b00
      Ryan Scott authored
      Summary:
      `Typeable{1..7}` (type synonyms for the poly-kinded `Typeable`) have
      been deprecated since GHC 7.8. They're now causing problems for users who try
      to still work with them in legacy code, since they can no longer be used in
      instances. To avoid this sort of confusion, let's just remove `Typeable{1..7}`
      altogether. Resolves #14047.
      
      Reviewers: bgamari, austin, hvr
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #14047
      
      Differential Revision: https://phabricator.haskell.org/D3817
      a81b5b00
    • Oleg Grenrus's avatar
      Add MonadIO Q - by requiring MonadIO => Quasi · 394c391a
      Oleg Grenrus authored and Ryan Scott's avatar Ryan Scott committed
      Summary: This is follow-up to https://ghc.haskell.org/trac/ghc/ticket/10773
      
      Reviewers: austin, goldfire, bgamari, RyanGlScott
      
      Reviewed By: RyanGlScott
      
      Subscribers: RyanGlScott, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3816
      394c391a
  8. Aug 02, 2017
  9. Aug 01, 2017
Loading