Experimental IRC log happs-2008-02-20

Available formats: content-negotiated html turtle (see SIOC for the vocabulary)

Back to channel and daily index: content-negotiated html turtle

These logs are provided as an experiment in indexing discussions using IRCHub.py, Irc2RDF.hs, and SIOC.

00:33:36<mightybyte>Lemmih: Ok, I thought I might be able to get a quick answer from #haskell.
00:34:01<mightybyte>Lemmih: Give me a minute and I'll paste the problem.
00:43:14<mightybyte>http://hpaste.org/5754#a2
00:44:30<Lemmih>anyRequest $ do users <- foo; ok $ toResponse ...
00:45:20<mightybyte>Lemmih: Hmmmm, I had tried something similar without success, let me try it.
00:46:43<mightybyte>Ok, so here's my new line (just so we're on the same page)
00:46:44<mightybyte>userListPage = [anyRequest $ do u <- foo; ok $ toResponse $ "Users: " ++ (show u)]
00:46:52<Lemmih>Looks good.
00:46:59<mightybyte>And now I get "Ambiguous type variable"
00:47:13<mightybyte>"Possible cause: the monomorphism restriction applied to the following"
00:48:03<mightybyte>"userListPage :: [ServerPartT m Response] (bound at Main.hs:121:0)"
00:48:10<mightybyte>Probable fix: give these definition(s) an explicit type signature
00:48:48<mightybyte>Composing type signatures is probably where I have the hardest time.
00:49:59<Lemmih>You're giving userListPage a type?
00:50:18<mightybyte>Not right now. Only foo.
00:53:40<Lemmih>Are you using userListPage?
00:54:09<Lemmih>Huh, MonadReader ?
00:54:22<Lemmih>That's bad.
00:54:25<mightybyte>Not right now. The line that uses it is commented out.
00:54:47<mightybyte>Hmm, what's wrong with that?
00:55:14<Lemmih>You should access the state through events.
00:55:33<Lemmih>Not through a reader monad.
00:56:36<mightybyte>Which reader monad are you talking about? I thought I was using events...e.g. foo = query ListUsers
00:56:54<Lemmih>processNewUser.
00:58:04<mightybyte>Ahh, well checkAndAdd uses an event. But I was having typing problems and that's how MonadReader crept in there.
00:58:17<mightybyte>But that shouldn't be related to the userListPage problem.
00:58:50<Lemmih>It works for me. )-:
00:59:22<mightybyte>Aha, when I uncomment the 'dir "list" userListPage' line, it works.
00:59:31<Lemmih>Jolly.
00:59:37<mightybyte>Hmmmm, I guess I'm going to have to re-think my debugging strategy.
01:00:09<Lemmih>Changing the type of 'foo' to 'Web [String]' would also have worked.
01:00:19<mightybyte>I've taken to sometimes commenting out the place where a function is used while I run down errors in the function itself.
01:01:09<mightybyte>I originally didn't even use foo. It was all inline.
01:01:38<mightybyte>Typing problems with inline expressions seem to give me the most problems.
01:03:46<Lemmih>Using -fno-monomorphism-restriction might makes things simpler.
01:04:10<mightybyte>Ok. For some reason I had the idea that wasn't a good thing to do.
01:04:16<mightybyte>Don't know where I got that idea though.
01:05:59<mightybyte>So if I wanted to get rid of the use of foo, what would I have to do?
01:06:30<mightybyte>Never mind. I found it.
01:06:48<mightybyte>Simply substitution "query ListUsers" for foo did the trick. No typing tricks needed.
02:17:12<mightybyte>Lemmih: Still around? Can you use a query and update inside the same do block?
02:22:25<Lemmih>Yes.
02:23:28<mightybyte>I'm now running into the MonadReader problem you mentioned earlier.
02:23:40<mightybyte>Forgot that I had commented the use of that one out too.
02:24:58<mightybyte>I have nested do blocks, with a query in the outer one and an update in the inner one.
02:25:21<Lemmih>Why do you nest them?
02:25:37<mightybyte>Look at that last link
02:25:44<mightybyte>http://hpaste.org/5754#a2
02:26:07<mightybyte>In checkAndAdd. I couldn't think of another way to do it.
02:26:42<Lemmih>Oh sure, that's fine.
02:26:59<Lemmih>'query $ IsUser user'
02:27:26<Lemmih>('show foo' is still wrong)
02:27:36<mightybyte>Yeah, I fixed that.
02:27:49<mightybyte>Both of them.
02:28:45<Lemmih>Does it work?
02:28:49<mightybyte>No
02:28:55<mightybyte>I'll paste the new code.
02:29:01<Lemmih>Did you remove 'MonadReader State m'?
02:29:35<Lemmih>(You can use 'ServerPart' instead of 'ServerPartT m', btw)
02:29:49<mightybyte>Yeah, no more MonadReader
02:31:30<mightybyte>Hah, I was trying to get it back into a form decent enough to paste and now it works.
02:32:04<Lemmih>Jolly good.
02:32:08<mightybyte>Let me test it.
02:32:54<Lemmih>I'm off to bed. Cya.
02:33:27<mightybyte>Ok, later.
21:54:04<MarcWeber>Which examples to use to get more familiar with happs state ? The example in HAppS-State doesn't compile
21:55:19<Lemmih>MarcWeber: What example is that?
21:55:47<Lemmih>MarcWeber: There are two and they should both work.
21:58:46<MarcWeber>CheckpointTest.hs|19 col 9 error|
21:58:49<MarcWeber>|| Not in scope: type constructor or class `Version'
21:59:09<MarcWeber>(it's line 18 because I've added a line telling vim which packages to use)
21:59:31<MarcWeber>testState compiles
22:00:14<Lemmih>MarcWeber: Do you have an old version of HAppS installed?
22:00:42<mightybyte> MarcWeber: I'm working on a tutorial for happs state. When I get it done, it will be at http://softwaresimply.blogspot.com/
22:01:23<MarcWeber>0.9.2 is current, isn't it? Indeed I've 0.9.1
22:01:50<Lemmih>MarcWeber: There's only the darcs version.
22:02:38<MarcWeber>So which is the best way to get to know that? I've installed from darcs about 2 weeks ago.
22:03:06<MarcWeber>ghc-pkg lists 0.9.1 everywhere
22:03:06<Lemmih>The examples are the best/only way.
22:03:35<MarcWeber>I'll try getting the latest darcs version and I 'll try again
22:03:39<Lemmih>The current examples won't work with a HAppS from 2 weeks ago.
22:03:41<mightybyte>There's always reading the actual HAppS code, but I discovered that is quite difficult.
22:06:22<MarcWeber>Anyway that's fine. That means there is a lot progress :)
22:16:28<fxr>are there any openomy developers in this channel?
23:14:25<fxr>Lemmih: y00
23:15:19<fxr>Lemmih: I read the logs and found that you were telling prevalence like persistence method to mightybyte
23:15:44<Lemmih>fxr: Right.
23:18:48<fxr>Lemmih: So the tx log contains function names and corresponding args
23:19:09<Lemmih>fxr: Right.
23:20:15<fxr>and so given a data structure, happs creates those tx functions via template haskell right?
23:21:50<Lemmih>Given a set of methods, happs creates the boilerplate code required for serialization via TH.
23:24:25<fxr>are there any limitations for the transactional functions' arguments? I'm using prevalence around 1 year and really impressed happs
23:24:58<Lemmih>They just have to be serializable.
23:25:17<fxr>lemme clarify
23:29:56<Lemmih>Clarify away.
23:31:03<fxr>assume that we have two data structures people and organization, organization includes peoples and we have a root point which is a container for them and let's think of the root is populated with samples
23:31:53<Lemmih>Okay.
23:35:11<fxr>what I'm doing is to write interface functions for the programmers api, like add_people, update_people etc.. standard crud operations. so add_people is a two parameter function which gets an organization, and a people (assuming root is globally accessable).
23:36:06<Lemmih>Right.
23:45:17<fxr>and then it serializes a transaction with the function name tx_add_people (which is also a callable function with three parameters, a store, an organization index and people's information), with parameters organization_id (which is an index) and people's serialized data structure.
23:46:37<fxr>calls the function afterwards to update in-memory data.
23:48:02<Lemmih>HAppS doesn't create any tx_* functions.

Back to channel and daily index: content-negotiated html turtle