microlens-th 0.2.1.1 → 0.2.1.2
raw patch · 3 files changed
+9/−7 lines, 3 filesdep ~microlensPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: microlens
API changes (from Hackage documentation)
- Lens.Micro.TH: [MethodName] :: Name -> Name -> DefName
- Lens.Micro.TH: [TopName] :: Name -> DefName
+ Lens.Micro.TH: MethodName :: Name -> Name -> DefName
+ Lens.Micro.TH: TopName :: Name -> DefName
+ Lens.Micro.TH: instance HasTypeVars Pred
Files
- CHANGELOG.md +4/−0
- microlens-th.cabal +2/−2
- src/Lens/Micro/TH.hs +3/−5
CHANGELOG.md view
@@ -1,3 +1,7 @@+# 0.2.1.2++* Bumped microlens version to be able to use phantom.+ # 0.2.1.1 * Bumped microlens version again.
microlens-th.cabal view
@@ -1,5 +1,5 @@ name: microlens-th-version: 0.2.1.1+version: 0.2.1.2 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).@@ -31,7 +31,7 @@ -- other-modules: -- other-extensions: build-depends: base >=4.5 && <5- , microlens >=0.1 && <0.4+ , microlens >=0.3.2 && <0.4 , containers >=0.4.0 && <0.6 -- lens has >=2.4, but GHC 7.4 shipped with 2.7 , template-haskell >=2.7 && <2.11
src/Lens/Micro/TH.hs view
@@ -64,6 +64,7 @@ import Data.List (nub, findIndices, stripPrefix, isPrefixOf) import Data.Maybe import Lens.Micro+import Lens.Micro.Internal (phantom) import Language.Haskell.TH #if __GLASGOW_HASKELL__ < 710@@ -117,7 +118,7 @@ This will generate lenses for @Foo@ and you'll be able to use them from GHCi. -If you want, you can define the type and lenses for it simultaneously with @:{@ an @:}@:+If you want, you can define the type and lenses for it simultaneously with @:{@ and @:}@: @ >>> :{@@ -154,9 +155,6 @@ _ForallT f (ForallT a b c) = (\(x, y, z) -> ForallT x y z) <$> f (a, b, c) _ForallT _ other = pure other -coerce :: Const r a -> Const r b-coerce = Const . getConst- -- Utilities -- Modify element at some index in a list.@@ -943,7 +941,7 @@ fxs = [ appE (varE f) (varE x) | x <- xs ] body = foldl (\a b -> appsE [varE '(<*>), a, b])- (appE (varE 'coerce) (head fxs))+ (appE (varE 'phantom) (head fxs)) (tail fxs) -- clause f (Con x1..xn) = coerce (f x1) <*> ... <*> f xn