anchor.diff:  
   === Chain computations
   
  -Here's how you use that promise:
  -
  -[source, clojure]
  -----
  -(-> (p/promise 1)
  -    (p/then (fn [v] (inc v)))
  -----
  -
  -The `then` function takes one argument: a callback that will be called when the promise
  -is successfully resolved.
  -
  -But `then` is not the end, it also returns a promise that will be resolved or rejected
  -depending on return value of the first chain callback. That will allow you to compose
  -async computations in an easy way.
  -
  -[source, clojure]
  -----
  -(-> (p/promise 1)
  -    (p/then (fn [v] (inc v)))
  -    (p/then (fn [v] (* v 2))))
  -----
  +It there different ways to compose/chain computations using promises. We will start
  +with the basic: lineal way of chaining computations.
  +
  +That can be done using `then` or `chain` functions exposed in `promissum.core`
  +namespace. Bot them are mainly interchangeable. The main differencia is that
  +`chain` is variadic and `then` not.
  +
  +[source, clojure]
  +----
  +(def pr (-> (p/promise 2)
  +            (p/then inc)
  +            (p/then inc)))
  +
  +(p/then pr (fn [v]
  +             (println v)))
  +;; => Stdout: 4
  +----
  +
  +And here the same example using the `chain` function instead of `then`:
  +
  +[source, clojure]
  +----
  +(def pr (p/chain (p/promise 2) inc inc))
  +
  +(p/then pr (fn [v]
  +             (println v)))
  +;; => Stdout: 4
  +----
  +
  +Later, thanks to the link:https://github.com/funcool/cats[cats] library, it there
  +other few methods of create promise compositions in more powerfull way: `mlet`
  +and `alet` macros.
  +
  +For demostration purposes, imagine you have this function that emulates async
  +operation and return a promise:
  +
  +[source, clojure]
  +----
  +(require '[cats.core :as m])
  +(require '[promissum.core :as p])
  +
  +(defn sleep-promise
  +  [wait]
  +  (p/promise (fn [deliver]
  +               (js/setTimeout #(deliver wait) wait))))
  +----
  +
  +Now, we will try to use this function together with `mlet` macro and additionally
  +messure the execution time:
  +
  +[source, clojure]
  +----
  +(def pr
  +  (m/mlet [x (sleep-promise 42)
  +           y (sleep-promise 41)]
  +    (+ x y)))
  +
  +(p/then pr (fn [v]
  +             (println v)))
  +
  +;; This will take aprox: 83-85 msecs
  +;; => Stdout: 83
  +----
  +
  +The `mlet` bindings are executed sequentially, waiting in each step for promise
  +resolution. If an error occurs in some step, the entire composition will be
  +short-circuited, returing exceptionally resolved promise. This is very similar
  +to the up coming link:http://jakearchibald.com/2014/es7-async-functions/[ES7 async/await], but built in a generic way and as a library and not language feature.
  +
  +The main disadvantage of `mlet` is that it's evaluation model is strictly
  +secuential. It is ok for some use cases, when the sequential order is mandatory.
  +But, if the strictly secuential model is not mandatory, `mlet` does not take
  +the advantage of concurrency.
  +
  +For solve this problem, it there `alet` macro. It is almost identical to `mlet`
  +from the user experience but internally it is based in very different abstractions.
  +
  +Now, we will try to do the same example but using the `alet` macro:
  +
  +[source, clojure]
  +----
  +(def pr
  +  (m/alet [x (sleep-promise 42)
  +           y (sleep-promise 41)]
  +    (+ x y)))
  +
  +(p/then pr (fn [v]
  +             (println v)))
  +
  +;; This will take aprox: 41-45 msecs
  +;; => Stdout: 83
  +----
  +
  +We can observe that it returns the same result as in previous example,
  +but takes almost the half of time to finish execute all the computations. This
  +is happens because `alet` is more smarter macro and calculates de dependencies
  +between declared bindings and executes them in batches.
  +
  +You can read more about that link:http://funcool.github.io/cats/latest/#syntax-sugar[here].
   
   
   === Error handling
   
  -Until now, we have seen resolved promises, but what happens when an error occurs?
  +One of the advantages of using promise abstraction is that it natively has
  +a notion of error, so you don't need reinvent it. If some of the computations
  +of the composed promise chain/pipeline raises an exception, that one is
  +automatically propagated to the last promise making the effect of short-circuiting.
  +
  +Let see an example:
   
   [source, clojure]
   ----
  
positive.code: ;; => #<Promise [1]>
  ----
  
  If a `promise` function receives a plain value, it returns a resolved promise with the
  provided plain value. If it receives an instance of `Error`, it returns a rejected
  promise.
  
  And finally it also accepts a factory callback that receives two callable parameters:
  `resolve` and `reject`. So you can use one or other to resolve or reject the promise
  
negative.code: ----
  
  
  Later, for more advanced use cases, _promesa_ is an algebraic structure that
  implements the associative binary operation usually called `mappend`:
  
  [source, clojure]
  ----
  (require '[cats.core :as m])
  
  (def pr (m/mappend (p/promise {:a 1})
                     (p/promise {:b 2})))
  (p/then pr (fn [v]
               (println v)))
  
  ;; => Stdout: {:a 1 :b 2}
  ----
  
  
  === Delays and timeouts.
  
  JavaScript due its nature, does not allow you to block or sleep. But with promises
  you can emulate the functionality using `delay` like so:
  
  [source, clojure]
  ----
  (-> (p/delay 1000 "foobar")
      (p/then (fn [v]
                (.log js/console "Received:" v))))
  
  ;; After 1 second it will print the message
  ;; to the console: "Received: foobar"
  ----
  
  The promise library offers the ability to add a timeout to async operations thanks
  to the `timeout` function:
  
  [source, clojure]
  ----
  (-> (some-async-task)
      (p/timeout 200)
      (p/then #(.log js/console "Task finished"))
      (p/catch #(.log js/console "Timeout")))
  ----
  
  In case the async task is slow, in the example more that 200ms, the promise will be
  rejected with timeout error and successfully captured with the `catch` handler.
  
  
  === Sugar syntax
  
  Promises are one of the most used primitives for the composition of async functions.
  However, using promises _as is_ doesn't save you from callback hell.
  
  
  Let's see how we cam use similar syntactic sugar in ClojureScript:
  
  