Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/athanclark/purescript-monad-control
A clone of monad-control in purescript
https://github.com/athanclark/purescript-monad-control
lift monad-control monad-transformers purescript
Last synced: 6 days ago
JSON representation
A clone of monad-control in purescript
- Host: GitHub
- URL: https://github.com/athanclark/purescript-monad-control
- Owner: athanclark
- Created: 2017-05-07T05:20:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-04-19T21:48:18.000Z (over 4 years ago)
- Last Synced: 2024-12-22T18:14:45.986Z (12 days ago)
- Topics: lift, monad-control, monad-transformers, purescript
- Language: PureScript
- Size: 31.3 KB
- Stars: 8
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# purescript-monad-control
[![Build Status](https://travis-ci.org/athanclark/purescript-monad-control.svg?branch=master)](https://travis-ci.org/athanclark/purescript-monad-control)
[![Pursuit](https://pursuit.purescript.org/packages/purescript-monad-control/badge)](https://pursuit.purescript.org/packages/purescript-monad-control)This is a clone of Bas van Dijk and Anders Kaseorg's [monad-control](http://hackage.haskell.org/package/monad-control)
library for purescript.What is the point of this library? From what I see, monad transformers only give you a one-way valve - you can lift "up",
but "running" a transformer is specific for each one. What this library provides is a method to "going down, then coming up".
It is essentially a continuation for monad morphisms. This is extremely useful when you need to run a high-level action
in a lower one (like as `IO` or `Eff`), before lifting it back up:```haskell
async' :: (MonadBaseControl IO m) => m a -> m (Async a)
asnyc' x = do
liftBaseWith $ \runInBase ->
async $ (runInBase x :: IO a)
```