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

Add Final Effect #217

Merged
merged 5 commits into from
Aug 30, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
29 changes: 29 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,34 @@
# Changelog for polysemy


## 1.2.0.0 (TODO)
Copy link
Collaborator Author

@KingoftheHomeless KingoftheHomeless Aug 29, 2019

Choose a reason for hiding this comment

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

Marked the date as TODO here since I figure we might want to do more for this version before we publish it to Hackage.


### Breaking Changes

- All `lower-` interpreters have been deprecated, in favor of corresponding
`-Final` interpreters.
- `runFixpoint` and `runFixpointM` have been deprecated in favor of `fixpointToFinal`.
- The semantics for `runNonDet` when `<|>` is used inside a higher-order action of
another effect has been changed.
- Type variables for certain internal functions and `failToEmbed` have been rearranged.

## Other changes

- Added `Final` effect, an effect for embedding higher-order actions in the
final monad of the effect stack. Any interpreter should use this instead of
requiring to be provided an explicit lowering function to the final monad.
- Added `Strategy` environment for use together with `Final`
- Added `asyncToIOFinal`, a better alternative of `lowerAsync`
- Added `errorToIOFinal`, a better alternative of `lowerError`
- Added `fixpointToFinal`, a better alternative of `runFixpoint` and `runFixpointM`
- Added `resourceToIOFinal`, a better alternative of `lowerResource`
- Added `outputToIOMonoid` and `outputToIOMonoidAssocR`
- Added `runWriterTVar`, `writerToIOFinal`, and `writerToIOAssocRFinal`
- Added `writerToEndoWriter`
- Added `subsume` operation
- Exposed `raiseUnder`/`2`/`3` in `Polysemy`


## 1.1.0.0 (2019-08-15)

### Breaking Changes
Expand Down
11 changes: 8 additions & 3 deletions src/Polysemy/Fixpoint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import Polysemy.Internal.Fixpoint
-- bad =
-- 'Data.Functor.Identity.runIdentity'
-- . 'runFinal'
-- . 'fixpointToFinal' @'Data.Functor.Identity.Identity'
-- . 'Polysemy.State.runLazyState' @Int 1
-- . 'fixpointToFinal' \@'Data.Functor.Identity.Identity'
-- . 'Polysemy.State.runLazyState' \@Int 1
-- . 'Polysemy.Error.runError'
-- $ mdo
-- 'Polysemy.State.put' a
Expand All @@ -45,7 +45,12 @@ import Polysemy.Internal.Fixpoint
--
-- 'fixpointToFinal' also operates under the assumption that any effectful
-- state which can't be inspected using 'Polysemy.Inspector' can't contain any
-- values. This is true for all interpreters featured in this package,
-- values. For example, the effectful state for 'Polysemy.Error.runError' is
-- @'Either' e a@. The inspector for this effectful state only fails if the
-- effectful state is a @'Left'@ value, which therefore doesn't contain any
-- values of @a@.
--
-- This assumption holds true for all interpreters featured in this package,
-- and is presumably always true for any properly implemented interpreter.
-- 'fixpointToFinal' may throw an exception if it is used together with an
-- interpreter that uses 'Polysemy.Internal.Union.weave' improperly.
Expand Down