on master help sign in
0.6.0.0 -> 0.5.1.0
61d338fCsongor Kiss
ChangeLog.md+1−4
@@ -1,10 +1,7 @@
1−## 0.6.0.0
1+## 0.5.1.0
2- Infer input type from result type (#25)
2- Infer input type from result type (#25)
3- Allow changing of multiple type parameters (#24)
3- Allow changing of multiple type parameters (#24)
4- Allow changing of type parameters that have kinds other than `*` (#23)
4- 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`
8- Fix error message in subtype lens
5- Fix error message in subtype lens
9
6
10## 0.5.0.0
7## 0.5.0.0
generic-lens.cabal+2−2
@@ -1,5 +1,5 @@
1name: generic-lens
1name: generic-lens
2−version: 0.6.0.0
2+version: 0.5.1.0
3synopsis: Generic data-structure operations exposed as lenses.
3synopsis: Generic data-structure operations exposed as lenses.
4description: 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.
4description: 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.
5
5
@@ -25,7 +25,7 @@ library
25 , Data.Generics.Product.Positions
25 , Data.Generics.Product.Positions
26 , Data.Generics.Product.Subtype
26 , Data.Generics.Product.Subtype
27 , Data.Generics.Product.Typed
27 , Data.Generics.Product.Typed
28− , Data.Generics.Labels
28+ --, Data.Generics.Labels
29
29
30 , Data.Generics.Sum
30 , Data.Generics.Sum
31 , Data.Generics.Sum.Any
31 , Data.Generics.Sum.Any
src/Data/Generics/Internal/Families/Changing.hs+3−7
@@ -11,7 +11,6 @@
11module Data.Generics.Internal.Families.Changing
11module Data.Generics.Internal.Families.Changing
12 ( Proxied
12 ( Proxied
13 , Infer
13 , Infer
14− , HasParams
15 ) where
14 ) where
16
15
17import GHC.TypeLits (TypeError, ErrorMessage (..))
16import GHC.TypeLits (TypeError, ErrorMessage (..))
@@ -92,13 +91,10 @@ type family (xs :: [k]) ++ (ys :: [k]) :: [k] where
92 '[] ++ ys = ys
91 '[] ++ ys = ys
93 (x ': xs) ++ ys = x ': (xs ++ ys)
92 (x ': xs) ++ ys = x ': (xs ++ ys)
94
93
95−type family HasParams (a :: *) :: Bool where
96− HasParams (a b) = 'True
97− HasParams _ = 'False
98−
99type family Infer (s :: *) (a' :: *) (b :: *) :: * where
94type family Infer (s :: *) (a' :: *) (b :: *) :: * where
100− Infer s a' b
95+ Infer (s a) a' b
101− = ReplaceArgs s (Unify a' b)
96+ = ReplaceArgs (s a) (Unify a' b)
97+ Infer s _ _ = s
102
98
103--------------------------------------------------------------------------------
99--------------------------------------------------------------------------------
104
100
src/Data/Generics/Product/Fields.hs+3−4
@@ -44,7 +44,6 @@ import Data.Generics.Product.Internal.Fields
44import Data.Kind (Constraint, Type)
44import Data.Kind (Constraint, Type)
45import GHC.Generics
45import GHC.Generics
46import GHC.TypeLits (Symbol, ErrorMessage(..), TypeError)
46import GHC.TypeLits (Symbol, ErrorMessage(..), TypeError)
47−import Data.Type.Bool (If)
48
47
49-- $setup
48-- $setup
50-- == /Running example:/
49-- == /Running example:/
@@ -134,10 +133,10 @@ instance -- see Note [Changing type parameters]
134 , Generic t'
133 , Generic t'
135 , GHasField' field (Rep s) a
134 , GHasField' field (Rep s) a
136 , GHasField' field (Rep s') a'
135 , GHasField' field (Rep s') a'
137− , GHasField' field (Rep t') b'
138 , GHasField field (Rep s) (Rep t) a b
136 , GHasField field (Rep s) (Rep t) a b
139− , t ~ If (HasParams s) (Infer s a' b) s
137+ , t ~ Infer s a' b
138+ , GHasField' field (Rep t') b'
140− , s ~ If (HasParams t) (Infer t b' a) t
139+ , s ~ Infer t b' a
141 ) => HasField field s t a b where
140 ) => HasField field s t a b where
142
141
143 field f s = ravel (repLens . gfield @field) f s
142 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
43import Data.Generics.Product.Internal.Positions
43import Data.Generics.Product.Internal.Positions
44
44
45import Data.Kind (Constraint, Type)
45import Data.Kind (Constraint, Type)
46−import Data.Type.Bool (type (&&), If)
46+import Data.Type.Bool (type (&&))
47import GHC.Generics
47import GHC.Generics
48import GHC.TypeLits (type (<=?), Nat, TypeError, ErrorMessage(..))
48import GHC.TypeLits (type (<=?), Nat, TypeError, ErrorMessage(..))
49
49
@@ -105,10 +105,10 @@ instance -- see Note [Changing type parameters]
105 , Generic t'
105 , Generic t'
106 , GHasPosition' i (Rep s) a
106 , GHasPosition' i (Rep s) a
107 , GHasPosition' i (Rep s') a'
107 , GHasPosition' i (Rep s') a'
108− , GHasPosition' i (Rep t') b'
109 , GHasPosition 1 i (Rep s) (Rep t) a b
108 , GHasPosition 1 i (Rep s) (Rep t) a b
110− , t ~ If (HasParams s) (Infer s a' b) s
109+ , t ~ Infer s a' b
110+ , GHasPosition' i (Rep t') b'
111− , s ~ If (HasParams t) (Infer t b' a) t
111+ , s ~ Infer t b' a
112 ) => HasPosition i s t a b where
112 ) => HasPosition i s t a b where
113
113
114 position f s = ravel (repLens . gposition @1 @i) f s
114 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
38import Data.Kind (Constraint, Type)
38import Data.Kind (Constraint, Type)
39import GHC.Generics (Generic (Rep))
39import GHC.Generics (Generic (Rep))
40import GHC.TypeLits (Symbol, TypeError, ErrorMessage (..))
40import GHC.TypeLits (Symbol, TypeError, ErrorMessage (..))
41−import Data.Type.Bool (If)
42
41
43-- $setup
42-- $setup
44-- == /Running example:/
43-- == /Running example:/
@@ -109,10 +108,10 @@ instance
109 , Generic t'
108 , Generic t'
110 , GAsConstructor' ctor (Rep s) a
109 , GAsConstructor' ctor (Rep s) a
111 , GAsConstructor' ctor (Rep s') a'
110 , GAsConstructor' ctor (Rep s') a'
112− , GAsConstructor' ctor (Rep t') b'
113 , GAsConstructor ctor (Rep s) (Rep t) a b
111 , GAsConstructor ctor (Rep s) (Rep t) a b
114− , t ~ If (HasParams s) (Infer s a' b) s
112+ , t ~ Infer s a' b
113+ , GAsConstructor' ctor (Rep t') b'
115− , s ~ If (HasParams t) (Infer t b' a) t
114+ , s ~ Infer t b' a
116 ) => AsConstructor ctor s t a b where
115 ) => AsConstructor ctor s t a b where
117
116
118 _Ctor = repIso . _GCtor @ctor
117 _Ctor = repIso . _GCtor @ctor