title: Migration in Haskell from stack lts-8.6 to lts-9.3
body: <p>I used the stack lts-8.6 in my Haskell project. Below is my code that is compiled correctly with lts-8.6:</p>
  
  <pre><code>type AppM = ReaderT App (ExceptT ServantErr IO) 
  
  type ServletAPI = ResourcesAPI
               :&lt;|&gt; MapTitleAPI
  
  server :: ServerT ServletAPI AppM
  server = serverResourcesAPI
      :&lt;|&gt; serverMapTitleAPI
  
  type API = ServletAPI 
        :&lt;|&gt; Raw
  
  runWebServerNibes :: App 
                    -&gt; IO ()
  runWebServerNibes app = do 
      run (app_portServer . app_serverHTTP . appSettings $ app) $ appNubes app
  
  appNubes :: App -&gt; Application
  appNubes app = serve api (readerServer app)
  
  readerServer :: App -&gt; Server API
  readerServer app = enter (readerToExcept app) server
                      :&lt;|&gt; serveDirectory (app_pathFolderStatic . app_serverHTTP . appSettings $ app)
  
  readerToExcept :: App -&gt; AppM :~&gt; ExceptT ServantErr IO
  readerToExcept app = Nat $ \x -&gt; runReaderT x app
  
  api :: Proxy API
  api = Proxy
  </code></pre>
  
  <p>For lts-9.3, I replaced <code>Nat</code> by <code>NT</code>.
  But when I use lts-9.3, I get an error:</p>
  
  <pre><code> • Couldn't match type ‘ImportWSN.Handler’
                       with ‘ExceptT ServantErr IO’
          arising from a functional dependency between:
            constraint ‘Servant.Utils.Enter.Enter
                          (ReaderT App IO Data.Text.Internal.Text)
                          (ReaderT App IO)
                          (ExceptT ServantErr IO)
                          (ImportWSN.Handler Data.Text.Internal.Text)’
              arising from a use of ‘enter’
            instance ‘Servant.Utils.Enter.Enter (m a) m n (n a)’
              at &lt;no location info&gt;
      • In the first argument of ‘(:&lt;|&gt;)’, namely
          ‘enter (readerToExcept app) server’
        In the expression:
          enter (readerToExcept app) server
          :&lt;|&gt;
            serveDirectory
              (app_pathFolderStatic . app_serverHTTP . appSettings $ app)
        In an equation for ‘readerServer’:
            readerServer app
              = enter (readerToExcept app) server
                :&lt;|&gt;
                  serveDirectory
                    (app_pathFolderStatic . app_serverHTTP . appSettings $ app)
  </code></pre>
  
  <p>and</p>
  
  <pre><code> • Couldn't match type ‘IO’ with ‘ExceptT ServantErr IO’
        Expected type: ReaderT App (ExceptT ServantErr IO) x
          Actual type: AppM x
      • In the first argument of ‘runReaderT’, namely ‘x’
        In the expression: runReaderT x app
        In the second argument of ‘($)’, namely ‘\ x -&gt; runReaderT x app’
  </code></pre>
  
  <p>I can not understand what changes to make to my code, so that it becomes a worker!</p>