mutable 0.2.1.0 → 0.2.2.0
raw patch · 3 files changed
+19/−13 lines, 3 filesdep −constraintsdep −reflectiondep ~base
Dependencies removed: constraints, reflection
Dependency ranges changed: base
Files
- CHANGELOG.md +10/−0
- mutable.cabal +4/−7
- src/Data/Mutable/Branches.hs +5/−6
CHANGELOG.md view
@@ -1,6 +1,16 @@ Changelog ========= +Version 0.2.2.0+---------------++*July 9, 2020*++<https://github.com/mstksg/mutable/releases/tag/v0.2.2.0>++* Bugfix: *Generics* mechanisms for `MutBranch` for data types with more than+ two constructors fixed.+ Version 0.2.1.0 ---------------
mutable.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: ffd197df55f7f93dd8ec419431fdd2c85526097855d397d55d17828e1eebbe95+-- hash: 9f019adb3428127c9388e91df1ba074ed6013a8bead0bf66c1ed5e2b477a5606 name: mutable-version: 0.2.1.0+version: 0.2.2.0 synopsis: Automatic piecewise-mutable references for your types description: Associate and generate "piecewise-mutable" versions for your composite data types. Think of it like a "generalized MVector for all ADTs".@@ -44,21 +44,18 @@ Data.Mutable.Branches Data.Mutable.Class Data.Mutable.Instances- Data.Mutable.Internal.TH Data.Mutable.Parts other-modules: Data.Mutable.Internal+ Data.Mutable.Internal.TH hs-source-dirs: src ghc-options: -Wall -Wcompat -Wredundant-constraints -Werror=incomplete-patterns build-depends:- base >=4.11 && <5- , constraints+ base >=4.12 && <5 , generic-lens >=2.0 , generic-lens-core >=2.0- , microlens , primitive >=0.6.4- , reflection , template-haskell , transformers , vector
src/Data/Mutable/Branches.hs view
@@ -592,6 +592,7 @@ gmbcProj = gmbsProj @ctor @(GL.HasCtorP ctor l) gmbcEmbed = gmbsEmbed @ctor @(GL.HasCtorP ctor l) + class ( GMutable s l , GMutable s r , Mutable s a@@ -626,18 +627,16 @@ instance ( GMutable s l , GMutBranchConstructor ctor s r a- , GIsList (GRef_ s r) (GRef_ s r) (MapRef s as) (MapRef s as)- , GIsList r r as as- , ListTuple a a as as- , ListRefTuple s b as , Ref s a ~ b ) => GMutBranchSum ctor 'False s l r a where gmbsProj lb (MutSumF r) = readMutVar r >>= \case L1 _ -> pure Nothing R1 x -> gmbcProj lb x- gmbsEmbed _ = fmap MutSumF . newMutVar . R1- . GLP.view (GL.fromIso (glist . tupledRef @s @b @as))+ gmbsEmbed lb r = do+ gr <- gmbcEmbed lb r+ MutSumF <$> newMutVar (R1 gr)+ -- | Create a 'MutBranch' for any data type with a 'Generic' instance by -- specifying the constructor name using OverloadedLabels