19:18:59 <rostayob> stepcut: I give up. I'm ditching happstack-state, going back to good old couchdb.
19:19:55 <rostayob> it is something really cool but it can't really replace a database right now, imho...
19:26:12 <stepcut> rostayob: yeah, that is why we are working on it a lot for happstack 7 :)
19:28:38 <rostayob> stepcut: the problem is that the limitations seem to be in the fact that you can't have destructive updates
19:28:43 <rostayob> in haskell
19:28:48 <rostayob> I mean it's really really hard
19:29:14 <rostayob> to build an efficient database without a B-tree...
19:29:20 <stepcut> perhaps
19:29:45 <rostayob> but good luck anyway ehe
19:32:12 <rostayob> stepcut: also, I found the imageboard image
19:32:22 <rostayob> that seems to be the only example of web-routes around :P
19:34:09 <stepcut> yeah
19:34:34 <stepcut> imageboard  is supposed to be an example of best practices.. but i have figured out better practices since then
19:34:48 <stepcut> the huge list of class constraints on the functions is not so great
19:44:13 <rostayob> stepcut: I was going to read it now
19:51:00 <stepcut> it is easy to do destructive updates in an imperative language .. but then you have the problem that you can't destructively update the data that is still being used in other transactions :)
19:51:53 <rostayob> stepcut: yeah of course you loose persistence
19:51:59 <rostayob> *lose
19:52:14 <rostayob> and synchronization is more difficult I guess
19:52:55 <siracusa> What is a destructive update, remove existing data from the DB?
19:54:49 <rostayob> siracusa: destructive update = changing the value of something. something you can't do in declarative languages in general
19:56:11 <siracusa> I see
19:57:13 <rostayob> but in most real-world programming languages you can
19:57:41 <rostayob> I think that the only one that I use that do not have destructive updates are haskell and prolog
19:58:32 <rostayob> the fact that haskell doesn't have destructive updates and its type system give you a lot of safety for free
19:59:37 <rostayob> but having a "purely functional database" seems hard to me
20:00:10 <siracusa> But why is that a problem? If you update your data structure the old data should be removed by the GC, or what am I missing?
20:01:16 <rostayob> siracusa: yes of course
20:01:23 <rostayob> the problem is not memory consumption
20:01:42 <rostayob> let's say that you have a set of posts
20:01:54 <rostayob> and you want to keep a list of the most recent ones
20:02:28 <rostayob> and also
20:02:33 <rostayob> you want to have a list of posts for each users
20:02:42 <rostayob> to keep track of who posted what quickly
20:02:51 <rostayob> instead of looking up the whole set each time
20:03:11 <rostayob> anyway, imagine a scenario in which you have to keep various sets of the same thing
20:03:39 <rostayob> if you really want to be safe
20:03:42 <rostayob> the ideal thing to be
20:03:54 <rostayob> is to have various sets of a "Post" data type or something like that
20:03:56 <rostayob> the problem is
20:04:02 <rostayob> what do you do when you update something?
20:04:15 <rostayob> you have to change all the different sets
20:04:40 <rostayob> IxSet does that, but it's really inefficient imho
20:04:49 <rostayob> and in general, it has big limitations
20:05:54 <rostayob> I mean of course you could have an IntMap so that you can index the posts
20:05:59 <rostayob> and then have sets of ids
20:06:09 <rostayob> but then it doesn't make much sense
20:06:20 <rostayob> since you lose the safety anyway, you have to look up each time
20:09:14 <rostayob> I mean happstack-state is really useful for certain things
20:09:54 <rostayob> but imho you can't do everything you need in a complex webapp with it
20:15:37 <siracusa> rostayob: Hhm, I'm not a DB expert but I'd think you have the same problem with a normal DB, except that the DB system does the whole lookup stuff for you.
20:16:40 <siracusa> (btw, sorry for the delay, I was preparing food)
20:17:20 <rostayob> siracusa: well of course you do, but with destructive updates, you can map the separate sets directly onto the actual objects
20:17:27 <rostayob> without having the IntMap in between
20:18:00 <rostayob> and anyway my point is: if we give up safety, why would we use happstack-state anyway? there are some great dbs out there
20:20:39 <rostayob> again, happstack-state can be useful for a lot of things
20:26:20 <siracusa> rostayob: So you're saying happstack-state needs a wrapper to hide all the IntSets etc. to get fast lookups?
20:27:18 <rostayob> siracusa: no no! I'm saying that doing that it's pointless, and that I think that I'll use something else :P