[Haskell-cafe] Database.postgreSQL.Simple - ambigious type
Tom Ellis
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Sun Aug 18 00:11:10 CEST 2013
On Sat, Aug 17, 2013 at 11:59:24PM +0200, Hartmut Pfarr wrote:
> {-# LANGUAGE OverloadedStrings #-}
>
> import Database.PostgreSQL.Simple
> import Database.PostgreSQL.Simple.FromRow
>
> hello :: (FromRow a) => IO [a]
> hello = do
> conn <- connect defaultConnectInfo
> query_ conn "select 2 + 2"
Either
main = print =<< (hello :: IO [Int])
or give hello a monomorphic type signature, such as
hello :: IO [Int]
Tom
More information about the Haskell-Cafe
mailing list