2012-08-05 28 views
3

我需要在cabal文件和/或Login.hs中更改哪些内容? 请注意,此包中的其他.hs文件需要不同的导管版本。如何使用同一包的两个版本?

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

[email protected]:~/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> 
+1

你能在代码转换为所有使用'HTTP-conduit'相同版本的? – huon 2012-08-05 19:22:45

+1

运行'ghc-pkg check',由于两个管道版本的不同,可能会有一些破损的包。无论如何,如果甚至可以根据同一个包的多个版本来构建一个包,那么这样做是非常不理想的,您应该针对相同的管道版本构建所有的依赖关系。 – 2012-08-05 19:35:59

+0

'ghc-pkg check'只给了我这个东西的分配'警告:haddock-interfaces:/home/gert/.cabal/share/doc/happstack-lite-7.2.0/html/happstack-lite.haddock doesn'不存在或不是文件' – 2012-08-05 20:00:49

回答

1

你可以指定你的阴谋文件版本,并使用阴谋-dev的ghci的(如果你使用阴谋-DEV)。

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

$ git clone https://github.com/snoyberg/fb.git 
$ cd fb 
$ cabal install fb.cabal 
+0

但仍然只允许一个http-conduit版本在同一个包中? – 2012-08-05 19:52:11

+0

是的,它将是cabal-dev环境中的一个版本。 – 2012-08-05 20:03:08

+0

我需要两个在同一个包中,happstack-server使用1.5和fb 1.4? – 2012-08-05 20:06:59

相关问题