You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+16-5Lines changed: 16 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -79,20 +79,19 @@ do response <- ajaxGet' req
79
79
liftEff $ trace response.body
80
80
```
81
81
82
-
## Converting from Eff
82
+
## Eff
83
83
84
-
All purely synchronous computations (`Eff`) can be converted to `Aff` computations with `liftEff` defined in `Control.Monad.Eff.Class` (see [here](https://github.com/paf31/purescript-monad-eff)).
84
+
All purely synchronous computations (`Eff`) can be lifted to asynchronous computations with `liftEff` defined in `Control.Monad.Eff.Class` (see [here](https://github.com/paf31/purescript-monad-eff)).
85
85
86
86
```purescript
87
87
import Control.Monad.Eff.Class
88
88
89
89
liftEff $ trace "Hello world!"
90
90
```
91
91
92
-
This lets you write your whole program in `Aff`, and still call out to synchronous `Eff`code.
92
+
This lets you write your whole program in `Aff`, and still call out to synchronous code.
93
93
94
-
If your `Eff` code throws exceptions (`err :: Exception`), you can remove the exceptions using `liftEff'`
95
-
to bring the exception to the value level as an `Either Error a`:
94
+
If your `Eff` code throws exceptions (`err :: Exception`), you can remove the exceptions using `liftEff'`, which brings exceptions to the value level as an `Either Error a`:
96
95
97
96
```purescript
98
97
do e <- liftEff' myExcFunc
@@ -140,6 +139,18 @@ do resp <- (Ajax.get "http://foo.com") `catchError` (\e -> pure defaultResponse)
140
139
141
140
Thrown exceptions are propagated on the error channel, and can be recovered from using `attempt` or `catchError`.
142
141
142
+
## Variables
143
+
144
+
The `Control.Monad.Aff.Var` module contains asynchronous variables. These can
145
+
be used as low-level building blocks for asynchronous programs.
0 commit comments