From c0d97ca49d1224a98492b10a9a79349e91cb0e5c Mon Sep 17 00:00:00 2001 From: Kevin Quick Date: Fri, 12 Mar 2021 15:46:16 -0800 Subject: [PATCH 1/2] Remove a couple of miscellaneous constraints. --- what4/src/What4/Utils/AnnotatedMap.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/what4/src/What4/Utils/AnnotatedMap.hs b/what4/src/What4/Utils/AnnotatedMap.hs index 65ed93bf..042d4d69 100644 --- a/what4/src/What4/Utils/AnnotatedMap.hs +++ b/what4/src/What4/Utils/AnnotatedMap.hs @@ -86,7 +86,7 @@ instance (Ord k, Semigroup v) => Monoid (Tag k v) where mempty = NoTag mappend = unionTag -unionTag :: (Ord k, Semigroup v) => Tag k v -> Tag k v -> Tag k v +unionTag :: (Semigroup v) => Tag k v -> Tag k v -> Tag k v unionTag x NoTag = x unionTag NoTag y = y unionTag (Tag ix _ vx) (Tag iy ky vy) = @@ -287,7 +287,7 @@ mapMaybe f (AnnotatedMap ft) = where g (Entry k v a) = Entry k v <$> f a traverseMaybeWithKey :: - (Applicative f, Ord k, Semigroup v1, Semigroup v2) => + (Applicative f, Ord k, Semigroup v2) => (k -> v1 -> a1 -> f (Maybe (v2, a2))) -> AnnotatedMap k v1 a1 -> f (AnnotatedMap k v2 a2) traverseMaybeWithKey f (AnnotatedMap ft) = From 25e4d5f9a0305a629d658304c82ffe66188ee983 Mon Sep 17 00:00:00 2001 From: Kevin Quick Date: Fri, 12 Mar 2021 16:00:46 -0800 Subject: [PATCH 2/2] Remove other unneeded constraints. --- what4/src/What4/Utils/AnnotatedMap.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/what4/src/What4/Utils/AnnotatedMap.hs b/what4/src/What4/Utils/AnnotatedMap.hs index 042d4d69..4ad4154c 100644 --- a/what4/src/What4/Utils/AnnotatedMap.hs +++ b/what4/src/What4/Utils/AnnotatedMap.hs @@ -59,13 +59,13 @@ filterFingerTree p = foldl' (\xs x -> if p x then xs FT.|> x else xs) FT.empty mapMaybeFingerTree :: - (FT.Measured v1 a1, FT.Measured v2 a2) => + (FT.Measured v2 a2) => (a1 -> Maybe a2) -> FT.FingerTree v1 a1 -> FT.FingerTree v2 a2 mapMaybeFingerTree f = foldl' (\xs x -> maybe xs (xs FT.|>) (f x)) FT.empty traverseMaybeFingerTree :: - (Applicative f, FT.Measured v1 a1, FT.Measured v2 a2) => + (Applicative f, FT.Measured v2 a2) => (a1 -> f (Maybe a2)) -> FT.FingerTree v1 a1 -> f (FT.FingerTree v2 a2) traverseMaybeFingerTree f = foldl' (\m x -> rebuild <$> m <*> f x) (pure FT.empty)