Skip to content

Commit

Permalink
Merge pull request #268 from fused-effects/re-source-resource
Browse files Browse the repository at this point in the history
Re-source Resource
  • Loading branch information
patrickt committed Oct 16, 2019
2 parents ea65926 + 5905d84 commit 37c99cc
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 159 deletions.
2 changes: 1 addition & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

- Removes `prj` from `Member`, as it was only used in `InterposeC` (see above), and was generally inadvisable due to its lack of modularity. ([#223](https://github.com/fused-effects/fused-effects/pull/223))

- Simplifies `ResourceC` by moving the `MonadUnliftIO` constraint on its `Carrier` instance instead of on the `runResource` handler, obviating the need for it to wrap a `ReaderC` carrier. This should not impact usage except in code manually constructing/eliminating `ResourceC` values. ([#254](https://github.com/fused-effects/fused-effects/pull/254))
- Removes the `Resource` effect and carrier. Both have been relocated to `fused-effects-exceptions`. ([#268](https://github.com/fused-effects/fused-effects/pull/268))

- Redefines `Fail` as a synonym for `Throw String`. ([#247](https://github.com/fused-effects/fused-effects/pull/247))

Expand Down
2 changes: 0 additions & 2 deletions fused-effects.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ library
Control.Carrier.NonDet.Church
Control.Carrier.Pure
Control.Carrier.Reader
Control.Carrier.Resource
Control.Carrier.Resumable.Either
Control.Carrier.Resumable.Resume
Control.Carrier.State.Lazy
Expand All @@ -83,7 +82,6 @@ library
Control.Effect.NonDet
Control.Effect.Pure
Control.Effect.Reader
Control.Effect.Resource
Control.Effect.Resumable
Control.Effect.State
Control.Effect.Sum
Expand Down
63 changes: 0 additions & 63 deletions src/Control/Carrier/Resource.hs

This file was deleted.

6 changes: 1 addition & 5 deletions src/Control/Effect/Catch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ instance Effect (Catch e) where

-- | Run a computation which can throw errors with a handler to run on error.
--
-- Errors thrown by the handler will escape up to the nearest enclosing 'catchError' (if any).
-- Note that this effect does /not/ handle errors thrown from impure contexts such as IO,
-- nor will it handle exceptions thrown from pure code. If you need to handle IO-based errors,
-- consider if 'Control.Effect.Resource' fits your use case; if not, use 'Control.Monad.IO.Class.liftIO' with
-- 'Control.Exception.try' or use 'Control.Exception.catch' from outside the effect invocation.
-- Errors thrown by the handler will escape up to the nearest enclosing 'catchError' (if any). Note that this effect does /not/ handle errors thrown from impure contexts such as IO, nor will it handle exceptions thrown from pure code. If you need to handle IO-based errors, consider if @fused-effects-exceptions@ fits your use case; if not, use 'Control.Monad.IO.Class.liftIO' with 'Control.Exception.try' or use 'Control.Exception.catch' from outside the effect invocation.
--
-- @
-- runError ('throwError' e `catchError` f) = runError (f e)
Expand Down
2 changes: 1 addition & 1 deletion src/Control/Effect/Error.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{- | An effect modelling catchable failure with a polymorphic error type, the combination of 'Throw' and 'Catch'.
This effect is similar to the traditional @MonadError@ typeclass, though it allows the presence of multiple @Error@ effects in a given effect stack. It offers precise exception handling, rather than the dynamic exception hierarchy provided by the @exceptions@ package. The 'Control.Effect.Resource' effect or the @fused-effects-exceptions@ package may be more suitable for handling dynamic/impure effect handling.
This effect is similar to the traditional @MonadError@ typeclass, though it allows the presence of multiple @Error@ effects in a given effect stack. It offers precise exception handling, rather than the dynamic exception hierarchy provided by the @exceptions@ package. The @fused-effects-exceptions@ package may be more suitable for handling dynamic/impure effect handling.
Predefined carriers:
Expand Down
87 changes: 0 additions & 87 deletions src/Control/Effect/Resource.hs

This file was deleted.

0 comments on commit 37c99cc

Please sign in to comment.