Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-source Resource #268

Merged
merged 5 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Soft-wrapped.

  2. Replaced a reference to Control.Effect.Resource with a reference to fused-effects-exceptions.

--
-- @
-- 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.