Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/haskell-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ jobs:
- name: prepare for constraint sets
run: |
rm -f cabal.project.local
- name: constraint set semialign-1.3
run: |
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='semialign >=1.3 && <1.4' all --dry-run
cabal-plan topo | sort
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='semialign >=1.3 && <1.4' --dependencies-only -j2 all
$CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --constraint='semialign >=1.3 && <1.4' all
- name: constraint set random-hashable
run: |
if [ $((HCNUMVER >= 90400 && HCNUMVER < 90600)) -ne 0 ] ; then $CABAL v2-build $ARG_COMPILER --enable-tests --disable-benchmarks --constraint='hashable >=1.3.2.0' --constraint='hashable +random-initial-seed' all --dry-run ; fi
Expand Down
4 changes: 4 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.4.1

- Fix build with semialign-1.3

## 0.4

- Drop `ansi-wl-pprint` dependency, use `prettyprinter` directly.
Expand Down
3 changes: 3 additions & 0 deletions cabal.haskell-ci
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ constraint-set random-hashable
constraints: hashable >=1.3.2.0, hashable +random-initial-seed
tests: True
run-tests: True

constraint-set semialign-1.3
constraints: semialign >=1.3 && <1.4
11 changes: 9 additions & 2 deletions src/Data/TreeDiff/OMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ module Data.TreeDiff.OMap (
elems,
) where

import Prelude hiding (zipWith)

import Control.DeepSeq (NFData (..))
import Data.List (sortBy)
import Data.Ord (comparing)
import Data.Semialign (Semialign(..), Unzip (..), unzipDefault)
import Data.Semialign (Semialign(..), Unzip (..), Zip (..), unzipDefault)
import Data.These (These (..))

import qualified Data.Map.Strict as Map
Expand Down Expand Up @@ -149,5 +151,10 @@ instance Ord k => Semialign (OMap k) where
g (That (Val j y)) = Val j (f (That y))
g (These (Val i x) (Val j y)) = Val (min i j) (f (These x y))

instance Unzip (OMap k) where
instance Ord k => Zip (OMap k) where
zipWith f (OMap xs) (OMap ys) = OMap (zipWith g xs ys) where
g (Val i x) (Val j y) = Val (min i j) (f x y)

-- Ord k is required for semialign <1.4
instance Ord k => Unzip (OMap k) where
unzip = unzipDefault
2 changes: 1 addition & 1 deletion tree-diff.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.2
name: tree-diff
version: 0.4
version: 0.4.1
synopsis: Diffing of (expression) trees.
category: Data, Testing
description:
Expand Down
Loading