-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Close over kind variables when computing fixed type variables
Previously, `buildStab` would not consider kind variables when determining which type variables need to be fixed in a generated `Lens`'s type signature. This was not a problem in older versions of `lens`, which aggressively dropped kind variables, but now that `lens` attempts to include kind variables in generated type signatures, this problem has risen to the surface, resulting in the problems observed in #972. The solution is to take the set of fixed type variables in `buildStab` and close over kind variables. For more information, refer to the comments I have left near `closeOverKinds`. Fixes #972.
- Loading branch information
1 parent
1d854bf
commit e892893
Showing
6 changed files
with
78 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{-# LANGUAGE CPP #-} | ||
{-# LANGUAGE PolyKinds #-} | ||
{-# LANGUAGE TemplateHaskell #-} | ||
|
||
#if __GLASGOW_HASKELL__ >= 800 && __GLASGOW_HASKELL__ < 806 | ||
{-# LANGUAGE TypeInType #-} | ||
#endif | ||
module T972 where | ||
|
||
import Control.Lens | ||
#if __GLASGOW_HASKELL__ >= 800 | ||
import Data.Proxy | ||
#endif | ||
|
||
newtype Arc s = Arc { _unArc :: Int } | ||
|
||
data Direction = Negative | Positive | ||
data Dart s = Dart { _arc :: Arc s, _direction :: Direction } | ||
$(makeLenses ''Dart) | ||
|
||
#if __GLASGOW_HASKELL__ >= 800 | ||
data Fancy k (a :: k) = MkFancy { _unFancy1 :: k, _unFancy2 :: Proxy a } | ||
$(makeLenses ''Fancy) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters