From 8d118b8ef77ff91e9b072f7a2161a307a2e33e45 Mon Sep 17 00:00:00 2001 From: Oleg Grenrus Date: Wed, 8 Jan 2025 14:08:40 +0200 Subject: [PATCH] Remove Eq requirement from ediffGolden --- ChangeLog.md | 4 ++++ src/Data/TreeDiff/Golden.hs | 4 ++-- tree-diff.cabal | 4 ++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index e8634be..1a0621c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,3 +1,7 @@ +## 0.3.4 + +- Remove 'Eq a' requirement from 'ediffGolden'. The constraint wasn't used, as we only compare 'Expr' representations. + ## 0.3.3 - Change 'ediffGolden' so that parse errors in expected file don't cause the hard failure. diff --git a/src/Data/TreeDiff/Golden.hs b/src/Data/TreeDiff/Golden.hs index 8e1f292..f21f19a 100644 --- a/src/Data/TreeDiff/Golden.hs +++ b/src/Data/TreeDiff/Golden.hs @@ -37,7 +37,7 @@ import qualified Text.PrettyPrint.ANSI.Leijen as WL -- for a proper example. -- ediffGolden - :: (Eq a, ToExpr a) + :: ToExpr a => (testName -> IO Expr -> IO Expr -> (Expr -> Expr -> IO (Maybe String)) -> (Expr -> IO ()) -> testTree) -- ^ 'goldenTest' -> testName -- ^ test name -> FilePath -- ^ path to "golden file" @@ -51,7 +51,7 @@ ediffGolden impl testName fp x = ediffGolden1 impl' testName fp (\() -> x) where -- @since 0.3.2 -- ediffGolden1 - :: forall a arg testName testTree. (Eq a, ToExpr a) + :: forall a arg testName testTree. ToExpr a => (testName -> IO Expr -> (arg -> IO Expr) -> (Expr -> Expr -> IO (Maybe String)) -> (Expr -> IO ()) -> testTree) -- ^ 'goldenTest' -> testName -- ^ test name -> FilePath -- ^ path to "golden file" diff --git a/tree-diff.cabal b/tree-diff.cabal index 16edfef..49a75ae 100644 --- a/tree-diff.cabal +++ b/tree-diff.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: tree-diff -version: 0.3.3 +version: 0.3.4 synopsis: Diffing of (expression) trees. category: Data, Testing description: @@ -171,4 +171,4 @@ benchmark tree-diff-bench -- extra dependencies build-depends: , criterion ^>=1.6.3.0 - , Diff ^>=0.5 + , Diff ^>=1.0