Experimental IRC log happs-2007-07-23

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.

06:13:29<tuxplorer>For the hello world example at http://happs.org/HAppS/doc/tutorial.html, I get the following error.. http://hpaste.org/1850
07:00:18<Saizan>tuxplorer: that's way outdated
07:00:48<Saizan>tuxplorer: http://haskell.org/haskellwiki/HAppS_tutorial <-- you should follow this one
07:01:03<tuxplorer>saizan
07:01:10<tuxplorer>can u point me to a new one?
07:01:34<Saizan>http://haskell.org/haskellwiki/HAppS_tutorial
07:02:40<tuxplorer>Saizan: That one gave me even more errors.. I'll paste them.. just a min
07:04:24<Saizan>k
07:04:35<tuxplorer>Saizan: Oh! it works.. Sorry.. I had made a mistake while pasting last time..
07:04:40<tuxplorer>Thanks Saizan :)
07:05:01<Saizan>:)
09:30:52<blackdog>so, everyone recovered from ICFP?
17:47:47<dinoMI>I'm trying to do something that needs (pretty simple) IO. Looking a the examples/simple_io_result.hs source, I tried to compile this without the MyState business. But the main = stdMain is having problems now.
17:47:56<dinoMI>Is this not doable without some kind of state?
17:48:09<dinoMI>My task is a stateless one.
17:59:00<dinoMI>Or perhaps it not being stateful in this way is undesireable in some way that I don't yet understand.
18:14:35<Saizan>what error do you get?
18:15:15<Saizan>have you noState in the list of handlers?
18:16:22<dinoMI>Not sure where I would put that in here: main = stdMain $ simpleHTTPIO "" [] evh :*: End
18:16:27<dinoMI>It doesn't look like the other examples.
18:16:35<kaol>one possible way to do it: h (Prefix ()) () $ \(path::[String]) req -> respond $ do -- You can do IO here
18:16:35<dinoMI>With the exotic HList.
18:16:36<dinoMI>:)
18:17:53<dinoMI>kaol: Ok, I'll try that.
18:21:39<dinoMI>Saizan: the error I got was: Ambiguous type variable `st' in the constraints:
18:21:53<dinoMI>Which does sound like it's expecting something because of no noState.
18:22:05<dinoMI>I just commented out the line with the put $ My $ path ...
18:22:19<dinoMI>Sorry, this is from the simple_io_result.hs
18:28:47<Saizan>:*: there is not from HList
18:28:54<dinoMI>oh boy
18:29:22<dinoMI>I thought it was as happs needed that installed. :o
18:29:36<dinoMI>But it is noticeably not in the import list.
18:30:14<Saizan>and simple_io_result.hs uses the old api
18:30:26<dinoMI>mm
18:31:12<Saizan>ACTION looks for his example of IO with the new api
18:31:41<Saizan>?google site:hpaste.org Saizan HAppS
18:34:51<Saizan>http://hpaste.org:8000/1512 <-- here it s
18:35:38<Saizan>the point, as kaol showed, is to respond an IO Result
18:35:55<dinoMI>Wow, that's quite a bit clearer than the other example.
18:36:02<dinoMI>Is this in part owed to new API stuff?
18:36:28<Saizan>yes
18:37:29<Saizan>because you no longer have the application as one monolithic function, but as a list of filters that eventually produce a response
18:37:40<dinoMI>I see. This is part of the nature of the rewrite.
18:38:36<dinoMI>So, you're saying your example there :: .... -> IO Result
18:39:21<Saizan>not quite
18:39:34<Saizan>the do block inside handler is of type IO Result
18:39:56<dinoMI>Oh, yeah, the respond. The whole thing returns a.. ServerPart?
18:40:27<Saizan>h [""] GET handler is a ServerPart, yes
18:40:31<dinoMI>having a lot of trouble with the types in general with this, but that's really an issue of me being Haskell-green still.
18:41:55<Saizan>yup, there are quite a few types to be aware of in this
18:43:36<Saizan>handler :: () -> () -> m (Either Request (IO Result)) in this case
18:45:50<Saizan>where m is Ev () Request, which is the fundamental monad of this api, () there is the type of the state which in this case is the empty one
18:48:44<dinoMI>ok
18:51:54<dinoMI>Thank you very much. This really helps quite a bit.
18:52:04<dinoMI>I've been puzzling over that other example for hours.
18:55:20<Saizan>mmh i should put this on the tutorial, probably
18:55:37<dinoMI>yes!
19:28:40<dinoMI>Hm. I tried to change 'handler () () = ...' to 'handler () rq = ...' so I can do something with the request.
19:28:56<Saizan>and?
19:29:30<dinoMI>Won't compile: Ambiguous type variable `req_msg' in the constraint:
19:29:30<dinoMI> `FromMessage req_msg'
19:29:31<dinoMI> arising from use of `h' at src/DictLookup.hs:107:9-27
19:30:44<Saizan>when it says Ambiguous type variable it means that you've not used that value in a way that the typecheker infer its type
19:31:09<Saizan>+can
19:31:27<Saizan>so, you've to either give it an explicit type annotation
19:31:32<dinoMI>I see. Probably because rq is then not used at all in the body of this function yet.
19:31:39<Saizan>exactly
19:32:23<dinoMI>Well, the other part of this is I was trying to extract something from the rq using lookS ...
19:32:31<Saizan>the types involved are very general so this can cause confusion at first, but you gain a lot of flexibility
19:32:32<dinoMI>This is in response to a POST
19:33:27<Saizan>well, that should work
19:34:36<dinoMI>Sure, compiles, but when I return some string with toMessageM, I get an error in the reply page about "URL Not Found or Bad Bosy"
19:34:40<dinoMI>"Body"
19:34:48<dinoMI>Maybe I should hpaste this.
19:35:25<Saizan>that error page shows when no handler matched
19:35:34<dinoMI>ah
19:35:36<Saizan>maybe you've forgotten to use POST as the method?
19:36:01<Saizan>like h ["path"] POST handlePOST
19:36:51<dinoMI>Changed it to 'h [""] POST $ handler'
19:37:00<dinoMI>Oh, could be the path
19:37:12<Saizan>[""] matches /
19:37:20<dinoMI>yeah
19:38:04<dinoMI>Sadly, I'm also learning some basic HTML here.
19:38:18<Saizan>hehe, all at once?:)
19:38:55<dinoMI>We were kind of caught in a situation where the job is suddenly interested in letting two of us try to build a REST service with Haskell.
19:39:07<dinoMI>My co-worker really likes the idea of using happs for it.
19:39:16<dinoMI>So, scrambling to make this work quickly.
19:39:34<dinoMI>Opportunities to do the Haskell at work, I don't suppose I have to elaborate.
19:40:22<Saizan>yeah, i see
19:40:53<dinoMI>co-worker keeps popping in but disconncting. msouth. He's at OSCON this week, listening to SPJ speak.
19:44:20<dinoMI>Ok, this is working now. Thank you for explaining what some of these errors mean.
19:44:46<shapr>yow!
19:44:53<dinoMI>Our incoming requests are going to be POST, we're pretty sure.
19:47:06<dinoMI>So, anyway, wow, this is so much clearer than the other thingy with the :*:
19:47:31<dinoMI>shapr: yow about the OSCON? I wish I was there. :/
19:47:47<dinoMI>I'm hoping SPJ whips everybody into a frenzy about the big H.
19:48:06<shapr>yeah, me too!
19:48:37<dinoMI>I'm not exactly sure how this happened at work. They had some big mgmt shake-up and new guys in charge started talking all about SOA and REST...
19:49:05<shapr>cool
19:49:13<dinoMI>and everything they say sounds like pure FP to me: composition of services, stateless behavior with no side-effects...
19:49:14<shapr>So you're writing a prototype in Haskell?
19:49:18<shapr>Yeah, REST is pure FP
19:49:27<dinoMI>so I started spamming them with email about how they need to do MORE than just glue the same old shit together with REST.
19:49:32<dinoMI>Think bigger.
19:49:42<dinoMI>And they went, ok big shot. Show us.
19:49:49<dinoMI>:o
19:50:11<dinoMI>shapr: yes
19:50:19<dinoMI>Simple REST service. Trying to use happs
19:51:27<dinoMI>So, already I owe you guys a great big ice-cream sundae or something.
19:52:10<Saizan>:D
19:52:17<dinoMI>this has not been easy so far at all. Without help, not possible.
19:55:24<shapr>I think the new SimpleHTTP will make life somewhat easier!
19:56:13<shapr>dinoMI: It's awesome that you've gotten your workplace to try Haskell!
19:57:40<dinoMI>shapr: Yeah. Also, kind of scary.
19:59:32<dinoMI>But, Saizan, that code you sent me.. it's so spare, there's nothing there. Very impressive.
20:00:07<dinoMI>I may actually be able to explain what it's doing to people.
20:00:26<Saizan>:)
20:00:40<Saizan>do-notation helps in this cases
20:09:28<dinoMI>Huh, I don't need the {-# OPTIONS -fglasgow-exts -fth #-} stuff?
20:15:29<Saizan>-fth is needed for things like $(...), th stands for template haskell, the macro system
20:16:21<dinoMI>I see. That was from prior example code I grabbed from the tutorial. That had that $() stuff in it.
20:16:28<Saizan>-fglasgow-exts enables some other extensions to the haskell 98 standard, which are probably related to the typeclasses in the examples you might find
20:22:40<shapr>wheee
20:32:17<dinoMI>msouth: Are you staying connected for now?
20:33:26<dinoMI>Good news. Simple dict lookup service works. These fine folks of #happs have been of tremendous help.
20:33:35<dinoMI>Code is actually comprehensible to me.
20:33:52<dinoMI>I have cleaned up and am putting into repo on a server the URL of which I will send to you shortly.
20:34:38<dinoMI>shapr: I will look at that SimpleHTTP too later.
20:34:44<msouth>dinoMI: sweet!
20:34:49<msouth>yeah, I'll be online now
20:35:04<dinoMI>Have you snuck backstage to hang with SPJ?
20:35:05<msouth>but a bit distracted, as I'm at SPJ's tutorial :)
20:35:08<msouth>heh
20:35:11<msouth>not yet
20:35:13<dinoMI>Oh, by all means, pay attention to him.
20:35:30<msouth>but I'm planning on asking really good questions, like "what does 'parse error' mean?" and stuff.
20:35:59<dinoMI>:P
20:52:22<dinoMI>msouth: Ok, sent you large instructional email.
21:02:20<msouth>tx
22:02:22<msouth>dinoMI: do you have the questions/answers from your #happs interaction logged? that would very likely be instructive to me
22:28:13<shapr>ACTION boings cheerfully
22:28:17<shapr>Yay, new hardware!
22:28:40<kaol>have two and a raid if you love your data
23:28:44<blackdog>ACTION has an abusive codependent relationship with his data

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