Skip to content

Commit 924a391

Browse files
committed
Merge remote-tracking branch 'origin/develop' into patchable
2 parents f432e7d + 1499374 commit 924a391

File tree

12 files changed

+88
-43
lines changed

12 files changed

+88
-43
lines changed

.github/workflows/haskell.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
name: github-action
22

3-
on: [push, pull_request]
3+
on: [push, pull_request]
44

55
jobs:
66
build:
77
strategy:
88
matrix:
9-
ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.2']
9+
ghc: ['8.0.2', '8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.7', '9.0.1', '9.2.2']
1010
os: ['ubuntu-latest', 'macos-latest']
1111
exclude:
1212
# There are some linker warnings in 802 on darwin that
@@ -19,7 +19,7 @@ jobs:
1919
name: GHC ${{ matrix.ghc }} on ${{ matrix.os }}
2020
steps:
2121
- uses: actions/checkout@v2
22-
- uses: actions/setup-haskell@v1
22+
- uses: haskell/actions/setup@v1
2323
with:
2424
ghc-version: ${{ matrix.ghc }}
2525
- name: Cache

ChangeLog.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
# Revision history for patch
22

3+
## Unreleased
4+
5+
* Support GHC 9.2
6+
7+
## 0.0.5.2 - 2022-01-09
8+
9+
* Correct field order of `PatchMapWithMove.NodeInfo`.
10+
11+
When we this was reimplemented as a pattern synonym wrapper in 0.0.5.0, we
12+
accidentally flipped the argument order. Reversing it now to match 0.0.4.0
13+
and restore compatibility. The previous releases in the 0.0.5.\* series will
14+
correspondingly be deprecated.
15+
316
## 0.0.5.1 - 2021-12-28
417

5-
* New dep of `data-orphans` for old GHC to get instances honestly instead of
18+
* New dep of `base-orphans` for old GHC to get instances honestly instead of
619
via `monoidal-containers`.
720

821
## 0.0.5.0 - 2021-12-17

dep/reflex-platform/default.nix

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,2 @@
11
# DO NOT HAND-EDIT THIS FILE
2-
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
3-
if !fetchSubmodules && !private then builtins.fetchTarball {
4-
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
5-
} else (import <nixpkgs> {}).fetchFromGitHub {
6-
inherit owner repo rev sha256 fetchSubmodules private;
7-
};
8-
in import (fetch (builtins.fromJSON (builtins.readFile ./github.json)))
2+
import (import ./thunk.nix)

dep/reflex-platform/github.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
"repo": "reflex-platform",
44
"branch": "master",
55
"private": false,
6-
"rev": "c9d11db1b98855fe8ab24a3ff6a5dbe0ad902ad9",
7-
"sha256": "0sfzkqdvyah5mwvmli0wq1nl0b8cvk2cmfgfy4rz57wv42x3099y"
6+
"rev": "123a6f487ca954fd983f6d4cd6b2a69d4c463d10",
7+
"sha256": "16q1rq0rwi6l28fv46q8m0hvb9rxrzf574j865vaz04xy8d5p1ya"
88
}

dep/reflex-platform/thunk.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# DO NOT HAND-EDIT THIS FILE
2+
let fetch = { private ? false, fetchSubmodules ? false, owner, repo, rev, sha256, ... }:
3+
if !fetchSubmodules && !private then builtins.fetchTarball {
4+
url = "https://github.com/${owner}/${repo}/archive/${rev}.tar.gz"; inherit sha256;
5+
} else (import <nixpkgs> {}).fetchFromGitHub {
6+
inherit owner repo rev sha256 fetchSubmodules private;
7+
};
8+
json = builtins.fromJSON (builtins.readFile ./github.json);
9+
in fetch json

patch.cabal

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: patch
2-
Version: 0.0.5.1
2+
Version: 0.0.5.2
33
Synopsis: Data structures for describing changes to other data structures.
44
Description:
55
Data structures for describing changes to other data structures.
@@ -22,7 +22,7 @@ extra-source-files:
2222
ChangeLog.md
2323

2424
tested-with:
25-
GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.1
25+
GHC ==8.0.2 || ==8.2.2 || ==8.4.4 || ==8.6.5 || ==8.8.4 || ==8.10.7 || ==9.0.1 || ==9.2.2
2626
GHCJS ==8.4
2727

2828
flag split-these
@@ -33,14 +33,15 @@ flag split-these
3333
library
3434
hs-source-dirs: src
3535
default-language: Haskell2010
36-
build-depends: base >= 4.9 && < 4.15
36+
build-depends: base >= 4.9 && < 4.17
3737
, constraints-extras >= 0.3 && < 0.4
3838
, containers >= 0.6 && < 0.7
3939
, dependent-map >= 0.3 && < 0.5
4040
, dependent-sum >= 0.6 && < 0.8
41-
, lens >= 4.7 && < 5
41+
, lens >= 4.7 && < 5.2
42+
, indexed-traversable >= 0.1 && < 0.2
4243
, semigroupoids >= 4.0 && < 6
43-
, transformers >= 0.5.6.0 && < 0.6
44+
, transformers >= 0.5.6.0 && < 0.7
4445
, witherable >= 0.3 && < 0.5
4546

4647
if impl(ghc < 8.6) -- really, if base < 8.12
@@ -64,7 +65,7 @@ library
6465

6566
if flag(split-these)
6667
build-depends: these >= 1 && <1.2
67-
, semialign >=1 && <1.2
68+
, semialign >=1 && <1.3
6869
, monoidal-containers >= 0.6 && < 0.7
6970
else
7071
build-depends: these >= 0.4 && <0.9
@@ -92,7 +93,7 @@ test-suite hlint
9293
, directory
9394
, filepath
9495
, filemanip
95-
, hlint (< 2.1 || >= 2.2.2) && < 3.3
96+
, hlint (< 2.1 || >= 2.2.2) && < 3.5
9697
if impl(ghcjs)
9798
buildable: False
9899

