summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouispan <>2018-04-14 12:55:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2018-04-14 12:55:00 (GMT)
commite8dc5f4a4488360ae4138a54050b82e234d28b1f (patch)
tree2b3412b7dea16af20db0922838270f76b73326ce
parente0f396f600ed30003f57ddaad181911084c7492b (diff)
version 3.0.0.13.0.0.1
-rw-r--r--README.md3
-rw-r--r--data-diverse-lens.cabal2
-rw-r--r--src/Data/Diverse/Lens/Many.hs6
3 files changed, 7 insertions, 4 deletions
diff --git a/README.md b/README.md
index 4c255b7..4995ddb 100644
--- a/README.md
+++ b/README.md
@@ -7,6 +7,9 @@ Refer to [ManySpec.hs](https://github.com/louispan/data-diverse-lens/blob/master
# Changelog
+* 3.0.0.1
+ - Fixed GHC 8.2.2 "Type indexes must match class instance head" compile error.
+
* 3.0.0.0
- Renamed `SelectWith` to `MakeFrom`, split `ChooseBtween` to `ChooseBoth` and `ChooseFrom`.
- Removed hard to remember operators ``>&&>` `*&&*` `+||+` `>||>`
diff --git a/data-diverse-lens.cabal b/data-diverse-lens.cabal
index 8961dd9..4720557 100644
--- a/data-diverse-lens.cabal
+++ b/data-diverse-lens.cabal
@@ -1,5 +1,5 @@
name: data-diverse-lens
-version: 3.0.0.0
+version: 3.0.0.1
synopsis: Isos & Lens for Data.Diverse.Many and Prisms for Data.Diverse.Which
description: Isos & Lens for Data.Diverse.Many and Prisms for Data.Diverse.Which
Refer to [ManySpec.hs](https://github.com/louispan/data-diverse-lens/blob/master/test/Data/Diverse/Lens/ManySpec.hs) and [WhichSpec.hs](https://github.com/louispan/data-diverse-lens/blob/master/test/Data/Diverse/Lens/WhichSpec.hs) for example usages.
diff --git a/src/Data/Diverse/Lens/Many.hs b/src/Data/Diverse/Lens/Many.hs
index 835aa07..a6c6b27 100644
--- a/src/Data/Diverse/Lens/Many.hs
+++ b/src/Data/Diverse/Lens/Many.hs
@@ -88,7 +88,7 @@ class (HasItem' a s, Replaced a a s ~ s) => HasItem a s where
item :: Lens s (Replaced a b s) a b
instance (UniqueMember x xs) => HasItem x (Many xs) where
- type Replaced a b (Many xs) = Many (Replace a b xs)
+ type Replaced x b (Many xs) = Many (Replace x b xs)
item = lens grab (replace @x)
-- | 'grabL' ('view' 'itemL') and 'replaceL' ('set' 'itemL') in 'Lens'' form.
@@ -124,7 +124,7 @@ class (HasItemL' (l :: k) a s, ReplacedL l a a s ~ s) => HasItemL (l :: k) a s |
itemL :: Lens s (ReplacedL l a b s) a b
instance (UniqueLabelMember l xs, x ~ KindAtLabel l xs) => HasItemL l x (Many xs) where
- type ReplacedL l _ b (Many xs) = Many (Replace (KindAtLabel l xs) b xs)
+ type ReplacedL l x b (Many xs) = Many (Replace (KindAtLabel l xs) b xs)
itemL = lens (grabL @l) (replaceL @l)
-- | Variation of 'itemL'' that automatically tags and untags a Tagged field.
@@ -167,7 +167,7 @@ class (HasItemN' (n :: Nat) a s, ReplacedN n a a s ~ s) => HasItemN (n :: Nat) a
instance (MemberAt n x xs)
=> HasItemN n x (Many xs) where
- type ReplacedN n a b (Many xs) = Many (ReplaceIndex n a b xs)
+ type ReplacedN n x b (Many xs) = Many (ReplaceIndex n x b xs)
itemN = lens (grabN @n) (replaceN @n)
-----------------------------------------------------------------------