We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 60d5647 commit 4e53f6bCopy full SHA for 4e53f6b
src/Nix/Value/Equal.hs
@@ -50,17 +50,16 @@ alignEqM
50
-> m Bool
51
alignEqM eq fa fb =
52
fmap
53
- isRight
+ (isRight @() @())
54
$ runExceptT $
55
- do
56
- pairs <-
57
- traverse
+ traverse_
+ (guard <=< lift . uncurry eq)
+ =<< traverse
58
(\case
59
These a b -> pure (a, b)
60
- _ -> throwE ()
+ _ -> throwE mempty
61
)
62
(Data.Semialign.align fa fb)
63
- traverse_ (\ (a, b) -> guard =<< lift (eq a b)) pairs
64
65
alignEq :: (Align f, Traversable f) => (a -> b -> Bool) -> f a -> f b -> Bool
66
alignEq eq fa fb = runIdentity $ alignEqM (\x y -> Identity (eq x y)) fa fb
0 commit comments