on master help sign in
0.6.0.0 -> 0.5.1.0

There's no breaking change in this release

commit61d338fbd4725c4ff87d5d57124226977c2a2923 authorCsongor Kiss <kiss.csongor.kiss@gmail.com> dateFri 29 Dec 2017, 12:34 (9 years ago) parent202fcc7
6 files changed+16−25
ChangeLog.md+1−4 generic-lens.cabal+2−2 src/Data/Generics/Internal/Families/Changing.hs+3−7 src/Data/Generics/Product/Fields.hs+3−4 src/Data/Generics/Product/Positions.hs+4−4 src/Data/Generics/Sum/Constructors.hs+3−4
ChangeLog.md+1−4
@@ -1,10 +1,7 @@
1−## 0.6.0.0
1+## 0.5.1.0
22- Infer input type from result type (#25)
33- Allow changing of multiple type parameters (#24)
44- Allow changing of type parameters that have kinds other than `*` (#23)
5−
6−## 0.5.1.0
7−- Add `IsLabel` orphan instance in `Data.Generics.Labels`
85- Fix error message in subtype lens
96
107## 0.5.0.0
generic-lens.cabal+2−2
@@ -1,5 +1,5 @@
11name: generic-lens
2−version: 0.6.0.0
2+version: 0.5.1.0
33synopsis: Generic data-structure operations exposed as lenses.
44description: This package uses the GHC 8 Generic representation to derive various operations on data structures with a lens interface, including structural subtype relationship between records and positional indexing into arbitrary product types.
55
@@ -25,7 +25,7 @@ library
2525 , Data.Generics.Product.Positions
2626 , Data.Generics.Product.Subtype
2727 , Data.Generics.Product.Typed
28− , Data.Generics.Labels
28+ --, Data.Generics.Labels
2929
3030 , Data.Generics.Sum
3131 , Data.Generics.Sum.Any
src/Data/Generics/Internal/Families/Changing.hs+3−7
@@ -11,7 +11,6 @@
1111module Data.Generics.Internal.Families.Changing
1212 ( Proxied
1313 , Infer
14− , HasParams
1514 ) where
1615
1716import GHC.TypeLits (TypeError, ErrorMessage (..))
@@ -92,13 +91,10 @@ type family (xs :: [k]) ++ (ys :: [k]) :: [k] where
9291 '[] ++ ys = ys
9392 (x ': xs) ++ ys = x ': (xs ++ ys)
9493
95−type family HasParams (a :: *) :: Bool where
96− HasParams (a b) = 'True
97− HasParams _ = 'False
98−
9994type family Infer (s :: *) (a' :: *) (b :: *) :: * where
100− Infer s a' b
101− = ReplaceArgs s (Unify a' b)
95+ Infer (s a) a' b
96+ = ReplaceArgs (s a) (Unify a' b)
97+ Infer s _ _ = s
10298
10399--------------------------------------------------------------------------------
104100
src/Data/Generics/Product/Fields.hs+3−4
@@ -44,7 +44,6 @@ import Data.Generics.Product.Internal.Fields
4444import Data.Kind (Constraint, Type)
4545import GHC.Generics
4646import GHC.TypeLits (Symbol, ErrorMessage(..), TypeError)
47−import Data.Type.Bool (If)
4847
4948-- $setup
5049-- == /Running example:/
@@ -134,10 +133,10 @@ instance -- see Note [Changing type parameters]
134133 , Generic t'
135134 , GHasField' field (Rep s) a
136135 , GHasField' field (Rep s') a'
137− , GHasField' field (Rep t') b'
138136 , GHasField field (Rep s) (Rep t) a b
139− , t ~ If (HasParams s) (Infer s a' b) s
140− , s ~ If (HasParams t) (Infer t b' a) t
137+ , t ~ Infer s a' b
138+ , GHasField' field (Rep t') b'
139+ , s ~ Infer t b' a
141140 ) => HasField field s t a b where
142141
143142 field f s = ravel (repLens . gfield @field) f s
src/Data/Generics/Product/Positions.hs+4−4
@@ -43,7 +43,7 @@ import Data.Generics.Internal.Families
4343import Data.Generics.Product.Internal.Positions
4444
4545import Data.Kind (Constraint, Type)
46−import Data.Type.Bool (type (&&), If)
46+import Data.Type.Bool (type (&&))
4747import GHC.Generics
4848import GHC.TypeLits (type (<=?), Nat, TypeError, ErrorMessage(..))
4949
@@ -105,10 +105,10 @@ instance -- see Note [Changing type parameters]
105105 , Generic t'
106106 , GHasPosition' i (Rep s) a
107107 , GHasPosition' i (Rep s') a'
108− , GHasPosition' i (Rep t') b'
109108 , GHasPosition 1 i (Rep s) (Rep t) a b
110− , t ~ If (HasParams s) (Infer s a' b) s
111− , s ~ If (HasParams t) (Infer t b' a) t
109+ , t ~ Infer s a' b
110+ , GHasPosition' i (Rep t') b'
111+ , s ~ Infer t b' a
112112 ) => HasPosition i s t a b where
113113
114114 position f s = ravel (repLens . gposition @1 @i) f s
src/Data/Generics/Sum/Constructors.hs+3−4
@@ -38,7 +38,6 @@ import Data.Generics.Sum.Internal.Constructors
3838import Data.Kind (Constraint, Type)
3939import GHC.Generics (Generic (Rep))
4040import GHC.TypeLits (Symbol, TypeError, ErrorMessage (..))
41−import Data.Type.Bool (If)
4241
4342-- $setup
4443-- == /Running example:/
@@ -109,10 +108,10 @@ instance
109108 , Generic t'
110109 , GAsConstructor' ctor (Rep s) a
111110 , GAsConstructor' ctor (Rep s') a'
112− , GAsConstructor' ctor (Rep t') b'
113111 , GAsConstructor ctor (Rep s) (Rep t) a b
114− , t ~ If (HasParams s) (Infer s a' b) s
115− , s ~ If (HasParams t) (Infer t b' a) t
112+ , t ~ Infer s a' b
113+ , GAsConstructor' ctor (Rep t') b'
114+ , s ~ Infer t b' a
116115 ) => AsConstructor ctor s t a b where
117116
118117 _Ctor = repIso . _GCtor @ctor