15:55:47 <astroboy> stepkut: are you currently using digestive-functors?
16:01:00 <stepkut> astroboy: yep
16:01:31 <stepkut> astroboy: well, currently I am lying in bed..
16:02:02 <astroboy> stepkut: mhm. I'm having trouble installing it. i'm really really tired of cabal.
16:03:29 <astroboy> I mean I can install it with cabal install
16:38:12 <astroboy> stepkut: http://pastebin.com/GjQD6sUf :(
16:39:40 <stepkut> do you have multiple versions of blaze-html installed?
16:49:31 <astroboy> yeah but
16:49:49 <astroboy> stepkut: the thing is that I had to fix digestive-functors yesterday for happstack 0.6
16:49:55 <astroboy> now I'm fixing it for the new blaze...
16:50:07 <stepkut> progress sucks :)
16:50:42 <astroboy> yeah...
16:51:05 <astroboy> ah no ok. it works just modifying the dependency in the .cabal
16:51:25 <astroboy> well it "works"... it compiles
16:51:32 <stepkut> probably works then
16:51:55 <astroboy> https://github.com/rostayob/digestive-functors in case you're interested
16:52:40 <stepkut> yeah, I am making a different patch for it
16:53:00 <astroboy> oh ok
16:53:08 <astroboy> that's what I did https://github.com/rostayob/digestive-functors/blob/master/digestive-functors-happstack/src/Text/Digestive/Forms/Happstack.hs
16:53:20 <stepkut> yeah
16:53:33 <astroboy> I didn't really know what I was doing lol
16:53:46 <astroboy> I mean I just guessed but it should be fine
16:53:52 <stepkut> yeah
16:54:12 <stepkut> I think you can get rid of all that withRequest / runServerPartT stuff and just use askRq >>= \rq ->
16:54:15 <stepkut> I know in a minute
16:54:58 <astroboy> yeah I suspected that
16:55:04 <astroboy> but Ijust wanted to get it working
16:55:20 <astroboy> and I don't really know how the happstack form stuff works
17:14:10 <astroboy> stepkut: btw, I think that my modification doesn't work. I get "The error was "askRqEnv failed because the request body has not been decoded yet. Try using 'decodeBody'.""
17:14:24 <astroboy> the problem could be somewhere else
17:14:50 <astroboy> but I think
17:14:53 <astroboy> that it fails
17:15:03 <astroboy> on "getDataFn"
17:15:18 <astroboy> stepkut: does getDataFn call askRqEnv?
17:16:43 <astroboy> yeah it does
17:17:35 <astroboy> stepkut: Ok yeah I think it's better to do it with askRq
17:19:09 <astroboy> otherwsie I'd have to call decodeBody manually
17:21:07 <HugoDaniel> heya
17:21:15 <HugoDaniel> stepkut, how is authenticate going ?
17:21:40 <stepkut> astroboy: you should call decodeBody manually in your application. It contains application specific quotas and stuff
17:21:54 <stepkut> HugoDaniel: slowly.. but now that happstack 6 is out I will have more time
17:21:59 <stepkut> bbiab, getting comcast to fix my internet
17:22:00 <astroboy> stepkut: oh ok. even when i'm not uploading files?
17:22:01 <HugoDaniel> cool
17:22:16 <astroboy> stepkut: well but the thing is tht
17:22:31 <astroboy> if you call decodeBody in the digestive-functors code
17:22:41 <astroboy> oh you're saying that I should call it elsewhere
17:22:43 <astroboy> in the app
17:28:52 <astroboy> ok, it works! but error messages get displayed twice...
17:28:54 <astroboy> mhm
17:29:51 <astroboy> uh ok, I get why.
17:29:57 <astroboy> coool! this is all really cool!
17:43:41 <stepkut> astroboy: nice!
17:44:16 <stepkut> astroboy: I have seen the double error message thing as well -- I think it is due to incorrect usage of digestive functors
17:46:32 <astroboy> stepkut: yeah I was piping the errors twice. my bad. it works greatly now. really nice
17:46:47 <astroboy> going to create a git repo soon
17:50:26 <stepkut> nice
17:50:32 <stepkut> for what ?
17:54:49 <astroboy> for the reddit clone
17:54:54 <astroboy> I've got user registration working
18:04:14 <stepkut> nice
18:09:28 <astroboy> stepkut: are there any utilities for writing/reading cookies?
18:10:04 <stepkut> http://happstack.com/docs/crashcourse/RqData.html#cookies
18:11:30 <astroboy> stepkut: oh right, sorry ehe
18:12:23 <astroboy> stepkut: How would you implement simple sessions?
18:13:11 <stepkut> depends on what you are looking for
18:13:24 <astroboy> simply tracking logged in users
18:14:07 <astroboy> stepkut: like, how would you generate an unique id?
18:14:27 <stepkut> I would probably create a cookie that has an unguessable authid and then store a mapping between that unique cookie and the userid
18:14:53 <astroboy> stepkut: exactly, but how do you generate the unguessable
18:15:15 <stepkut> step 1: use pwstore to create your hashed passwords
18:15:24 <astroboy> stepkut: done.
18:15:41 <stepkut> step 2: now that you are using pwstore, you can use genSaltIO to generate good random data
18:16:30 <astroboy> yeah, but how do I guarantee it's unique
18:16:31 <stepkut> step 3: combine the userid + some random salt to create an auth token which is unguessable and guaranteed not to collide with any other user's auth token ?
18:16:54 <astroboy> mhm...
18:17:09 <stepkut> not sure if putting the userid in the authToken is a bad idea or not.. I think it is ok
18:17:20 <stepkut> brb
18:23:40 <stepkut> back!
18:24:17 <stepkut> so, I think that putting the userid in the authToken is probably ok, because you can not just change the userId in the cookie to spoof another user..
21:06:44 <astroboy> stepcut, stepkut: when using "seeOther" I get "No instance for (Data.String.IsString Response)"
21:08:06 <astroboy> I mean I can use it with
21:08:18 <astroboy> parse on the firs arg and toResponse on the second
21:08:23 <astroboy> but in the example
21:08:28 <astroboy> in the haddock docs
21:08:30 <astroboy> there is no such thing
21:08:43 <astroboy> "seeOther "http://example.org/" "What you are looking for is now at http://example.org/"
21:08:54 <astroboy> am I missing some LANGUAGE flags?
21:10:14 <astroboy> stepcut, stepkut: no but it shouldn't be like that, String is an instance of ToSURI
21:10:17 <astroboy> boh
21:14:49 <astroboy> oh, it's OverloadedStrings that's creating problems
21:15:33 <astroboy> yeah
21:48:22 <astroboy> stepcut, stepkut: is there any documentation about how to handle components?
21:56:35 <stepkut> astroboy: not yet! That is a big feature for Happstack 7 though ;)
21:56:47 <stepkut> astroboy: documenting happstack-state better
21:57:24 <stepkut> yeah, OverloadedStrings is trouble.. I am not a big fan of it
22:00:52 <astroboy> stepkut: well my case is quite simple
22:00:57 <astroboy> I want to have 2 components
22:01:02 <astroboy> one depends on the other
22:01:05 <astroboy> end of the story
22:01:17 <astroboy> do I just have to start the one that depends on the other
22:01:21 <astroboy> and the other will be called?
22:09:00 <stepkut> yeah
22:09:27 <stepkut> you have one top-level state component that depends on all the other components
22:09:49 <stepkut> often in apps you will have a 'dummy' top-level state component that does not really contain anything
22:09:50 <stepkut> like,
22:09:58 <stepkut> data AppState = AppState
22:10:57 <stepkut> you can see the guestbook example here, http://patch-tag.com/r/mae/happstack/snapshot/current/content/pretty/happstack/templates/project
22:11:12 <stepkut> http://patch-tag.com/r/mae/happstack/snapshot/current/content/pretty/happstack/templates/project/src/State.hs
22:11:39 <stepkut> AppState does not contain any real data, it just depends on the Guestbook Component (and, in a real app, probably things like Accounts, etc)
22:12:31 <astroboy> ok, cool
22:12:37 <astroboy> that's what I tought to do more or les
22:12:38 <astroboy> *less
22:12:42 <astroboy> but the query
22:12:47 <astroboy> the queries
22:12:53 <astroboy> act on all the components of course
22:12:59 <astroboy> I mean they're "global"
22:19:15 <stepkut> yeah
22:19:26 <stepkut> though that will be addressed to some degree in happstack 7 as well
22:19:32 <stepkut> happstack 7 is going to be awesome :)
22:19:37 <stepkut> not that 6 isn't :(
22:19:56 <stepkut> gotta run to the store, bbiab