Hi Tom,
I played a bit with your suggestion, and it is running now :-)
But instead of IO [Int] I think we need IO [Only Int] because of
the 1-element-tupel problem?
With IO [Only Int] it looks like this:
On Sun, Aug 18, 2013 at 10:16:06PM +0200, Hartmut Pfarr wrote:
I played a bit with your suggestion, and it is running now :-)
But instead of IO [Int] I think we need IO [Only Int] because
of the 1-element-tupel problem?
Yes you're right. I had forgotten that postgresql-simple dealt with
On Sat, Aug 17, 2013 at 1:35 PM, Hartmut Pfarr
hartmut0...@googlemail.comwrote:
(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
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
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
On Sat, Aug 17, 2013 at 5:59 PM, Hartmut Pfarr
hartmut0...@googlemail.comwrote:
query_ conn select 2 + 2
I've no errors any more.
But: I don't see any result (for sure, it is not coeded yet)
Yes, because you're not capturing it; it's the return value from `query_`,
which you are throwing
... thx all for helping. Now the coding works: it puts the following out.
Kind regards
Hartmut
*Main main
Only {fromOnly = 4}
--
Only {fromOnly = 101}
Only {fromOnly = 102}
Only {fromOnly = 103}
--
blub 101 51
blub 102 52
blub 103 53
The