Experimental IRC log happs-2007-07-29

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.

05:43:42<kaol>could we please have redirect in HTTP/Types.hs not fix on having 302 return code?
06:06:20<kaol>grr, there's something in my code that makes the request type into an IO Request...
06:16:46<tuukkah>kaol, API-wise, would it make sense to use sresult with the code you want and setHeader "Location"?
06:17:31<tuukkah>since not all codes mean redirect
06:19:17<kaol>I guess sresult would do for my code.
06:19:31<kaol>but not all redirect codes are 302
06:20:43<tuukkah>i suppose normally you're meant to use seeOther and moved
06:26:11<kaol>respond $ is about the first thing I do since I want to do IO. That makes using most of the things in SimpleHTTP2 a bit difficult.
12:43:23<Pupeno>Hello.
12:44:20<Pupeno>The tutorial uses basicFileServe, but it seems to be commented out, at least the export, in happs-0.8.8+darcs20070523. Is it commented out in happs-0.8.8 as well?
12:44:54<kaol>use fileServe
12:46:08<Pupeno>kaol: where is it?
12:46:26<kaol>h (Prefix ["s"]) GET $ respIO $ fileServe "s"
12:46:45<kaol>or something like that
12:47:18<kaol>HAppS.Protocols.HTTP.FileServe, but import HAppS pulls that in too
12:52:30<Pupeno>Thank you.
12:54:36<kaol>apparently we're all too lazy to update the wiki
12:54:55<Pupeno>Do you mind if I update it?
12:55:32<kaol>certainly not
12:55:50<Pupeno>How can I kill a running happs when in ghci (in emacs)
12:55:51<Pupeno>?
12:57:38<tuukkah>at least normally it dies if you enter e
13:00:22<Pupeno>seems not to do that her.
13:00:24<Pupeno>here.
13:01:16<tuukkah>do you use stdMain?
13:05:10<Pupeno>No.
13:06:37<tuukkah>that could explain it
13:10:39<Pupeno>how do you use stdMain?
13:12:54<tuukkah>or stdHTTP directly like the tutorial does
13:13:58<tuukkah>(we have "main = stdMain $ (\conf -> simpleHTTP handlers $ conf {bodyLimit=64*1024*1024}) :*: End")
13:14:49<tuukkah>("stdHTTP impl = stdMain $ (simpleHTTP impl) :*: End")
13:16:09<Pupeno>I'm using stdHTTP.
13:19:15<tuukkah>i don't know why inputting e wouldn't work :-(
13:23:09<Pupeno>maybe I don't know what "inputting e" means.
13:26:36<tuukkah>if i start a happs application from the command line, press the 'e' key and the 'enter' key, the application exits cleanly
13:44:03<Pupeno>mmhh... I'll look into that latter... running from the terminal I can just C-c and that's it.
13:45:09<Pupeno>I am trying to grab a POST value, that is, I'm running that example from the tutorial. I made a form that sends a newVal, but I get in the terminal "HTTP request failed with: failed to parse HTTP request" and in the browser: URL Not Found or Bad Body.
13:45:16<Pupeno>Any ideas what may I be doing wrong?
13:46:43<Pupeno>oh! found it!
13:52:46<tuukkah>what was it?
14:14:39<Pupeno>the name of the input field wasn't the same as the parameter to lookMbRead.
14:15:16<tuukkah>a somewhat misleading error message then :-/
14:16:06<Pupeno>yes.
16:45:26<Pupeno>Hello.
16:46:51<Pupeno>Trying to compile "3.3.1 Haskell to XML with ToElement, XML to Haskell with FromMessage" I get lot's of errors, starting with: 30:21: Not in scope: `plain'.
16:52:48<Pupeno>If I just remove plain, the error messages get much more cryptic.
16:56:10<tuukkah>well, type errors are nothing new ;-)
16:56:32<tuukkah>you just need find a way to fit the blocks together properly :-)
17:04:14<Pupeno>tuukkah: after spending an hour and a half at it, it seems that instead of bricks, they are puzzle pieces.
17:04:50<tuukkah>i have to agree with you on that one :-(
17:06:11<Pupeno>ACTION really would like to use Haskell, but each step ends up feeling so hard.
17:06:53<tuukkah>that's the price to pay for using a language that's not too stupid for you
17:11:58<tuukkah>so, a path full of challenges indeed
17:22:08<fxr>tuukkah: http://hpaste.org/1900#a3 here I changed the type signature but got another problem, any ideas?
17:26:49<tuukkah>fxr, it does compile here: latest happs from darcs and ghc version 6.6
17:27:39<fxr>oh
17:27:55<fxr>I have latest happs and ghc 6.6 too
17:29:04<tuukkah>so you get "No instance for (MonadState MyState (Ev MyState Request))" although HAppS/MACID/Monad.hs has "instance MonadState st (Ev st ev)"
17:32:25<fxr>yeah, weird things goin on here
17:33:26<tuukkah>if you just start ghci and load the modules HAppS and Control.Monad.State, if you look at MonadState it should list the instance
17:34:29<tuukkah>(with commands :m and :i)
18:16:26<kaol>hmm... should 'setCookie minBound "cookiename" ""' remove a cookie?
18:18:24<tuukkah>probably
18:19:05<kaol>I only get session cookies that way. :-/
18:19:50<kaol>setting it to 1 second makes it go away in one second, but that's not quite the same thing
18:20:01<kaol>and negative values apparently create session cookies
18:20:10<tuukkah>well, 0?
18:20:49<kaol>I'd like to use a large negative value, since the client may have a skewed clock...
18:21:03<kaol>or... hmm.
18:21:21<kaol>do they set the expire time as absolute time stamp, at all
18:23:31<kaol>I guess using 0 and handling the case with empty cookie values the same way as when there's no cookie at all works
18:26:38<kaol>yay. Logging in and out works now.
18:28:47<tuukkah>the cookie rfc's specify max-age in seconds instead of an expiry date
18:29:25<kaol>ACTION nods
18:30:50<kaol>still, it would be cleaner if setCookie used a Maybe Int instead of interpreting negative values as session cookies. It tastes like something I would see in a C library.
18:30:53<tuukkah>oh and that's what we use
18:31:21<kaol>Haskell's type system is better than that ;-)
18:31:43<tuukkah>so setCookie 0 does the right thing
18:32:34<tuukkah>or does the browser still keep the cookie for one second?
18:33:44<kaol>ACTION still petitions for setCookieEx :: Monad m => Maybe Seconds -> Cookie -> Result -> m Result
18:34:13<tuukkah>sure a maybe value would be more correct
18:34:53<tuukkah>but we'd like to restrict to positive integers :-)
18:35:09<kaol>and it makes the function injective, too :-P
18:41:41<tuukkah>but what to do if the time value is negative, throw an expection?
18:42:24<kaol>the client will treat that like the 0 case
18:42:59<tuukkah>does the rfc say that?
18:43:37<tuukkah>"The delta-seconds value is a decimal non-negative integer."
18:43:49<kaol>oh, ok.
18:44:41<kaol>I'll concede the point. Can't argue with an RFC. But I'd still like the clearer semantics of not having negative values equal no value at all.
18:45:06<tuukkah>me too
18:45:30<kaol>I was just confused by apache's behaviour. It happily accept negative values and treats them as 0.
18:45:52<kaol>the morale of the story is that apache sucks.
18:45:56<tuukkah>apache?
18:46:22<kaol>I've been using apache and mod_perl too much already.
18:46:35<tuukkah>as a http client?
18:46:36<kaol>and that's what I'm comparing most anything I'm running against
18:46:40<kaol>no, as a server
18:46:58<kaol>and what it accepts as a cookie's timeout value
18:47:14<kaol>as set via mod_perl
18:48:19<tuukkah>i was going to suggest that as an alternative way to handle negative values, but decided it would be too confusing :-)
20:06:18<kaol>I'm using lookM and getCookieValue almost side by side and can't help but notice a wart of sorts... They both take a request and key value, but in a flipped order.
22:28:30<blackdog>writing a program to parse PHP and translate it to haskell in order to avoid reading PHP is probably being a bit silly, right?
22:41:10<blackdog>morning shae
22:41:40<shapr>g'day blackdog
22:42:32<blackdog>hey, is anyone else working on facebook apps in haskell?
22:42:43<blackdog>don't want to duplicate work in porting...
22:43:18<shapr>Do you have a working facebook app in Haskell?
22:43:29<shapr>I'd like to try it.
22:43:29<blackdog>nah - am porting my crappy PHP one
22:44:02<blackdog>PHP code is driving me nuts - even the library they distribute is sorta crappy and redundant.
22:44:22<blackdog>i'm having strong impulses to start playing around with SYB and that sort of thing - it's pretty mechanical code
22:44:34<blackdog>have you done much REST stuff with HAppS? I've never really coded it directly myself.
22:44:49<shapr>Have you seen the generic-xml package?
22:45:02<shapr>It uses SYB to do really cool automatic XML <-> Haskell mappings.
22:45:22<blackdog>hm
22:45:28<blackdog>that sounds almost exactly what i want
22:45:35<blackdog>i'll check it out, thanks
22:45:53<blackdog>how're things, anyway? what are you hacking these days?
22:45:57<shapr>HAppS mostly
22:46:09<blackdog>oh, is that roadmap out yet?
22:46:14<shapr>My girlfriend has been here for the past six weeks, I spent all my time with her.
22:46:19<blackdog>i still wanna hear your persistence and sharing story
22:46:21<blackdog>uh huh :)
22:46:30<shapr>The roadmap will very likely be out next week.
22:46:41<shapr>I think it would have been out this week if I hadn't hurt my knee.
22:46:49<shapr>I couldn't take focus meds while taking steroids :-(
22:46:57<blackdog>oh, right.
22:47:11<blackdog>i was gonna make some smartarse comment about knee-operated keyboards, but that's fair enough
22:47:19<shapr>heh
22:47:21<blackdog>how'd you hurt it?
22:48:06<shapr>trying to show off for my girlfriend on my unicycle :-)
22:48:18<blackdog>colour me surprised
22:48:52<blackdog>angela keeps wiping herself out - I've never seen anyone so accident-prone
22:49:16<shapr>cycling?
22:50:19<blackdog>nope. just walking.
22:50:23<blackdog>or playing frisbee
22:50:49<blackdog>she managed to break her nose _and_ twist her knee in a collision with a guy on the frisbee field
22:51:01<blackdog>sorry, her ankle
22:51:23<blackdog>hm. got an example of generic-xml use?
22:52:14<shapr>Not offhand
22:52:27<shapr>Wow, nose and ankle at once
22:53:06<blackdog>yeah. she says she's just unco, but she's pretty sporty - i'm half convinced she's got a deathwish.
22:53:36<blackdog>jeez, this is perverse - am abusing emacs regexes to semi-automatically turn PHP to haskell - it's not pretty, dude :)
22:55:40<sorear>I'm cloning (as much as I need of) the Windows Installer in Haskell.
22:55:57<blackdog>Really? What for?
22:56:04<blackdog>i thought that's what cabal was for...
22:56:18<sorear>Cabal can't handle .msi files. :)
22:57:11<blackdog>so you want to create an .msi file in haskell, then?
22:57:25<blackdog>ah, bugger. 9am = unfun paid work time. oh well...
22:57:28<sorear>no, unpack one...
22:58:25<sorear>I can't imagine creating a tarball instead would have been that much more work for this guy. I mean, it's not even an installable program, just a bunch of human-readable text files with no intended location.
22:58:47<sorear>(specifically, Georges Gonthier's formal proof of the four-color theorem)
23:01:07<blackdog>oh jeez
23:01:11<blackdog>that's just broken.
23:03:30<sorear>And SPJ distributes GHC as a tarball, so obviously there's no MSI-only rule at MSR. :)
23:04:03<sorear>byech. this would be so much easier with something like ML functors...
23:04:36<sorear>ACTION holds his nose and unsafePerformIO $ B.readFile "/var/cache/stefan-downloads/4ct.msi"
23:35:34<blackdog>filthy boy

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