Experimental IRC log happs-2008-11-13

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.

03:18:28<mightybyte>@seen chr1s
04:15:55<mightybyte>Anyone around?
04:17:09<Saizan>ACTION waves
04:17:49<mightybyte>Is it possible to have a state accessor function take another function as an argument?
04:18:57<Saizan>by state accessor you mean something that you pass to mkMethods?
04:19:02<mightybyte>Yes
04:19:27<Saizan>then you can't directly, since you'd need to able to serialize functions
04:19:29<mightybyte>i.e. querySet :: MonadReader State m => (IxSet a -> IxSet a) -> m [a]
04:19:57<mightybyte>Yeah, the error I got was "No instance for (Serialize (IxSet a -> IxSet a))
04:20:26<Saizan>serializing functions would be quite nice but needs compiler support :)
04:20:33<mightybyte>Heh, yeah.
04:21:02<mightybyte>I guess there's no reason not to just have querySet :: MonadReader State m => m (IxSet a)
04:21:02<Saizan>the best we can do is to create some datatype that you can evaluate to do the same work
04:21:23<mightybyte>Right
04:22:10<mightybyte>If the above, then "set <- query $ QuerySet" will give me the whole IxSet and I can just operate on that.
04:22:11<Saizan>that querySet also works, yeah
04:22:19<mightybyte>...rather than passing my operation in.
04:22:41<mightybyte>There shouldn't be any memory downside to that approach, right?
04:23:03<mightybyte>...since it's all pure.
04:23:19<Saizan>you're just keeping one more reference to the IxSet
04:23:35<mightybyte>Right. No actual data copy.
04:23:45<Saizan>no
04:24:07<mightybyte>Oh, but would there be any transactional integrity issues?
04:24:43<mightybyte>...if someone updates the set after you get the reference but before you query it
04:25:20<Saizan>once querySet returns you're already out of the transaction
04:25:34<mightybyte>Right, which is the problem
04:26:04<Saizan>unless you're going to modify it i don't see the problem
04:26:43<mightybyte>Since you're not in a transaction, what if another thread modifies it in the middle of your query operations on the returned reference?
04:27:29<Saizan>it's a pure value, so the other thread is not modifying it, it's just creating a new version and writing that in the same TVar at max
04:27:45<mightybyte>Ok
04:28:01<Saizan>but the IxSet you're working with is immutable like any other haskell value
04:29:31<mightybyte>...but operations on them still don't require copying the entire set?
04:31:14<Saizan>all the elements are shared, and most of the indexing structure too
04:31:57<mightybyte>Ok, that's the one thing that still always nags at me with Haskell development.
04:34:33<Saizan>e.g. if you have a binary tree, and want to insert an element in it, you've to allocate new nodes only for those that are in the path from the root to the new element
04:35:21<mightybyte>Yeah, I understand that, but not all structures have that property.
04:35:35<Saizan>if you still keep a reference to the old tree then you're using two times the memory for each of those nodes, if not the old nodes can be garbage collected
04:35:37<mightybyte>...and I've been bitten by them before.
04:35:43<Saizan>ah, right
04:35:58<mightybyte>...which is why I always wonder.
04:36:45<Saizan>but in this case you're not storing this IxSet you queried somewhere i guess, you're just getting some values out of it
04:36:56<mightybyte>Right
04:36:56<Saizan>so it should be available for garbage collection soon
22:06:56<MarcWeber>Lemmih: I confirm that current hopps compiles with 6.11 on nixos as well
22:07:04<MarcWeber>(sorry for the delay)
22:10:16<Lemmih>MarcWeber: Thank you.
23:31:24<Saizan>chr1s: have you considered using quasiquotation for formlets?
23:44:27<mightybyte>How do I go about creating a ServerPartT from a function that takes multiple arguments to be gathered from the request data?
23:45:53<Lemmih>mightybyte: Use 'withData'?
23:46:14<mightybyte>Ahhh
23:47:09<mightybyte>I want to grab something from the path and also get the session information (from the session module I developed in my blog posts)
23:48:00<mightybyte>So I have a function "genPage :: String -> SessionData -> ServerPartT..."
23:48:19<mightybyte>But I was wanting to leverage the path function so I wouldn't have to duplicate that work.
23:49:57<mightybyte>I was hoping for something like "path $ withSession $ genPage". (Although I know that won't work.)
23:51:17<Lemmih>Right, that won't work.
23:51:47<mightybyte>I'm having trouble seeing the right way to do it.
23:51:55<Lemmih>path $ \p -> withSession $ genPage p
23:52:14<mightybyte>Ohhhh, right.
23:52:55<mightybyte>Duh. Lightbulb comes on.
23:56:36<mightybyte>Thanks.

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