generic-lens 1.0.0.0 → 1.0.0.1
raw patch · 8 files changed
+32/−15 lines, 8 filesdep ~criterionPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: criterion
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- generic-lens.cabal +5/−6
- src/Data/Generics/Sum/Constructors.hs +2/−2
- src/Data/Generics/Sum/Internal/Constructors.hs +5/−5
- src/Data/Generics/Sum/Internal/Subtype.hs +8/−1
- src/Data/Generics/Sum/Internal/Typed.hs +5/−0
- src/Data/Generics/Sum/Subtype.hs +1/−0
- src/Data/Generics/Sum/Typed.hs +2/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 1.0.0.1+- Remove dump-core dependency+- Relax upper bound on criterion (#42)+ ## 1.0.0.0 - Traversals (types, param, constraints) - Prisms are now optimal too
generic-lens.cabal view
@@ -1,5 +1,5 @@ name: generic-lens-version: 1.0.0.0+version: 1.0.0.1 synopsis: Generically derive traversals, lenses and prisms. description: This library uses GHC.Generics to derive efficient optics (traversals, lenses and prisms) for algebraic data types in a type-directed way, with a focus on good type inference and error messages when possible. @@ -72,9 +72,9 @@ hs-source-dirs: src default-language: Haskell2010 ghc-options: -Wall- if flag(dump-core)- build-depends: dump-core- ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html+-- if flag(dump-core)+-- build-depends: dump-core+-- ghc-options: -fplugin=DumpCore -fplugin-opt DumpCore:core-html source-repository head type: git@@ -84,7 +84,6 @@ type: exitcode-stdio-1.0 hs-source-dirs: examples main-is: Biscuits.hs- --other-modules: build-depends: base >= 4.9 && <= 5.0 , generic-lens@@ -171,7 +170,7 @@ , base >= 4.9 && <= 5.0 , QuickCheck- , criterion < 1.3.0.0 && >= 1.2.0.0+ , criterion >= 1.3.0.0 , deepseq , lens
src/Data/Generics/Sum/Constructors.hs view
@@ -112,7 +112,7 @@ , GAsConstructor' ctor (Rep s) a ) => AsConstructor' ctor s a where _Ctor' eta = prismRavel (prismPRavel (repIso . _GCtor @ctor)) eta- {-# INLINE _Ctor' #-}+ {-# INLINE[2] _Ctor' #-} instance ( Generic s@@ -136,7 +136,7 @@ ) => AsConstructor ctor s t a b where _Ctor eta = prismRavel (prismPRavel (repIso . _GCtor @ctor)) eta- {-# INLINE _Ctor #-}+ {-# INLINE[2] _Ctor #-} -- See Note [Uncluttering type signatures] instance {-# OVERLAPPING #-} AsConstructor ctor (Void1 a) (Void1 b) a b where
src/Data/Generics/Sum/Internal/Constructors.hs view
@@ -54,24 +54,24 @@ ) => GAsConstructor ctor (M1 C ('MetaCons ctor fixity fields) f) (M1 C ('MetaCons ctor fixity fields) g) a b where _GCtor = prism (M1 . view (fromIso (glist @Type)) . tupleToList) (Right . listToTuple . view (glist @Type) . unM1)- {-# INLINE _GCtor #-}+ {-# INLINE[0] _GCtor #-} instance GSumAsConstructor ctor (HasCtorP ctor l) l r l' r' a b => GAsConstructor ctor (l :+: r) (l' :+: r') a b where _GCtor = _GSumCtor @ctor @(HasCtorP ctor l)- {-# INLINE _GCtor #-}+ {-# INLINE[0] _GCtor #-} instance GAsConstructor ctor f f' a b => GAsConstructor ctor (M1 D meta f) (M1 D meta f') a b where _GCtor = mIso . _GCtor @ctor- {-# INLINE _GCtor #-}+ {-# INLINE[0] _GCtor #-} class GSumAsConstructor (ctor :: Symbol) (contains :: Bool) l r l' r' a b | ctor l r -> a, ctor l' r' -> b where _GSumCtor :: Prism ((l :+: r) x) ((l' :+: r') x) a b instance GAsConstructor ctor l l' a b => GSumAsConstructor ctor 'True l r l' r a b where _GSumCtor = left . _GCtor @ctor- {-# INLINE _GSumCtor #-}+ {-# INLINE[0] _GSumCtor #-} instance GAsConstructor ctor r r' a b => GSumAsConstructor ctor 'False l r l r' a b where _GSumCtor = right . _GCtor @ctor- {-# INLINE _GSumCtor #-}+ {-# INLINE[0] _GSumCtor #-}
src/Data/Generics/Sum/Internal/Subtype.hs view
@@ -57,15 +57,18 @@ instance (GSplash a sup, GSplash b sup) => GSplash (a :+: b) sup where _GSplash (L1 rep) = _GSplash rep _GSplash (R1 rep) = _GSplash rep+ {-# INLINE[0] _GSplash #-} instance ( GIsList () subf subf as as , GAsType supf as ) => GSplash (C1 meta subf) supf where _GSplash p = build ((_GTyped . fromIso (glist @()) . fromIso mIso)) p+ {-# INLINE[0] _GSplash #-} instance GSplash sub sup => GSplash (D1 c sub) sup where _GSplash (M1 m) = _GSplash m+ {-# INLINE[0] _GSplash #-} -------------------------------------------------------------------------------- @@ -79,6 +82,7 @@ _GDowncast (M1 m) = case _GDowncastC @(HasPartialTypeP as sub) m of Left _ -> Left (M1 m) Right r -> Right r+ {-# INLINE[0] _GDowncast #-} instance (GDowncast sub l, GDowncast sub r) => GDowncast sub (l :+: r) where _GDowncast (L1 x) = case _GDowncast x of@@ -87,22 +91,25 @@ _GDowncast (R1 x) = case _GDowncast x of Left _ -> Left (R1 x) Right r -> Right r+ {-# INLINE[0] _GDowncast #-} instance GDowncast sub sup => GDowncast sub (D1 m sup) where _GDowncast (M1 m) = case _GDowncast m of Left _ -> Left (M1 m) Right r -> Right r+ {-# INLINE[0] _GDowncast #-} class GDowncastC (contains :: Bool) sub sup where _GDowncastC :: sup x -> Either (sup x) (sub x) instance GDowncastC 'False sub sup where _GDowncastC sup = Left sup+ {-# INLINE[0] _GDowncastC #-} instance ( GAsType sub subl , GIsList () sup sup subl subl ) => GDowncastC 'True sub sup where _GDowncastC sup = Right (build (_GTyped . fromIso (glist @())) sup)- {-# INLINE _GDowncastC #-}+ {-# INLINE[0] _GDowncastC #-}
src/Data/Generics/Sum/Internal/Typed.hs view
@@ -50,18 +50,23 @@ ( GIsList () f f as as ) => GAsType (M1 C meta f) as where _GTyped = mIso . glist @()+ {-# INLINE[0] _GTyped #-} instance GSumAsType (HasPartialTypeP a l) l r a => GAsType (l :+: r) a where _GTyped = _GSumTyped @(HasPartialTypeP a l)+ {-# INLINE[0] _GTyped #-} instance GAsType f a => GAsType (M1 D meta f) a where _GTyped = mIso . _GTyped+ {-# INLINE[0] _GTyped #-} class GSumAsType (contains :: Bool) l r (a :: [((), Type)]) where _GSumTyped :: Prism ((l :+: r) x) ((l :+: r) x) (List a) (List a) instance GAsType l a => GSumAsType 'True l r a where _GSumTyped = left . _GTyped+ {-# INLINE[0] _GSumTyped #-} instance GAsType r a => GSumAsType 'False l r a where _GSumTyped = right . _GTyped+ {-# INLINE[0] _GSumTyped #-}
src/Data/Generics/Sum/Subtype.hs view
@@ -90,6 +90,7 @@ -- Nothing _Sub :: Prism' sup sub _Sub = prism injectSub (\i -> maybe (Left i) Right (projectSub i))+ {-# INLINE[2] _Sub #-} -- |Injects a subtype into a supertype (upcast). injectSub :: sub -> sup
src/Data/Generics/Sum/Typed.hs view
@@ -89,6 +89,7 @@ -- ... _Typed :: Prism' s a _Typed = prism injectTyped (\i -> maybe (Left i) Right (projectTyped i))+ {-# INLINE[2] _Typed #-} -- |Inject by type. injectTyped :: a -> s@@ -111,7 +112,7 @@ ) => AsType a s where _Typed eta = prismRavel (prismPRavel (repIso . _GTyped @_ @as . tupled)) eta- {-# INLINE _Typed #-}+ {-# INLINE[2] _Typed #-} -- See Note [Uncluttering type signatures] instance {-# OVERLAPPING #-} AsType a Void where