src/Data/Functor/Misc.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import Data.GADT.Compare
5050
import Data.GADT.Show
5151
import Data.IntMap (IntMap)
5252
import qualified Data.IntMap as IntMap
53+
import Data.Kind (Type)
5354
import Data.Map (Map)
5455
import qualified Data.Map as Map
5556
import Data.Some (Some, mkSome)
@@ -63,7 +64,7 @@ import Data.Typeable hiding (Refl)
6364

6465
-- | 'Const2' stores a value of a given type 'k' and ensures that a particular
6566
-- type 'v' is always given for the last type parameter
66-
data Const2 :: * -> x -> x -> * where
67+
data Const2 :: Type -> x -> x -> Type where
6768
Const2 :: k -> Const2 k v v
6869
deriving (Typeable)
6970

@@ -130,7 +131,7 @@ weakenDMapWith f = Map.fromDistinctAscList . map (\(k :=> v) -> (mkSome k, f v))
130131
-- | 'WrapArg' can be used to tag a value in one functor with a type
131132
-- representing another functor. This was primarily used with dependent-map <
132133
-- 0.2, in which the value type was not wrapped in a separate functor.
133-
data WrapArg :: (k -> *) -> (k -> *) -> * -> * where
134+
data WrapArg :: (k -> Type) -> (k -> Type) -> Type -> Type where
134135
WrapArg :: f a -> WrapArg g f (g a)
135136

136137
deriving instance Eq (f a) => Eq (WrapArg g f (g' a))

src/Data/Monoid/DecidablyEmpty.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@ instance DecidablyEmpty (First a) where
6969
instance DecidablyEmpty (Last a) where
7070
isEmpty (Last a) = isNothing a
7171
deriving instance DecidablyEmpty a => DecidablyEmpty (Identity a)
72+
#if !MIN_VERSION_base(4,16,0)
7273
instance Semigroup a => DecidablyEmpty (Option a) where
7374
isEmpty (Option a) = isNothing a
75+
#endif
7476
deriving instance DecidablyEmpty m => DecidablyEmpty (WrappedMonoid m)
7577
instance (Ord a, Bounded a) => DecidablyEmpty (Max a)
7678
instance (Ord a, Bounded a) => DecidablyEmpty (Min a)

src/Data/Patch/DMapWithMove.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import Data.Functor.Misc
3333
import Data.Functor.Product
3434
import Data.GADT.Compare (GEq (..), GCompare (..))
3535
import Data.GADT.Show (GShow, gshow)
36+
import Data.Kind (Type)
3637
import qualified Data.Map as Map
3738
import Data.Maybe
3839
import Data.Monoid.DecidablyEmpty
@@ -67,7 +68,7 @@ data NodeInfo k v a = NodeInfo
6768

6869
-- |Structure describing a particular change to a key, be it inserting a new key (@From_Insert@), updating an existing key (@From_Insert@ again), deleting a
6970
-- key (@From_Delete@), or moving a key (@From_Move@).
70-
data From (k :: a -> *) (v :: a -> *) :: a -> * where
71+
data From (k :: a -> Type) (v :: a -> Type) :: a -> Type where
7172
-- |Insert a new or update an existing key with the given value @v a@
7273
From_Insert :: v a -> From k v a
7374
-- |Delete the existing key

src/Data/Patch/IntMap.hs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Patches of this sort allow for insert/update or delete of associations.
1414
-}
1515
module Data.Patch.IntMap where
1616

17-
import Control.Lens
17+
import Control.Lens hiding (FunctorWithIndex, FoldableWithIndex, TraversableWithIndex)
18+
import qualified Control.Lens as L
1819
import Data.IntMap.Strict (IntMap)
1920
import qualified Data.IntMap.Strict as IntMap
2021
import Data.Maybe
@@ -23,6 +24,9 @@ import Data.Monoid.DecidablyEmpty
2324
import Data.Semigroup (Semigroup (..))
2425
#endif
2526
import Data.Patch.Class
27+
import Data.Functor.WithIndex
28+
import Data.Foldable.WithIndex
29+
import Data.Traversable.WithIndex
2630

2731
-- | 'Patch' for 'IntMap' which represents insertion or deletion of keys in the mapping.
2832
-- Internally represented by 'IntMap (Maybe a)', where @Just@ means insert/update
@@ -51,8 +55,13 @@ instance Patch (PatchIntMap a) where
5155
instance FunctorWithIndex Int PatchIntMap
5256
instance FoldableWithIndex Int PatchIntMap
5357
instance TraversableWithIndex Int PatchIntMap where
54-
itraverse = itraversed . Indexed
55-
itraversed = _Wrapped .> itraversed <. traversed
58+
itraverse = (_Wrapped .> itraversed <. traversed) . Indexed
59+
60+
#if !MIN_VERSION_lens(5,0,0)
61+
instance L.FunctorWithIndex Int PatchIntMap where imap = Data.Functor.WithIndex.imap
62+
instance L.FoldableWithIndex Int PatchIntMap where ifoldMap = Data.Foldable.WithIndex.ifoldMap
63+
instance L.TraversableWithIndex Int PatchIntMap where itraverse = Data.Traversable.WithIndex.itraverse
64+
#endif
5665

5766
-- | Map a function @Int -> a -> b@ over all @a@s in the given @'PatchIntMap' a@
5867
-- (that is, all inserts/updates), producing a @PatchIntMap b@.

0 commit comments

Comments
 (0)