Skip to content

Commit 36dae7b

Browse files
CarstenKoenigchexxor
authored andcommitted
use Effect instead of Eff? (documentationjs#189)
I guess it's better to just mention Effect instead of Eff, even if it does not provide the same granularity?
1 parent 2ae4723 commit 36dae7b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

language/Differences-from-Haskell.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,20 @@ PureScript does not provide syntactic sugar for list types. Construct list types
6262

6363
There is also an `Array` type for native JavaScript arrays, but this does not have the same performance characteristics as `List`. `Array` _values_ can be constructed with `[x, y, z]` literals, but the type still needs to be annotated as `Array a`.
6464

65-
## `IO` vs `Eff`
65+
## `IO` vs `Effect`
6666

67-
Haskell uses the `IO` monad to deal with side effects. In PureScript, there is a monad called `Eff` that serves the same purpose but can track side effects with more granularity. For example, in a Haskell program the type signature of `main` will be:
67+
Haskell uses the `IO` monad to deal with side effects. In PureScript, there is a similar monad called `Effect` that serves the same purpose. For example, in a Haskell program the type signature of `main` will be:
6868

6969
``` haskell
7070
main :: IO ()
7171
```
7272

73-
This doesn't tell us much specifically about what `main` might do. In PureScript the type may be something like this:
73+
In PureScript you would write it like this:
7474

7575
``` purescript
76-
main :: forall e. Eff (fs :: FS, trace :: Trace, process :: Process | e) Unit
76+
main :: Effect Unit
7777
```
7878

79-
Now we can see from the type that `main` uses the file system, traces messages to the console, and does something to the current process.
80-
81-
For more details about using Eff, how it works, and how to define your own side effects, [see this post](../guides/Eff.md).
82-
8379
## Records
8480

8581
PureScript can encode JavaScript-style objects directly by using row types, so Haskell-style record definitions actually have quite a different meaning in PureScript:

0 commit comments

Comments
 (0)