Skip to content
This repository has been archived by the owner on Jan 17, 2020. It is now read-only.

Commit

Permalink
add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
jdegoes committed Aug 11, 2016
1 parent 72e082e commit 9566a22
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
/output/
/.psci*
/src/.webpack.js
/test/
17 changes: 17 additions & 0 deletions .travis.yml
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
47 changes: 47 additions & 0 deletions README.md
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!
9 changes: 0 additions & 9 deletions src/Main.purs

This file was deleted.

0 comments on commit 9566a22

Please sign in to comment.