packages feed

lens 3.0.2 → 3.0.3

raw patch · 3 files changed

+9/−2 lines, 3 files

Files

CHANGELOG.markdown view
@@ -1,3 +1,8 @@+3.0.3+-----+* Refined the behavior of `substType` in `Control.Lens.TH` to match the behavior of `typeVarsEx` when moving under binders.++ 3.0.2 ----- * Added `generateSignatures` option to `Control.Lens.TH` to allow the end user to disable the generation of type signatures for the
lens.cabal view
@@ -1,6 +1,6 @@ name:          lens category:      Data, Lenses-version:       3.0.2+version:       3.0.3 license:       BSD3 cabal-version: >= 1.8 license-file:  LICENSE
src/Language/Haskell/TH/Lens.hs view
@@ -28,6 +28,7 @@ import Control.Applicative import Control.Lens.Getter import Control.Lens.Setter+import Control.Lens.Fold import Control.Lens.Type import Control.Lens.Traversal import Control.Lens.IndexedLens@@ -104,7 +105,8 @@  instance SubstType Type where   substType m t@(VarT n)          = fromMaybe t (m^.at n)-  substType m (ForallT bs ctx ty) = ForallT bs (substType m ctx) (substType m ty)+  substType m (ForallT bs ctx ty) = ForallT bs (substType m' ctx) (substType m' ty)+    where m' = foldrOf typeVars Map.delete m bs   substType m (SigT t k)          = SigT (substType m t) k   substType m (AppT l r)          = AppT (substType m l) (substType m r)   substType _ t                   = t