I’m trying a simple telegram-api example:
module Main where
import Network.HTTP.Client (newManager)
import Network.HTTP.Client.TLS (tlsManagerSettings)
import Web.Telegram.API.Bot
main :: IO ()
main = do
manager <- newManager tlsManagerSettings
res <- getMe token manager
case res of
Left e -> do
putStrLn "Request failed"
print e
Right Response { result = u } -> do
putStrLn "Request succeded"
print $ user_first_name u
where token = Token "bot8333589:AAdsgsgsfgsgsgddsgsgdh"
but I get
Preprocessing executable ‘telegram-tests’ for telegram-tests-0.1.0.0…
[1 of 1] Compiling Main ( Main.hs, dist/build/telegram-tests/telegram-tests-tmp/Main.o )
Main.hs:18:23: error:
* Couldn’t match expected type text-1.2.4.0:Data.Text.Internal.Text' with actual type
[Char]’
* In the first argument of Token', namely
“bot8333589:AAdsgsgsfgsgsgddsgsgdh”’
I don’t get why this happens since it’s a simple text, it should be understood as [Char]
. It’s how its done in the example