on master help sign in
Optimise typed lens
commit8b4b619ae1e16614626170d03d074af9436be28e authorCsongor Kiss <kiss.csongor.kiss@gmail.com> dateWed 6 Sep 2017, 13:54 (9 years ago) parent3fddfc5
2 files changed+4−1
src/Data/Generics/Product/Typed.hs+1−1 test/Spec.hs+3
src/Data/Generics/Product/Typed.hs+1−1
@@ -83,7 +83,7 @@ instance
8383 , GHasType (Rep s) a
8484 ) => HasType a s where
8585
86− typed = repIso . gtyped
86+ typed = ravel (repIso . gtyped)
8787
8888type family ErrorUnlessOne (a :: Type) (s :: Type) (count :: Count) :: Constraint where
8989 ErrorUnlessOne a s 'None
test/Spec.hs+3
@@ -50,6 +50,9 @@ subtypeLensManual f record
5050fieldP :: Proof
5151fieldP = L fieldALensManual === L (field @"fieldA")
5252
53+typedP :: Proof
54+typedP = L fieldALensManual === L (typed @Int)
55+
5356posP :: Proof
5457posP = L fieldALensManual === L (position @1)
5558