3

我需要在 cabal 文件和或 Login.hs 中更改什么?请注意,此包中的其他 .hs 文件需要不同的管道版本。

(源https://github.com/gertcuykens/haskell-design

gert@couchdb:~/Downloads/haskell-design/src$ ghci Chat.hs 
GHCi, version 7.4.2: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
[1 of 2] Compiling Login            ( Login.hs, interpreted )

Login.hs:27:9:
    No instance for (Control.Monad.Trans.Control.MonadBaseControl
                       IO m0)
      arising from a use of `withManager'
    Possible fix:
      add an instance declaration for
      (Control.Monad.Trans.Control.MonadBaseControl IO m0)
    In the expression: withManager
    In the expression:
      withManager
      $ \ manager
          -> FB.runFacebookT app manager
             $ FB.getUserAccessTokenStep1 url perms
    In an equation for `fbUrl':
        fbUrl
          = withManager
            $ \ manager
                -> FB.runFacebookT app manager
                   $ FB.getUserAccessTokenStep1 url perms

Login.hs:27:55:
    Couldn't match expected type `http-conduit-1.4.1.8:Network.HTTP.Conduit.Manager.Manager'
                with actual type `http-conduit-1.5.0.3:Network.HTTP.Conduit.Manager.Manager'
    In the second argument of `FB.runFacebookT', namely `manager'
    In the expression: FB.runFacebookT app manager
    In the expression:
      FB.runFacebookT app manager $ FB.getUserAccessTokenStep1 url perms

Login.hs:31:13:
    No instance for (Control.Monad.Trans.Control.MonadBaseControl
                       IO m1)
      arising from a use of `withManager'
    Possible fix:
      add an instance declaration for
      (Control.Monad.Trans.Control.MonadBaseControl IO m1)
    In the expression: withManager
    In the expression:
      withManager
      $ \ manager
          -> FB.runFacebookT app manager
             $ do { t <- FB.getUserAccessTokenStep2 url [...];
                    u <- FB.getUser "me" [] (Just t);
                    .... }
    In an equation for `fbEmail':
        fbEmail c
          = withManager
            $ \ manager
                -> FB.runFacebookT app manager
                   $ do { t <- FB.getUserAccessTokenStep2 url ...;
                          .... }

Login.hs:31:59:
    Couldn't match expected type `http-conduit-1.4.1.8:Network.HTTP.Conduit.Manager.Manager'
                with actual type `http-conduit-1.5.0.3:Network.HTTP.Conduit.Manager.Manager'
    In the second argument of `FB.runFacebookT', namely `manager'
    In the expression: FB.runFacebookT app manager
    In the expression:
      FB.runFacebookT app manager
      $ do { t <- FB.getUserAccessTokenStep2 url [c];
             u <- FB.getUser "me" [] (Just t);
             return $ FB.userEmail u }

Login.hs:37:12:
    No instance for (Control.Monad.Trans.Control.MonadBaseControl
                       IO m2)
      arising from a use of `withManager'
    Possible fix:
      add an instance declaration for
      (Control.Monad.Trans.Control.MonadBaseControl IO m2)
    In the expression: withManager
    In the expression:
      withManager
      $ \ manager
          -> FB.runFacebookT app manager
             $ do { t <- FB.getUserAccessTokenStep2 url [...];
                    u <- FB.getUser "me" [] (Just t);
                    .... }
    In an equation for `fbName':
        fbName c
          = withManager
            $ \ manager
                -> FB.runFacebookT app manager
                   $ do { t <- FB.getUserAccessTokenStep2 url ...;
                          .... }

Login.hs:37:58:
    Couldn't match expected type `http-conduit-1.4.1.8:Network.HTTP.Conduit.Manager.Manager'
                with actual type `http-conduit-1.5.0.3:Network.HTTP.Conduit.Manager.Manager'
    In the second argument of `FB.runFacebookT', namely `manager'
    In the expression: FB.runFacebookT app manager
    In the expression:
      FB.runFacebookT app manager
      $ do { t <- FB.getUserAccessTokenStep2 url [c];
             u <- FB.getUser "me" [] (Just t);
             return $ FB.userName u }
Failed, modules loaded: none.
Prelude> 
4

1 回答 1

1

您可以在您的 cabal 文件中指定版本并使用 cabal-dev ghci(如果您使用 cabal-dev)。

而且你不能使用同一个包的两个版本,但在你的情况下,你可以fb从 github 使用:

$ git clone https://github.com/snoyberg/fb.git
$ cd fb
$ cabal install fb.cabal
于 2012-08-05T19:36:09.433 回答