From b2d59dc0d61639b3c3bd39a9e7100c7d77a06754 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Sat, 6 Jul 2019 10:31:33 -0400 Subject: [PATCH] Upgrade to fused-effects 0.5. --- fused-effects-exceptions.cabal | 12 +++++++----- src/Control/Effect/Catch.hs | 6 +++--- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/fused-effects-exceptions.cabal b/fused-effects-exceptions.cabal index 5a8ecbb..5fe9c22 100644 --- a/fused-effects-exceptions.cabal +++ b/fused-effects-exceptions.cabal @@ -1,5 +1,7 @@ +cabal-version: 2.4 + name: fused-effects-exceptions -version: 0.1.1.0 +version: 0.2.0.0 synopsis: Handle exceptions thrown in IO with fused-effects. description: Provides an effect that enables catching exceptions thrown from impure computations such as 'IO'. homepage: https://github.com/patrickt/fused-effects-exceptions#readme @@ -8,7 +10,7 @@ license-file: LICENSE author: Josh Vera maintainer: patrickt@github.com copyright: 2019 Josh Vera and Patrick Thomson -category: Control. +category: Control build-type: Simple cabal-version: >=1.10 extra-source-files: README.md @@ -19,10 +21,10 @@ library hs-source-dirs: src default-language: Haskell2010 exposed-modules: Control.Effect.Catch - build-depends: base >= 4.7 && < 5 - , fused-effects >= 0.3 && <1 + build-depends: base >= 4.7 && < 5 + , fused-effects ^>= 0.5 , safe-exceptions >= 0.1 && <1 - , unliftio-core >= 0.1.2 && <1 + , unliftio-core >= 0.1.2 && <1 source-repository head type: git diff --git a/src/Control/Effect/Catch.hs b/src/Control/Effect/Catch.hs index e326b36..662a381 100644 --- a/src/Control/Effect/Catch.hs +++ b/src/Control/Effect/Catch.hs @@ -27,12 +27,12 @@ import Control.Monad.IO.Class import Control.Monad.IO.Unlift data Catch m k - = forall output e . Exc.Exception e => CatchIO (m output) (e -> m output) (output -> k) + = forall output e . Exc.Exception e => CatchIO (m output) (e -> m output) (output -> m k) -deriving instance Functor (Catch m) +deriving instance Functor m => Functor (Catch m) instance HFunctor Catch where - hmap f (CatchIO go cleanup k) = CatchIO (f go) (f . cleanup) k + hmap f (CatchIO go cleanup k) = CatchIO (f go) (f . cleanup) (f . k) instance Effect Catch where handle state handler (CatchIO go cleanup k)