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

Commit 9566a22

Browse files
committed
add readme
1 parent 72e082e commit 9566a22

File tree

4 files changed

+65
-9
lines changed

4 files changed

+65
-9
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44
/output/
55
/.psci*
66
/src/.webpack.js
7+
/test/

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: node_js
2+
dist: trusty
3+
sudo: required
4+
node_js: 6
5+
install:
6+
- npm install -g bower
7+
- npm install
8+
script:
9+
- bower install --production
10+
- npm run -s build
11+
- bower install
12+
- npm -s test
13+
after_success:
14+
- >-
15+
test $TRAVIS_TAG &&
16+
echo $GITHUB_TOKEN | pulp login &&
17+
echo y | pulp publish --no-push

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# purescript-io
2+
3+
An IO monad for PureScript.
4+
5+
Don't ask. Don't tell. Joyfully use in secrecy.
6+
7+
# Introduction
8+
9+
PureScript's effect system is based on row types, and has no semantic or
10+
algebraic basis. Often, the effect labels have poorly-defined meanings, and
11+
different libraries use completely different labels to represent the same or
12+
overlapping effects.
13+
14+
While the effect system is undoubtedly useful, there are cases where it's more
15+
of a hindrance — where it doesn't make reasoning about code easier, but instead,
16+
merely adds a ton of boilerplate and semantically meaningless labels get
17+
threaded through endless stacks of functions.
18+
19+
In those cases, `IO` is here to the rescue!
20+
21+
`IO a` represents a computation that may be synchronous or asynchronous, and
22+
which will either yield a value of type `a`, run forever, or halt with a
23+
catchable exception.
24+
25+
Under the covers, `IO` is based on `Aff`, and there is no wrapper so there is
26+
no runtime overhead or performance penalty for `IO`.
27+
28+
# Usage
29+
30+
`IO` only has one function, which should only be used in your `main`:
31+
32+
```haskell
33+
runIO :: forall a. IO a -> AffIO a
34+
```
35+
36+
This converts an `IO` into an `Aff`, which you can then "convert" into a
37+
runnable `Eff` using `launchAff` or `runAff`.
38+
39+
The effect row is closed, which is intentionally because `INFINITY` represents
40+
all possible effects. This will help ensure you only call `runIO` at the top
41+
level of your program.
42+
43+
Besides this, `IO` has almost all the same instances as `Aff`, and may be used
44+
in the same way. In addition, a new `MonadIO` class has been introduced which
45+
allows you to lift `IO` computations into other monads that are as powerful.
46+
47+
Happy nuke launching!

src/Main.purs

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)