18:30:11 <hpaste> pooya72 pasted “HDBC happstack” at http://hpaste.org/70228
18:30:40 <pooya72> noob here. I'm a bit confused on how to use HDBC with Happstack. how would i get the title of this query to show in happstack? http://hpaste.org/70228 I'm having trouble with the types.
18:31:16 <stepcut> pooya72: you probably need liftIO to turn the IO stuff into a ServerPart ?
18:31:31 <stepcut> wel.. you do have a liftIO
18:31:32 <pooya72> I think so. Just so that I can show it in the html
18:31:50 <stepcut> but.. if you don't have any happstack or html in that example, so I am not sure where your problem is
18:32:29 <stepcut> also, you have a liftIO for handleSqlError, but not connectPostgresSQL, which makes me suspicious
18:32:40 <stepcut> what type should the postByIdSql function have?
18:32:42 <hpaste> pooya72 pasted “sample” at http://hpaste.org/70231
18:33:06 <stepcut> where does user1 come from ?
18:33:37 <stepcut> what you want to call postByIdSql in homePage ?
18:33:58 <pooya72> sorry, user1 was just manually entered data. I made it up as a test.
18:34:28 <pooya72> so I want to call postByIdSql by id "31" then have ha
18:34:39 <pooya72> have the title be called on the BlogPost data type
18:35:06 <stepcut> do post <- liftIO $ postByIdSql someId
18:35:17 <stepcut>     ok $ template (title post) $ do ...
18:43:51 <pooya72> stepcut: awesome bro, that liftIO did it. what does liftIO do here?
18:53:14 <stepcut> turns IO things into ServerPart things
18:53:36 <stepcut> that's pretty much all liftIO ever does
18:53:47 <stepcut> though it can work for anything that has a MonadIO instance, not just ServerPart
18:57:07 <pooya72> i c. cause i thought <- would get rid of the IO ness... liftIO turns it into the appropriate encompassing IO?
19:09:37 <stepcut> pooya72: not quite.. <- is used to chain a bunch of monadic values of the same type together
19:09:44 <stepcut> like a bunch of IO things or ServerPart things
19:09:57 <pooya72> ok i c. thanks
19:10:09 <stepcut> if you want to change an IO and ServerPart thing together then you have to convert one of them into the other
19:10:50 <stepcut> in this case, it makes more sense to turn the IO into a ServerPart thing, since ServerPart starts with IO and then adds more things around it
19:11:29 <stepcut> making lunch, bbiab.
19:13:52 <pooya72> yeah
23:52:04 <stepcut> I'll be out of town until sunday evening
23:52:07 <stepcut> leaving tomorrow morning