packages feed

microlens-th 0.4.0.0 → 0.4.0.1

raw patch · 3 files changed

+10/−6 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.4.0.1++* Ported a lens commit that (probably) makes lens generation deterministic. See [this issue](https://github.com/aelve/microlens/issues/83).+ # 0.4.0.0  * Added `makeClassy` (and `createClass`).
microlens-th.cabal view
@@ -1,5 +1,5 @@ name:                microlens-th-version:             0.4.0.0+version:             0.4.0.1 synopsis:            Automatic generation of record lenses for microlens description:   This package lets you automatically generate lenses for data types; code was extracted from the lens package, and therefore generated lenses are fully compatible with ones generated by lens (and can be used both from lens and microlens).
src/Lens/Micro/TH.hs view
@@ -61,7 +61,6 @@ import           Data.Char import           Data.Data import           Data.Either-import           Data.Foldable (toList) import qualified Data.Map as Map import           Data.Map (Map) import           Data.Monoid@@ -1295,16 +1294,17 @@ -- Template Haskell wants type variables declared in a forall, so -- we find all free type variables in a given type and declare them. quantifyType :: Cxt -> Type -> Type-quantifyType c t = ForallT vs c t-  where-  vs = map PlainTV (toList (setOf typeVars t))+quantifyType = quantifyType' Set.empty  -- This function works like 'quantifyType' except that it takes -- a list of variables to exclude from quantification. quantifyType' :: Set Name -> Cxt -> Type -> Type quantifyType' exclude c t = ForallT vs c t   where-  vs = map PlainTV (toList (setOf typeVars t Set.\\ exclude))+    vs = map PlainTV+       $ filter (`Set.notMember` exclude)+       $ nub -- stable order+       $ toListOf typeVars t   ------------------------------------------------------------------------