This repository has been archived by the owner on Jan 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
65 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
/output/ | ||
/.psci* | ||
/src/.webpack.js | ||
/test/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
language: node_js | ||
dist: trusty | ||
sudo: required | ||
node_js: 6 | ||
install: | ||
- npm install -g bower | ||
- npm install | ||
script: | ||
- bower install --production | ||
- npm run -s build | ||
- bower install | ||
- npm -s test | ||
after_success: | ||
- >- | ||
test $TRAVIS_TAG && | ||
echo $GITHUB_TOKEN | pulp login && | ||
echo y | pulp publish --no-push |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# purescript-io | ||
|
||
An IO monad for PureScript. | ||
|
||
Don't ask. Don't tell. Joyfully use in secrecy. | ||
|
||
# Introduction | ||
|
||
PureScript's effect system is based on row types, and has no semantic or | ||
algebraic basis. Often, the effect labels have poorly-defined meanings, and | ||
different libraries use completely different labels to represent the same or | ||
overlapping effects. | ||
|
||
While the effect system is undoubtedly useful, there are cases where it's more | ||
of a hindrance — where it doesn't make reasoning about code easier, but instead, | ||
merely adds a ton of boilerplate and semantically meaningless labels get | ||
threaded through endless stacks of functions. | ||
|
||
In those cases, `IO` is here to the rescue! | ||
|
||
`IO a` represents a computation that may be synchronous or asynchronous, and | ||
which will either yield a value of type `a`, run forever, or halt with a | ||
catchable exception. | ||
|
||
Under the covers, `IO` is based on `Aff`, and there is no wrapper so there is | ||
no runtime overhead or performance penalty for `IO`. | ||
|
||
# Usage | ||
|
||
`IO` only has one function, which should only be used in your `main`: | ||
|
||
```haskell | ||
runIO :: forall a. IO a -> AffIO a | ||
``` | ||
|
||
This converts an `IO` into an `Aff`, which you can then "convert" into a | ||
runnable `Eff` using `launchAff` or `runAff`. | ||
|
||
The effect row is closed, which is intentionally because `INFINITY` represents | ||
all possible effects. This will help ensure you only call `runIO` at the top | ||
level of your program. | ||
|
||
Besides this, `IO` has almost all the same instances as `Aff`, and may be used | ||
in the same way. In addition, a new `MonadIO` class has been introduced which | ||
allows you to lift `IO` computations into other monads that are as powerful. | ||
|
||
Happy nuke launching! |
This file was deleted.
Oops, something went wrong.