00:18:39 <Lemmih> Are there any numbers on how many people use happstack, snap and yesod?
01:25:51 <mightybyte> There are the hackage downloads for last year.
01:26:55 <mightybyte> http://haskellwebnews.wordpress.com/2011/03/16/hackage-stats-the-past-year/
01:29:24 <Lemmih> Thanks.
01:36:02 <Lemmih> Haddock docs for acid-state are now available.
02:09:13 <stepkut> yay!
02:14:11 <stepkut> speaking of haddock docs -- one problem with happstack-state is that you write functions like, fooQuery, but then you export the constructor FooQuery. In the process the haddock documentation gets lost.. not sure if acid-state can do anything about that..
02:18:05 <stepkut> in the current version of acid-state, everything is written by hand, so you can add the haddock docs no problem -- but if/when TH is added into the picture.. that is when it becomes tricky
02:47:46 <Lemmih> stepkut: I don't think that can be solved.
02:48:11 <Lemmih> There's the CPP solution for those that really want it.
02:48:36 <stepkut> Lemmih: yeah.. the CPP solution is hard to keep in sync though.. but perhaps a custom preprocessor could work
02:54:45 <Lemmih> I added a stress-test example, btw.
02:54:51 <stepkut> yeah I saw that
02:55:24 <stepkut> I will look into adding some benchmarks (perhaps via criterion)
02:55:32 <Lemmih> I would like to benchmark it against happstack-state but I haven't gotten around to it.
02:55:40 <stepkut> k
02:55:48 <stepkut> I would like to benchmark it against redis and mysql ;)
02:59:02 <Lemmih> The Holy Grail of apples/oranges comparisons.
02:59:08 <stepkut> exactly
05:22:07 <mrcarrot> i can see that you are talking about changing MACID to something else... i just wonder what will happen then with backward compatibility?
05:22:54 <mrcarrot> i mean, if i would pick happstack right now for a big project and then want to upgrade to happstack 7 in the future
05:33:51 <Lemmih> mrcarrot: acid-state won't be compatible with happstack-state.
05:34:04 <Lemmih> mrcarrot: You'd have to move your state manually.
10:18:15 <HugoDaniel> :)
16:56:59 <rostayob> stepkut, stepcut: using digestive-functors-hsp, all the values are "" after I submit the form
16:59:08 <stepkut> :-/
16:59:14 <stepkut> doing it wrong..
16:59:18 <stepkut> it works for me :)
16:59:41 <stepkut> i would need to see some code to say how you are doing it wrong
16:59:57 <rostayob> stepkut: just a sec (:
17:00:41 <rostayob> stepkut: http://hpaste.org/45688/digestive
17:00:44 <rostayob> and eitherHappstackForm
17:02:11 <rostayob> stepkut: I annotated it with an example
17:03:43 <stepkut> does eitherHappstackForm call renderForm /
17:04:22 <rostayob> stepkut: no, loginPage calls it
17:06:57 <rostayob> the html of the for is like this: http://hpaste.org/paste/45688/digestive_annotation#p45690
17:07:11 <stepkut> try adding,  enctype="multipart/form-data" to the <form> element?
17:09:17 <rostayob> stepkut: doesn't work
17:09:47 <stepkut> you should add that anyway :)
17:09:57 <rostayob> stepkut: uh, ok, why?
17:10:02 <stepkut> but that has more to do with handling encoding issues
17:10:38 <rostayob> I tought that was important when sending files
17:10:45 <rostayob> otherwise the url encoding was good
17:10:48 <rostayob> anyway
17:11:22 <stepkut> hhow do you know that the values are "" ?
17:11:34 <rostayob> stepkut: liftIO $ print userName/password
17:12:05 <rostayob> well I found out, sniffing the requests to the database
17:12:13 <rostayob> because it would always say incorrect username/password
17:12:28 <stepkut> I don't see anything obviously wrong
17:14:11 <rostayob> stepkut: uhm
17:14:14 <rostayob> me neither
17:14:25 <Entroacceptor> let me try it ;)
17:15:34 <Entroacceptor> or not
17:15:40 <Entroacceptor> stupid dependencies
17:17:36 <rostayob> stepkut: have you got any working example?
17:18:00 <stepkut> rostayob: i am currently seeing if the example in digestive-functors works..
17:18:09 <rostayob> oh ok
17:18:13 <rostayob> i'll try that as well
17:19:02 <rostayob> stepkut: I've already had other forms working perfectly with happstack and blaze
17:19:19 <stepkut> rostayob: :-/
17:19:23 <stepkut> rostayob: me too :)
17:20:28 <rostayob> stepkut: the problem is that now I can't seem to install digestive-functors-blaze, so I can't see what how my old forms work lol
17:20:38 <rostayob> stepkut: but even the html seems allright
17:20:54 <stepkut> rostayob: yeah, digestive-functors-blaze seems broken to me as well
17:21:06 <stepkut>     Not in scope: type constructor or class `Formlet' ?
17:21:26 <rostayob> precisely
17:21:33 <stepkut> jaspervdj: is digestive-functors-blaze broken ?
17:22:11 <rostayob> stepkut: no I think that blaze changed, I tried to install an older git commit that worked and it doesn't compile
17:22:42 <rostayob> but yeah, digestive-functors-blaze is broken now :P
17:24:38 <stepkut> oo. the Formlet type was added to digestive-functors in git after the 0.0.2.1 release
17:24:54 <stepkut> so trying to build digestive-functors-blaze against the hackage version of digestive-functors will fail
17:24:59 <rostayob> ah ok
17:25:31 <Entroacceptor> that (d-f-blaze) just installed for me
17:26:26 <stepkut> Entroacceptor: from git or from hackage ?
17:26:34 <Entroacceptor> hackage
17:26:49 <rostayob> Entroacceptor: the hackage d-f-blaze requires blaze == 0.3
17:26:51 <stepkut> the version on hackage requires blaze-html 0.3 I think :-/
17:27:21 <Entroacceptor> oh, yes :/
17:27:31 <Entroacceptor> this really really turns me off
17:28:57 <stepkut> ok, I built the latest digestive-functors* and the Happstack.lhs example seems broken to
17:28:58 <rostayob> anyway, I'm not really worried about d-f-blaze, but i'd like to know why it doesn't work with hsp...
17:29:14 <rostayob> stepkut: ok, this is weird, stuff worked 1 month ago
17:29:26 <stepkut> rostayob: one moment
17:33:27 <stepkut> actually..
17:33:35 <stepkut> let me add another test
17:34:45 <stepkut> ok, I take it back. The example included with digestive-functors does work (if you are building everything from git)
17:35:03 <stepkut> I misread the results the first time
17:35:40 <rostayob> stepkut: ok, so the blaze thing still works
17:36:03 <rostayob> could you paste the input names?
17:36:27 <stepkut> I think I see the issue
17:36:28 <stepkut> one moment
17:41:24 <stepkut> ok. turns out *I* was doing it wrong. I uploaded digestive-functor-hsp 0.2.1 which hopefully fixes things. Can you try it and see ?
17:41:58 <rostayob> stepkut: yep I'll do that now
17:43:41 <rostayob> stepkut: ok it works now! thanks!
17:43:43 <rostayob> what was wrong?
17:43:51 <rostayob> btw, this proves that i'm the only user of this library! ehe
17:44:16 <stepkut> you are the only person using digestive-functors-hsp *with* digestive-functors-happstack
17:44:46 <stepkut> the problem is that those two different libraries had different ideas on how to turn a FormId into the value that gets saved in the name attribute
17:45:20 <rostayob> yeah that's what I suspected, it was the only thing that came to my mind since I knew that it worked with digestive-functors-blaze
17:45:21 <rostayob> anyway, thanks
17:45:26 <stepkut> I don't use digestive-functors-happstack in my code, so I didn't see the mismatch (my code uses the same function that digestive-functors-hsp was using, so it matched up)
17:45:41 <rostayob> stepkut: what do you use then?
17:46:40 <stepkut> I use a crazy function call formPart that let's me embed the forms more directly
17:46:53 <stepkut> i should put it somewhere.. but I am not sure where.. digestive-functors-happstack-hsp ?
17:47:21 <rostayob> ahah idk
17:47:49 <stepkut> it can't go in digestive-functors-happstack because that does not require hsp. and it can't go in digestive-functors-hsp, but that doesn't require happstack. So..
17:48:10 <rostayob> but I think the current state of things is ok. you just need a simple function like my "renderForm" to actually show the form
17:48:15 <stepkut> yeah
17:48:28 <rostayob> and I don't see how you can generalize it
17:49:56 <stepkut> check out 'formletPart' in this file, http://src.seereason.com/examples/happstack-imageboard/Web.hs
17:50:05 <stepkut> it is essentially the same thing, but for formlets instead of digestive-functors
17:50:33 <stepkut> it allows you to embed the formlet directly into some other html
17:50:36 <rostayob> oh I tought I had read all that file!
17:51:12 <stepkut> maybe formletPart is so elegant you didn't even notice it ?
17:51:22 <rostayob> so wait it displays the form or the view directly?
17:51:37 <rostayob> no sorry, the view or the "after" the form
17:51:50 <stepkut> yeah..
17:51:53 <rostayob> the thing is that
17:51:57 <rostayob> I almost always redirect
17:52:01 <stepkut> if it is a GET request, it just displays the form
17:52:28 <rostayob> and wait what does it do when it's a POST, and the values fit?
17:52:51 <stepkut> if it is a POST request it does not display the page with the form. instead it extracts the value from the form and calls the 'handleSuccess' function which does something with the value and returns a Response
17:53:19 <stepkut> it is a POST request but validation fails, then it calls handleFailure'
17:53:32 <stepkut>            <% formletPart hereURL handleSuccess handleFailure' (postFormlet `checkM` (validateNewThread config)) %>
17:53:53 <stepkut> (or whatever you call the functions you pass to formletPart)
17:53:56 <rostayob> stepkut: yeah fair enough. I'd probably end up writing something like that, but without handleFailure
17:54:09 <stepkut> why no handleFailure?
17:54:24 <rostayob> I just do childErrors ++>
17:54:30 <rostayob> I just want to display the errors
17:54:32 <stepkut> sure
17:54:40 <stepkut> you would still do that
17:55:03 <rostayob> so why would I need an handleFailure?
17:55:04 <stepkut> but if the form is embedded in a larger page, you may not want to render everything on the page when you show form errors
17:55:24 <rostayob> why not?
17:55:31 <rostayob> you mean show just the form?
17:55:38 <stepkut> right
17:55:46 <stepkut> when there is an error you might want to just show the form
17:55:52 <rostayob> mhm why?
17:56:01 <stepkut> let's say you have a form at the bottom of some long page.. and then there is a validation error
17:56:18 <stepkut> do they really need to see everything else at the top of the page, and then scroll down to the bottom to see the form with the error ?
17:56:40 <rostayob> stepkut: i'd just have the action with an anchor link, I think
17:57:06 <rostayob> boh I never tought about that
17:57:09 <stepkut> by removing all the content that is not relevant to the form error, it could make it easier to understand what is going on
17:57:46 <stepkut> but.. perhaps the 'handleFailure' argument sholud be a Maybe value.. if you set it to Nothing then it just redisplays it in the original context
17:57:52 <stepkut> that seems useful
17:58:02 <rostayob> stepkut: I see what you're saying, it never occurred to me up to now. I would probably do ajax or I'll solve the issue with an anchor link
17:58:07 <stepkut> it would actually be hard to do that using the current API
17:58:11 <stepkut> so I think I will change it
17:59:55 <rostayob> what I want to do now is something to "flash" messages
18:00:06 <rostayob> like a state monad were you can store messages to show
18:00:13 <rostayob> but my monads stack is getting ugly
18:00:35 <stepkut> State or Writer?
18:00:44 <rostayob> at template level is like XMLGenT (RouteT (ServerPartT (ErrorT AppError (ReaderT Context IO))))
18:01:06 <stepkut> you might change ReaderT to be RWST
18:01:12 <rostayob> yeah a writer monad would be good as well
18:01:22 <rostayob> stepkut: what's rwst?
18:01:40 <stepkut> a monad transformer that is a combination of Reader Writer and State
18:02:06 <stepkut> newtype RWST r w s m a = RWST {runRWST :: r -> s -> m (a, s, w)}
18:02:26 <rostayob> oh, cool.
18:02:47 <stepkut> it is a Reader value 'r', a Writer value 'w', and a state value 's'. You use the normal ask, tell, get/put functions to access each component
18:02:51 <aristid> RWST supposedly is more performant than a stack of Readers and States
18:03:04 <stepkut> if you don't need a component, you can just make the type () for that component
18:03:13 <rostayob> is it done already or do I have to write a stack and then the instances of MonadReader etc
18:04:00 <jaspervdj> I'll fix the digestive-functors isse
18:04:02 <jaspervdj> *issue
18:04:27 <rostayob> oh, it's in mtl
18:04:36 <rostayob> cool, I'll probably go for it
18:04:57 <stepkut> jaspervdj: I think the issue is just trying to mix git with hackage
18:05:03 <stepkut> jaspervdj: if I installed everything from git it worked fine
18:05:32 <stepkut> jaspervdj: that said, the digestive-functors-blaze on hackage requires blaze-html 0.3, but 0.4.* is the latest
18:05:41 <stepkut> jaspervdj: so cutting a new release soon could be nice
19:08:14 <rostayob> stepkut, stepcut: the crash course seems to be down
19:12:08 <stepkut> oh right
19:12:10 <stepkut> one moment
19:16:34 <stepkut> fixed. thanks!
19:30:40 <rostayob> stepkut: np, thanks to you
19:34:08 <stepkut> ACTION is breakin' things left and right apparently
19:36:53 <rostayob> eheh it happens
19:37:07 <rostayob> the hs news clone should be ready soon
19:37:10 <stepkut> nice
19:37:11 <rostayob> if I had more time...
19:37:14 <stepkut> heh
19:37:25 <stepkut> I am fixing the happstack-authenticate example now, btw :)
19:37:29 <rostayob> k
19:37:37 <rostayob> I don't think I'll be using that, for simplicity
19:37:42 <rostayob> I'm keeping things simple
19:37:45 <rostayob> but it's really nice
19:38:24 <stepkut> nice
19:38:32 <stepkut> someday happstack-authenticate will be nice
19:38:45 <stepkut> I guess you are not using MACID anymore so that makes things messier
19:38:52 <rostayob> yeah I'm not...
19:39:03 <stepkut> for now ;)
19:39:04 <rostayob> I'm waiting for a better IxSet
19:39:06 <rostayob> yeah
19:39:08 <stepkut> yeah
19:39:15 <rostayob> right now imho it's not very practical
19:39:24 <stepkut> next week I am going to work on kdtree
19:39:54 <rostayob> let me know how that goes... I don't think it makes the O complexity actually better
19:40:05 <rostayob> or I just didn't understand
19:40:12 <stepkut> how do you know that what you are using actually has better O complexity?
19:40:27 <rostayob> 1) how do you balance it 2) how do you extract sorted lists
19:40:39 <rostayob> stepkut: B-trees all over the place for each index
19:41:24 <stepkut> how do you know that the performance of IxSet was unacceptable
19:41:58 <rostayob> stepkut: define "acceptable". of course it would have worked well, it's just a test, but the idea of sorting things each time just looks wrong to me
19:42:11 <rostayob> a database shouldn't work like that
19:42:17 <rostayob> B-trees were invented to solve that problem
19:43:22 <stepkut> how many items where you sorting?
19:44:22 <rostayob> stepkut: again, it would have been fast enough for me. it's just that it doesn't seem right. if it was a real application, imagine sorting the first 20 posts, the complexity would be like log n
19:44:28 <rostayob> no sorry
19:44:31 <rostayob> n
19:44:33 <rostayob> more or less
19:44:49 <stepkut> where n is every post ever made?
19:44:53 <rostayob> yes
19:46:12 <rostayob> it's a partial sort basically
19:46:21 <rostayob> i think it's like
19:46:34 <rostayob> well wathever you get the point :P
19:48:50 <rostayob> shit fukishima is getting worse
20:13:35 <stepkut> I wrote to peter and asked what he thought about the possibility of writing a function like, toAscList :: (Index k a) => Proxy k -> KdTree a -> [a], that doesn't suck
20:33:48 <rostayob> stepkut: I tought about it, and I didn't see an easy way out. the big problem is balancing it anyway
20:34:03 <rostayob> stepkut: anway, got to go, good luck ehe