[Haskell-cafe] Database.postgreSQL.Simple - ambigious type

Hartmut Pfarr hartmut0407 at googlemail.com
Sat Aug 17 23:59:24 CEST 2013


Thx, I changed now from query to query_
Now the coding is like that:

------------------------------------------------------------------------
{-# 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"

main = return ()
------------------------------------------------------------------------

I've no errors any more.
But: I don't see any result (for sure, it is not coeded yet)

I need some help to get data from "hello" via "FromRow" into the main 
function.

E.g. I want to put the "hello" database result (the number "4") to the 
screen.

Could anybody give an advice how I can accomplish this?

Kind regards
Hartmut


On 08/17/2013 07:53 PM, Brandon Allbery wrote:
> On Sat, Aug 17, 2013 at 1:35 PM, Hartmut Pfarr
> <hartmut0407 at googlemail.com <mailto:hartmut0407 at googlemail.com>> wrote:
>
>     (The example is identical to the first 5-liner-example in the
>     package documentation)
>
>
> As I read it, the example has a typo: it should be using `query_`
> instead of `query`. See
> http://hackage.haskell.org/packages/archive/postgresql-simple/0.3.5.0/doc/html/Database-PostgreSQL-Simple.html#g:9
> for detals.
>
> --
> brandon s allbery kf8nh                               sine nomine associates
> allbery.b at gmail.com <mailto:allbery.b at gmail.com> ballbery at sinenomine.net
> <mailto:ballbery at sinenomine.net>
> unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net





More information about the Haskell-Cafe mailing list