2012-08-05 66 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

相關問題