Upgrade to fused-effects 0.5.
parent
5533982d40
commit
b2d59dc0d6
|
@ -1,5 +1,7 @@
|
||||||
|
cabal-version: 2.4
|
||||||
|
|
||||||
name: fused-effects-exceptions
|
name: fused-effects-exceptions
|
||||||
version: 0.1.1.0
|
version: 0.2.0.0
|
||||||
synopsis: Handle exceptions thrown in IO with fused-effects.
|
synopsis: Handle exceptions thrown in IO with fused-effects.
|
||||||
description: Provides an effect that enables catching exceptions thrown from impure computations such as 'IO'.
|
description: Provides an effect that enables catching exceptions thrown from impure computations such as 'IO'.
|
||||||
homepage: https://github.com/patrickt/fused-effects-exceptions#readme
|
homepage: https://github.com/patrickt/fused-effects-exceptions#readme
|
||||||
|
@ -8,7 +10,7 @@ license-file: LICENSE
|
||||||
author: Josh Vera
|
author: Josh Vera
|
||||||
maintainer: patrickt@github.com
|
maintainer: patrickt@github.com
|
||||||
copyright: 2019 Josh Vera and Patrick Thomson
|
copyright: 2019 Josh Vera and Patrick Thomson
|
||||||
category: Control.
|
category: Control
|
||||||
build-type: Simple
|
build-type: Simple
|
||||||
cabal-version: >=1.10
|
cabal-version: >=1.10
|
||||||
extra-source-files: README.md
|
extra-source-files: README.md
|
||||||
|
@ -20,7 +22,7 @@ library
|
||||||
default-language: Haskell2010
|
default-language: Haskell2010
|
||||||
exposed-modules: Control.Effect.Catch
|
exposed-modules: Control.Effect.Catch
|
||||||
build-depends: base >= 4.7 && < 5
|
build-depends: base >= 4.7 && < 5
|
||||||
, fused-effects >= 0.3 && <1
|
, fused-effects ^>= 0.5
|
||||||
, safe-exceptions >= 0.1 && <1
|
, safe-exceptions >= 0.1 && <1
|
||||||
, unliftio-core >= 0.1.2 && <1
|
, unliftio-core >= 0.1.2 && <1
|
||||||
|
|
||||||
|
|
|
@ -27,12 +27,12 @@ import Control.Monad.IO.Class
|
||||||
import Control.Monad.IO.Unlift
|
import Control.Monad.IO.Unlift
|
||||||
|
|
||||||
data Catch m k
|
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
|
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
|
instance Effect Catch where
|
||||||
handle state handler (CatchIO go cleanup k)
|
handle state handler (CatchIO go cleanup k)
|
||||||
|
|
Loading…
Reference in New Issue