How to unify these types?
<p>I have the following code from purescript-express (but the question is more general).</p>

<pre><code>setHandler :: forall e. Handler e
setHandler = do
    idParam   &lt;- getRouteParam "id"
    send "Yeah! "

appSetup :: forall e. App e
appSetup = do
    get "/set/:id" setHandler
</code></pre>

<p><code>setHandler</code> needs to have the given signature as <code>get</code> is defined as</p>

<pre><code>&gt; :t get
forall e r.
(RoutePattern r) =&gt; r
                    -&gt; HandlerM ( express :: EXPRESS | e ) Unit
                    -&gt; AppM ( express :: EXPRESS | e ) Unit
</code></pre>

<p>Now however I want to use the following function within <code>setHandler</code></p>

<pre><code>getPointsSet :: forall f. String -&gt; Aff ( fs :: FS | f ) Foobar
</code></pre>

<p>which will give me the following compiler error</p>

<pre><code>[1/1 TypesDoNotUnify] src/Main.purs:31:5

          v
  31      send "Yeah! "
          ^

  Could not match type

    HandlerM

  with type

    Aff

  while trying to match type HandlerM
                               ( express :: EXPRESS
                               | _2
                               )
    with type Aff
                ( fs :: FS
                | _0
                )
  while checking that expression send "Yeah! "
    has type Aff
               ( fs :: FS
               | _0
               )
               _1
  in value declaration setHandler
</code></pre>

<p>I understand that using <code>getPointsSet</code> effectively requires setHandler to become a <code>Aff</code> as well but than I cannot wire it up with the <code>get</code> then.</p>

<p><strong>Edit</strong></p>

<p>If I try to add a <code>liftAff</code> as suggested in the answer below </p>

<pre><code>setHandler :: forall e. Handler e
setHandler = do
    idParam   &lt;- getRouteParam "id"
    liftAff $ getPointsSet "../some-data.csv"
    send "Yeah! "
</code></pre>

<p>I get the following error</p>

<pre><code>[1/1 NoInstanceFound] src/Main.purs:28:1
   28  setHandler :: forall e. Handler e
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   No type class instance was found for
   Control.Monad.Aff.Class.MonadAff ( fs :: FS | _0 )
                                 (HandlerM ( express :: EXPRESS | e0 ))

The instance head contains unknown type variables. Consider adding a type annotation.
in value declaration setHandler
</code></pre>

<p>What do I need to do to resolve that?</p>