From c6554ea38cd2248d487348852afafb8ee8ceb06b Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Thu, 3 Nov 2022 14:34:34 +0000 Subject: [PATCH] chore: Upgrade to `mtl-2.3.1`. --- cabal.project | 3 ++- primer-rel8/primer-rel8.cabal | 2 +- primer-service/primer-service.cabal | 6 +++--- primer/primer.cabal | 6 +++--- primer/src/Foreword.hs | 5 ----- 5 files changed, 9 insertions(+), 13 deletions(-) diff --git a/cabal.project b/cabal.project index 051928a0e..faf746001 100644 --- a/cabal.project +++ b/cabal.project @@ -18,4 +18,5 @@ package primer package primer-service test-options: "--size-cutoff=32768" -allow-newer: logging-effect:text +allow-newer: + logging-effect:text, *:mtl diff --git a/primer-rel8/primer-rel8.cabal b/primer-rel8/primer-rel8.cabal index 76ace460f..16e554be9 100644 --- a/primer-rel8/primer-rel8.cabal +++ b/primer-rel8/primer-rel8.cabal @@ -40,7 +40,7 @@ library , hasql ^>=1.6 , hasql-pool ^>=0.8.0.3 , logging-effect ^>=1.3.13 - , mtl >=2.2.2 && <2.4.0 + , mtl ^>=2.3.1 , optics >=0.4 && <0.5.0 , primer ^>=0.7.2 , rel8 ^>=1.4 diff --git a/primer-service/primer-service.cabal b/primer-service/primer-service.cabal index da54849ab..fa21b6df3 100644 --- a/primer-service/primer-service.cabal +++ b/primer-service/primer-service.cabal @@ -48,7 +48,7 @@ library , http-types ^>=0.12.3 , insert-ordered-containers ^>=0.2.5.1 , logging-effect ^>=1.3.13 - , mtl >=2.2.2 && <2.4.0 + , mtl ^>=2.3.1 , openapi3 >=3.2 && <3.3.0 , optics >=0.4 && <0.5.0 , primer ^>=0.7.2 @@ -186,7 +186,7 @@ test-suite service-test , aeson-pretty , base , bytestring - , hedgehog ^>=1.1.1 + , hedgehog ^>=1.2 , hedgehog-quickcheck ^>=0.1.1 , hspec ^>=2.9.4 , openapi3 @@ -201,7 +201,7 @@ test-suite service-test , tasty ^>=1.4.1 , tasty-discover ^>=4.2.4 , tasty-golden ^>=2.3.5 - , tasty-hedgehog ^>=1.2.0 + , tasty-hedgehog ^>=1.4 , tasty-hspec ^>=1.2.0.1 , tasty-hunit ^>=0.10.0 , text diff --git a/primer/primer.cabal b/primer/primer.cabal index bf0afbb51..5dadd07c0 100644 --- a/primer/primer.cabal +++ b/primer/primer.cabal @@ -115,7 +115,7 @@ library , logging-effect ^>=1.3.13 , megaparsec >=8.0.0 && <9.3.0 , mmorph ^>=1.2.0 - , mtl >=2.2.2 && <2.4.0 + , mtl ^>=2.3.1 , optics >=0.4 && <0.5.0 , prettyprinter >=1.7.1 && <1.8.0 , prettyprinter-ansi-terminal >=1.1.3 && <1.2.0 @@ -157,13 +157,13 @@ library primer-hedgehog build-depends: , base , containers - , hedgehog ^>=1.1.1 + , hedgehog ^>=1.2 , mmorph ^>=1.2.0 , mtl , primer , primer-testlib , tasty-discover ^>=4.2.4 - , tasty-hedgehog ^>=1.2.0 + , tasty-hedgehog ^>=1.4 library primer-testlib visibility: public diff --git a/primer/src/Foreword.hs b/primer/src/Foreword.hs index c526deb5d..afc176dcd 100644 --- a/primer/src/Foreword.hs +++ b/primer/src/Foreword.hs @@ -7,7 +7,6 @@ module Foreword ( adjustAt, findAndAdjust, findAndAdjustA, - modifyError, mwhen, munless, hoistAccum, @@ -119,10 +118,6 @@ findAndAdjustA p f = \case [] -> pure Nothing x : xs -> if p x then Just . (: xs) <$> f x else (x :) <<$>> findAndAdjustA p f xs --- | Change the type of an error. -modifyError :: MonadError e' m => (e -> e') -> ExceptT e m a -> m a -modifyError f = runExceptT >=> either (throwError . f) pure - -- | @munless b x@ is `x` if `b` is 'False', otherwise it is 'mempty'. -- It's like 'Control.Monad.unless' but for Monoids rather than Applicatives. munless :: Monoid a => Bool -> a -> a