--- Log opened Mon Mar 30 00:00:04 2009
03:18 < TomMD> Happstack-0.2 seems to have changed the persistance of data from 0.1 when used for hackage-server, is it possible that I missed something when porting that would cause the event log not to be saved and/or loaded properly?
05:59 < HugoDaniel> hi
05:59 < HugoDaniel> how do i get whats inside a WebT ?
05:59 < HugoDaniel> i have like WebT (readerT stuff IO) a
05:59 < HugoDaniel> i need to runReader on it :P
06:02 < mightybyte> HugoDaniel: unWebT?
06:03 < mightybyte> HugoDaniel: Given "WebT m a" are you trying to get what's in the a or the m?
06:04 < HugoDaniel> in the m
06:04 < mightybyte> Ahh, ok.
06:05 < HugoDaniel> my data is "WebT (ReaderT stuff IO) a" and im running runReaderT in it, turning it into a "WebT IO a"
06:05 < HugoDaniel> it used to work with unWebT, but i guess things are different in 0.2 :)
06:05 < mightybyte> Hmmm, I think you should just be able to use ask and local.
06:09 < mightybyte> http://happstack.com/docs/0.2/happstack-server/0.2/Happstack-Server-SimpleHTTP.html#t%3AWebT
06:09 < mightybyte> "A fully unpacked WebT has a structure that looks like:"
06:09 < mightybyte> "ununWebT $ WebT m a :: m (Maybe (Either Response a, FilterFun Response))
06:10 < mightybyte> ununWebT might be what you need
06:12 < HugoDaniel> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3087#a3087
06:12 < mightybyte> Ahh, how about mkWebT?
06:13 < HugoDaniel> i must be doing something wrong :/
06:16 < HugoDaniel> newtype WebT m a = WebT { unWebT :: ErrorT Response (FilterT (Response) (MaybeT m)) a }
06:16 < HugoDaniel> its very complex now
06:17 < mightybyte> Yeah
06:17 < HugoDaniel> mkWebT = WebT . ErrorT . FilterT . WriterT . MaybeT -- ouch
06:17 < mightybyte> Heh
06:20 < HugoDaniel> ill do a getWebTInnerMonad function then, and apply the runReaderT to it, and then wrap the result with the mkWebT... here i go
06:24 < mightybyte> I have to go.  I'll try to look at it later.
06:24 < mightybyte> I'm interested in this since I will probably be porting my app to the new monad machinery soon.
06:40 < seafood> Has anyone tried to build haskell-src-meta under GHC 6.10.1?
06:42 < HugoDaniel> not me
06:55 < seafood> Can't get it to build.
06:58 < HugoDaniel> mightybyte: i solved my problem with: http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3088#a3088
07:00 < HugoDaniel> yeh, it works just sweeeeettt :D
07:00 < HugoDaniel> i love happstack
07:01 < HugoDaniel> Firefox can't establish a connection to the server at
07:01 < HugoDaniel> except for the ipv6 :(
07:01 < HugoDaniel> i think should be a high-priority bug
07:02 < HugoDaniel> since most machines come with ipv6 configure by default now
07:02 < HugoDaniel> i have two machines with happstack, one opensuse, and one freebsd, both latest version, and happstack doesn't work on both of them because of ipv6
07:28 < mightybyte> HugoDaniel: Great, that's what I was thinking...but I haven't upgraded to 0.2 yet so I couldn't try it.
07:37 < HugoDaniel> i love the happstack architecture, im thinking on using it on things completely unrelated to web/whatever happstack does/http
10:35 < mae> HugoDaniel: you can't use ipv6?
10:35 < mae> or you can only use ipv6
10:36 < mae> please file a bug report, this is not intended behavior..
10:36 < mae> i thought we had ipv6 working
12:07 < mightybyte> Has any code been written for sharding?
14:21 < mib_qcya7e0d> Hello
15:03 < guenni> hi, anybody here been using zipper data structures?
15:35 < h_buildbot> Build for ghc-6.8.3 OK. Test suite ran. 14/77 test cases failed. Check http://buildbot.happstack.com/ for details.
15:49 < h_buildbot> Build for ghc-6.10.1 OK. Test suite ran. 15/77 test cases failed. Check http://buildbot.happstack.com/ for details.
16:58 < wchogg> I propose, for the next release, that we just pull out the Happstack.Server.JSON module.  It's essentially just a stub with no real functionality.  Any objections among mae or the crew?
17:24 < wchogg> stepcut : What exactly is require to use HSP to generate pages for Happstack?  iirc you worked on that.
17:36 < stepcut> wchogg: you have to install HSP, and you will probably want to use the ToMessage from HSP that is in the happstack package
17:38 < wchogg> stepcut : Ah, didn't see that there was a ToMessage instance for XML.  That makes it pretty simple, then.
18:31 < mightybyte> Anyone know how to get rid of a "No instance for (FilterMonad Response IO)" error in the new SimpleHTTP?
18:31 < mightybyte> I'm just trying to port my code to it and this is blocking me.
18:46 < mightybyte> I'm trying to get a minimal set of code that exhibits the error without unnecessary cruft, but that's taking awhile...
19:35 < mightybyte> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3123
19:36 < mightybyte> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=3124
19:36 < mightybyte> Those two files demonstrate the above error.
19:52 < stepcut> what is the type of loginGate?
19:53 < mightybyte> hang on...phone
19:53 < stepcut> oh, nm. I see it now.
19:53 < mightybyte> loginGate :: (FilterMonad Response m, MonadIO m) => ServerPartT m a -> ServerPartT m a -> ServerPartT m a
19:55 < mightybyte> I'm at a complete loss
19:55 < stepcut> hold on, food
19:55 < mightybyte> ok
19:57 < stepcut> mightybyte: I am pretty sure you don't want that FilterMonad constraint there. So, you need to figure out why it is there and 'fix' that
19:57 < mightybyte> Hmmm
19:58 < stepcut> there is an instance like this: instance [overlap ok] (Monad m) => FilterMonad Response (ServerPartT m)
19:58 < stepcut> but not (FilterMonad Response IO), so, I think you are probably using FilterMonad incorrectly.
19:59 < mightybyte> Ok.  I wonder if it's related to my use of liftIO.
20:09 < stepcut> mightybyte: currently I am inclined to think that you just need to modify a type signature
20:10 < stepcut> what happens if you drop the FilterMonad Response m context from loginGate and withSession ?
20:10 < mightybyte> When I drop the signatures completely those are the types that are inferred.
20:12 < mightybyte> "Could not deduce (FilterMonad Response m) from the context (MonadIO m)"
20:12 < mightybyte> ...at Auth.hs:268
20:13 < stepcut> which line is 268 ?
20:13 < mightybyte> last line of withSession
20:14 < mightybyte> noSession = mapServerPartT ...
20:14 < stepcut> for withSession and loginGate, trying getting rid of the whole context and just make the type, ServerPartT IO a
20:14 < mightybyte> Ok
20:15 < stepcut> alternatively, (FilterMonad Response (ServerPartT m), MonadIO m) => ..., might work
20:15 < mightybyte> Getting rid of them didn't work.
20:15 < stepcut> what error do you get now ?
20:16 < stepcut> oh, I should be able to build with just these two files right ?
20:16 < mightybyte> Could not deduce MonadIO arising from the use of 'query' (in withSession)
20:16 < mightybyte> Yeah
20:16 < stepcut> one moment, this will be much faster :)
20:17 < mightybyte> Ok.  I was wondering why you weren't doing that. :)
20:17 < stepcut> I figured there was more code
20:17 < mightybyte> This is distilled.
20:17 < stepcut> sorry, didn't get much sleep the past two nights
20:17 < stepcut> a bit slow at the moment
20:18 < mightybyte> No problem
20:18 < stepcut> though, you do have some extra deps I don't have nistalled, Codec.Utils ? Data.Digest.SHA512 ?
20:19 < mightybyte> Yeah, "cabal install Crypto"
20:19 < stepcut> nm. replaced some stuff  with undefined and all is good
20:19 < stepcut> I don't need to *run* it, just compile it :*
20:19 < mightybyte> Right
20:23 < stepcut> I think you just want,        noSession = clearSessionCookie >> guestSPT
20:24 < mightybyte> Bingo...that at least compiles
20:24 < stepcut> :)
20:25 < stepcut> mapServerPartT is for changing, ServerPartT m a, to a ServerPartT n a, which is not what you are trying to do with clearSessionCookie
20:25 < stepcut> like, if you had, ServerPartT (LogicT IO) a, and you needed, ServerPartT IO a, you would use mapServerPartT to change the monad from (LogicT IO) to just plain IO
20:25 < stepcut> dinner. bbly.
20:25 < mightybyte> Ahh yes
20:26 < mightybyte> Thanks a lot.
20:26 < stepcut> mightybyte: you type errors will be a lot more sensible if you don't make your functions so general
20:26 < mightybyte> stepcut: Well, I'm planning to release this Auth library to the public, so I thought general would be good.
20:27 < stepcut> mightybyte: perhaps.
20:27 < stepcut> mightybyte:  for stuff like this, askSessions :: MonadReader AuthState m => m (Sessions SessionData)
20:27 < stepcut> mightybyte: I think this is actually better, askSessions :: Query Sessions SessionData
20:28 < stepcut> because no one is ever going to use askSessions in some other context except reading the happstack state.
20:28 < mightybyte> Ok, good thought.
20:29 < stepcut> mightybyte: the FilterMonad stuff is new, so I have not as certain about the downside of using less general type signatures in that context yet
20:30 < stepcut> mightybyte: also, I have some session, account, and authentication support in this module, http://src.seereason.com/happstack-extra/, not sure if there is anything useful there
20:30 < mightybyte> Ok, thanks.
20:30 < mightybyte> Is that part of Happstack?
20:32 < mightybyte> Now that I've got password hashing done, I may be releasing this Auth library soon.  At the very least, we can combine the best of the two (if mine has any redeeming quality) :)
20:33 < stepcut> mightybyte: not yet. that is where I keep stuff that isn't in happstack that i want to use in more than one app. Some stuff from it has been folded into happstack though. Like the HSP support.
20:34 < mightybyte> Ok, so an auth module is still needed?  Good thing I'm not reinventing the wheel.
20:36 < stepcut> mightybyte: dunno, I have all the code there for hash passwords, handling account creation and login, etc. And you can associate arbirtary data with the sessions and accounts.
20:36 < stepcut> I don't have session expiration / garbage  collection yet
20:36 < stepcut> and I only use SHA1 instead of SHA512 !!
20:36 < mightybyte> Yeah, I'm still missing that.
20:37 < stepcut> there are some differences. I use UserIDs so that people can change their username (if the site policy allows that sort of thing)
20:37 < mightybyte> And I'm using an iterated SHA512 as per http://www.matasano.com/log/958/enough-with-the-rainbow-tables-what-you-need-to-know-about-secure-password-schemes/
20:38 < stepcut> mightybyte: yeah, I do basic salting, but I am not convinced I am doing as much as I should be there
20:39 < stepcut> mightybyte:  I use 4 bytes of salt and then SHA1 to hash
20:39 < mightybyte> I just hacked that salting up last night, so it's by no means guaranteed to be secure, but I think it's a decent first attempt.
20:39 < stepcut> though, switching to  SHA512 should be easy
20:39 < mightybyte> Yeah
20:39 < mightybyte> And iterating it isn't hard either.
20:40 < stepcut> this is the password portion, http://src.seereason.com/happstack-extra/src/Happstack/Data/User/Password.hs
20:41 < stepcut> it's split out, since you might use passwords is several contexts (for example, if you used happstack to implement a telnet server or something)
20:41 < mightybyte> Yeah, I was thinking about doing that, but wanted to get it working quick.
20:42 < stepcut> mightybyte: sessions are here, http://src.seereason.com/happstack-extra/src/Happstack/Server/Session.hs
20:43 < stepcut> you can store any serializable data in the session
20:43 < stepcut> basic account stuff is here, http://src.seereason.com/happstack-extra/src/Happstack/Server/Account.hs
20:43 < mightybyte> Yeah, I think I set mine up that way too, although I haven't come up with a good reason to store anything other than the userid.
20:43 < stepcut> accoutns can also have arbitrary data associated with them
20:44 < stepcut> and some generic server code is here (login &  signup forms, etc) http://src.seereason.com/happstack-extra/src/Happstack/Server/Account/Server.hs
20:45 < stepcut> yeah, it depends on how you set up your site. You can store user specific stuff in their account directly, or store it somewhere else, indexed by userid
20:46  * stepcut really goes to eat dinner
20:46 < mightybyte> Heh, later.-
20:48 < stepcut> mightybyte: what happens if newSession generates a random number that happens to be a session id that is already in use?
20:48 < mightybyte> Bad things
20:48 < stepcut> I handle that in my code :)
20:49 < stepcut> though, I know a slightly better way to implement it now
20:49 < mightybyte> Yeah, other than the hashing, I haven't worked on this for quite some time.
20:49 < stepcut> you can generate random numbers inside the Update function if you know how :)
20:49 < mightybyte> Ahh, nice.
21:07 < mae> hello mortals
21:08 < mightybyte> Greetings
21:22 < mightybyte> mae: I've got an Auth module that I want to release.  Is there a place to put it in happstack, or should it have its own project?
22:19 < mae> mightybyte: auth module as in, kitten kaboodle? state and server part?
22:19 < mae> or what
22:19 < mae> component?
--- Log closed Tue Mar 31 00:00:05 2009