@@ -11,7 +11,7 @@ The moral equivalent of `ErrorT (ContT Unit (Eff e) a`, for effects `e`.
1111``` purescript
1212main = launchAff $
1313 do response <- Ajax.get "http://foo.bar"
14- liftEff $ trace response.body
14+ liftEff $ log response.body
1515```
1616
1717See the [ examples directory] ( /examples/src/Examples.purs ) for more examples.
@@ -78,7 +78,7 @@ This eliminates callback hell and allows us to write code simply using `do` nota
7878
7979``` purescript
8080do response <- ajaxGet' req
81- liftEff $ trace response.body
81+ liftEff $ log response.body
8282```
8383
8484## Eff
@@ -88,7 +88,7 @@ All purely synchronous computations (`Eff`) can be lifted to asynchronous comput
8888``` purescript
8989import Control.Monad.Eff.Class
9090
91- liftEff $ trace "Hello world!"
91+ liftEff $ log "Hello world!"
9292```
9393
9494This lets you write your whole program in ` Aff ` , and still call out to synchronous code.
@@ -97,7 +97,7 @@ If your `Eff` code throws exceptions (`err :: Exception`), you can remove the ex
9797
9898``` purescript
9999do e <- liftEff' myExcFunc
100- liftEff $ either (const $ trace "Oh noes!") (const $ trace "Yays!") e
100+ liftEff $ either (const $ log "Oh noes!") (const $ log "Yays!") e
101101```
102102
103103## Dealing with Failure
@@ -122,7 +122,7 @@ This returns an `Either Error a` that you can use to recover from failure.
122122
123123``` purescript
124124do e <- attempt $ Ajax.get "http://foo.com"
125- liftEff $ either (const $ trace "Oh noes!") (const $ trace "Yays!") e
125+ liftEff $ either (const $ log "Oh noes!") (const $ log "Yays!") e
126126```
127127
128128#### 2. Alt
@@ -168,7 +168,7 @@ using the returned canceler:
168168``` purescript
169169canceler <- forkAff myAff
170170canceled <- canceler `cancel` (error "Just had to cancel")
171- _ <- liftEff $ if canceled then (trace "Canceled") else (trace "Not Canceled")
171+ _ <- liftEff $ if canceled then (log "Canceled") else (log "Not Canceled")
172172```
173173
174174If you want to run a custom canceler if some other asynchronous computation is
@@ -186,7 +186,7 @@ The `Control.Monad.Aff.AVar` module contains asynchronous variables, which are v
186186do v <- makeVar
187187 forkAff (later $ putVar v 1.0)
188188 a <- takeVar v
189- liftEff $ trace ("Succeeded with " ++ show a)
189+ liftEff $ log ("Succeeded with " ++ show a)
190190```
191191
192192You can use these constructs as one-sided blocking queues, which suspend (if
@@ -212,4 +212,9 @@ A parallel computation can be canceled if both of its individual components can
212212
213213# API Docs
214214
215- [ MODULES.md] ( MODULES.md )
215+ * [ Control.Monad.Aff] ( docs/Control.Monad.Aff.md )
216+ * [ Control.Monad.Aff.AVar] ( docs/Control.Monad.Aff.AVar.md )
217+ * [ Control.Monad.Aff.Console] ( docs/Control.Monad.Aff.Console.md )
218+ * [ Control.Monad.Aff.Class] ( docs/Control.Monad.Aff.Class.md )
219+ * [ Control.Monad.Aff.Par] ( docs/Control.Monad.Aff.Par.md )
220+ * [ Control.Monad.Aff.Unsafe] ( docs/Control.Monad.Aff.Unsafe.md )
0 commit comments