finite-table 0.1.0.0 → 0.1.0.1
raw patch · 3 files changed
+11/−7 lines, 3 filesdep ~basedep ~lensdep ~portrayPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: base, lens, portray, sint
API changes (from Hackage documentation)
Files
- CHANGELOG.md +4/−0
- finite-table.cabal +4/−4
- src/Data/Finite/Table.hs +3/−3
CHANGELOG.md view
@@ -1,3 +1,7 @@ # 0.1.0.0 Initial version.++# 0.1.0.1++* Support portray-0.2.
finite-table.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 846224cc1ea6987d33f8472ae781836cc87ccbf4e2cf71fda8e537b8ce9d56c0+-- hash: fc06da362a02920aed6d8970731891497f28504ef1592353c91ca40c73a49d1f name: finite-table-version: 0.1.0.0+version: 0.1.0.1 synopsis: Types isomorphic to Fin, and Tables indexed by them. description: This provides a class `Finite` for types isomorphic to some `Fin n`, and uses it to implement array-backed total maps (`Table`s) indexed by them.@@ -46,7 +46,7 @@ , fin-int >=0.1 && <0.2 , indexed-traversable >=0.1 && <0.2 , lens >=4.15 && <5.1- , portray >=0.1 && <0.2+ , portray >=0.1.1 && <0.3 , portray-diff >=0.1 && <0.2 , short-vec >=0.1 && <0.2 , short-vec-lens >=0.1 && <0.2@@ -73,7 +73,7 @@ , finite-table , indexed-traversable >=0.1 && <0.2 , lens >=4.15 && <5.1- , portray >=0.1 && <0.2+ , portray >=0.1.1 && <0.3 , portray-diff >=0.1 && <0.2 , short-vec >=0.1 && <0.2 , short-vec-lens >=0.1 && <0.2
src/Data/Finite/Table.hs view
@@ -102,14 +102,14 @@ -- mkTable (\\case { 0 -> True; 1 -> False; 2 -> True }) -- @ instance (Finite a, Portray a, Portray b) => Portray (Table a b) where- portray (Table xs) = Apply "mkTable" $ pure $ LambdaCase $+ portray (Table xs) = Apply (Name "mkTable") $ pure $ LambdaCase $ zipWith (\a b -> (portray a, portray b)) (enumerate @a) (toList xs) instance (Finite a, Portray a, Diff b) => Diff (Table a b) where diff (Table xs) (Table ys) = if hasDiff- then Just $ Apply "mkTable" $ pure $ LambdaCase $- (if allDiff then id else (++ [("_", "_")])) $+ then Just $ Apply (Name "mkTable") $ pure $ LambdaCase $+ (if allDiff then id else (++ [(Opaque "_", Opaque "_")])) $ catMaybes labeledDiffs else Nothing where