Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- haskell model export error [closed]
- {-# LANGUAGE OverloadedStrings, NoMonomorphismRestriction #-}
- module Login (
- fbUrl,
- fbEmail
- ) where
- import qualified Facebook as FB
- import Network.HTTP.Conduit (withManager)
- import Data.Text
- import Data.ByteString.Internal (ByteString)
- app :: FB.Credentials
- app = FB.Credentials "localhost" "249348058430770" "..."
- url :: FB.RedirectUrl
- url = "http://localhost/fb"
- perms :: [FB.Permission]
- perms = ["user_about_me", "email"]
- fbUrl = FB.getUserAccessTokenStep1 url perms
- fbEmail c = withManager $ manager -> FB.runFacebookT app manager $ do
- t <- FB.getUserAccessTokenStep2 url [c]
- u <- FB.getUser "me" [] (Just t)
- return $ FB.userEmail u
- module Main (
- main
- ) where
- import Login
- import System.IO
- main :: IO ()
- main = do
- u <- fbUrl
- print u
- a <- readLn
- e <- fbEmail a
- print e
- src/Main.hs:11:10:
- Couldn't match expected type `IO t0'
- with actual type `fb-0.9.6:Facebook.Monad.FacebookT
- fb-0.9.6:Facebook.Monad.Auth m0 Data.Text.Internal.Text'
- In a stmt of a 'do' block: u <- fbUrl
- In the expression:
- do { u <- fbUrl;
- print u;
- a <- readLn;
- e <- fbEmail a;
- .... }
- In an equation for `main':
- main
- = do { u <- fbUrl;
- print u;
- a <- readLn;
- .... }
Advertisement
Add Comment
Please, Sign In to add comment