title: Chain fp-ts TaskEither with Either in right
body: <p>I have a flow of 2 nested request, where could be 3 different results:</p>
  
  <ol>
  <li>One of requests return Error</li>
  <li>User is not Anonymous, return Profile</li>
  <li>User is Anonymous, return false</li>
  </ol>
  
  <p>Both requests could throw an error, and becaues of that implements <code>TaskEither</code></p>
  
  <pre><code>const isAuth = ():TE.TaskEither&lt;Error, E.Either&lt;true, false&gt;&gt;  
     =&gt; TE.tryCatch(() =&gt; Promise(...), E.toError)
  const getProfile = ():TE.TaskEither&lt;Error, Profile&gt;  
     =&gt; TE.tryCatch(() =&gt; Promise(...), E.toError)
  </code></pre>
  
  <p>The first request returns the boolean status of user authorization. Second request loads user profile <strong>if the user is authorized</strong>.</p>
  
  <p>In return, I want to get the next signature, Error or Either with Anonymous/Profile:</p>
  
  <pre><code>E.Either&lt;Error, E.Either&lt;false, Profile&gt;&gt;
  </code></pre>
  
  <p>I tried to make it this way:</p>
  
  <pre><code>pipe(
      isAuth()
      TE.chain(item =&gt; pipe(
        TE.fromEither(item),
        TE.mapLeft(() =&gt; Error('Anonimous')),
        TE.chain(getProfile)
      ))
    )
  </code></pre>
  
  <p>But in return, I get <code>E.Either&lt;Error, Profile&gt;</code>, witch not convenient because I have to extract <code>Anonymous</code> status by hands from <code>Error</code>.</p>
  
  <p>How to solve that question?</p>