title: How to use the Task monad? (fp-ts)
body: <pre class="lang-js prettyprint-override"><code>import * as T from 'fp-ts/lib/Task'
  import { pipe, flow } from 'fp-ts/lib/function'
  
  const getHello: T.Task&lt;string&gt; = () =&gt; new Promise((resolve) =&gt; {
    resolve('hello')
  })
  </code></pre>
  <p>I understand the purpose of <code>Task</code> and why is it important. The thing is that I don't know how to use it properly or compose with it, really.</p>
  <p>If I just call <code>getHello()</code>, it will give me <code>Promise&lt;pending&gt;</code>:</p>
  <pre class="lang-js prettyprint-override"><code>console.log(getHello()) // returns Promise&lt;pending&gt;
  </code></pre>
  <p>if I do this, however:</p>
  <pre class="lang-js prettyprint-override"><code>const run = async () =&gt; {
    const hello = await getHello()
    console.log(hello) // prints 'hello'
  }
  </code></pre>
  <p>it works.</p>
  <p>but this:</p>
  <pre><code>const waitAndGet = async () =&gt; {
    return await getHello()
  }
  
  console.log(waitAndGet()) // prints Promise&lt;pending&gt;
  </code></pre>
  <p>doesn't.</p>
  <p>Moreover, how would I be able to compose with it? Like so:</p>
  <pre class="lang-js prettyprint-override"><code>const getHelloAndAddWorld = flow(
    getHello(),
    addAtEnd('world')
  )
  </code></pre>