Experimental IRC log happs-2007-10-16

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.

00:00:40<nbarterd>if there were just some crude templating tools, better tools would emerge from the community and the happs core developers could concentrate their energies on more interesting things.
00:00:45<nbarterd>that's what I'm saying.
00:01:28<nbarterd>well anyway, I'd contribute stuff back.
00:01:57<nbarterd>but I need a certain base infrastructure to be able to do that.
00:02:09<Saizan>bran_: i've used it and it's not bad, hard to type, though
00:02:37<nbarterd>end rate, and going home.
00:02:46<nbarterd>s/rate/rant/
00:05:04<Saizan>nbarterd: just a question, do you know about the State and Reader monad?
00:05:11<Saizan>*monads
00:05:37<bran_>i like the django template language, and google ctemplate
00:08:05<Saizan>what do you like about them?
00:10:08<bran_>simplicity/lack of programming
00:11:26<bran_>we use cheetah on yelp, and it gets kind of fugly/complicated sometimes, even though we have pretty good mvc separation
00:11:40<nbarterd>saizan: know of, but weakly.
00:12:21<nbarterd>mainly from monad tutorial where you build up an expression evaluator. but i never got really good at using monad transformers (let alone the reader/state in their "vanilla" forms)
00:12:42<Saizan>ah, well it's just natural in haskell to handle the state with a MonadState instance
00:13:25<Saizan>and that's what happs does.. now you've one more level of indirection though..
00:14:41<Saizan>because stateful functions are transformed in events that you can raise from the IO monad to access the state
00:15:43<Saizan>you also have events that derive from a function using MonadReader, those who only read
00:19:27<Saizan>i doubt if there's a way to put this so that for example someone can use happs to learn haskell from scratch.
00:19:38<nbarterd>probably not.
00:20:22<nbarterd>actually -- i think you maybe could, except for state
00:20:51<nbarterd>who knows, once there's a "learn haskell (except state) through happs" project
00:21:02<nbarterd>some brilliant person plugs the gap for state :)
00:21:04<Saizan>you still have to know how to use IO
00:21:18<nbarterd>happs would at least have good examples for that
00:21:56<nbarterd>eg, heredoc/templates with and without io. advantages, tradeoffs, and ultimately the monad concept it's grounded in.
00:22:12<alexj>nbarterd: http://www.w3.org/TR/xslt#result-element-stylesheet
00:23:19<alexj>you use xpath to access any of the inbound xml.
00:24:21<nbarterd>what's xpath?
00:24:37<nbarterd>still doesn't really move me...
00:24:52<alexj>any template language will need a way to access elements from the data structure that is output, right?
00:25:19<nbarterd>yes
00:25:49<nbarterd>so is xsl a template language?
00:25:53<alexj>yes.
00:26:23<nbarterd>that does shed some light...
00:26:33<Saizan>what could it be?
00:26:48<nbarterd>what?
00:27:13<Saizan>err, i mean, what were you thinking xsl was?
00:27:50<nbarterd>i though it was a structure language
00:27:54<nbarterd>more like css maybe
00:28:59<nbarterd>or both structure and template. i just didn't really know.
00:30:11<nbarterd>how does happs interact with xslt?
00:30:22<nbarterd>what are the most key functions?
00:30:32<alexj>ah this is useful to know what was unclear.
00:30:32<nbarterd>packages and so on,,,
00:30:45<nbarterd>you're welcome :)
00:31:04<alexj>ok foo by default converts foo to Xml.
00:31:39<alexj>HAppS then applies the stylesheet you pick to the Xml. The XSLT then converts the XML to whatever output you want.
00:31:41<nbarterd>foo is a happs function, or in the metasyntactic variable sense of foo?
00:32:03<Saizan>the latter
00:32:04<alexj>the latter.
00:32:26<Saizan>it's the value your template needs to contruct the response
00:32:26<alexj>ok entry causes entry to be output as xml for conversion by xslt
00:32:30<nbarterd>are there library functions for this, or all in happs-begin?
00:32:55<nbarterd>i didn't realize ok had a connection to xml.
00:32:57<alexj>see the xslt function in main?
00:33:19<nbarterd>yes
00:33:45<alexj>ok converts anything to xml that is an instance of Xml and is not String, HTML, XHTML or Message.
00:34:18<alexj>it is what grabs the output xml.
00:34:33<nbarterd>is this the same as ok in earlier versions of happs?
00:34:48<alexj>don't know.
00:34:59<alexj>depends on which version.
00:35:01<nbarterd>you wrote it! :)
00:35:08<nbarterd>but allright
00:35:28<nbarterd>ok is an xml/xslt specific function
00:35:45<nbarterd>is there haddock somewhere that says this?
00:41:04<alexj>no ok is simple a function that takes it argument and produces a message.
00:41:36<alexj>look at the ToMessage instances in SimpleHTTP
00:44:57<nbarterd>I'm looking...
00:45:33<nbarterd>anything which is a ToMessage can be converted into a variety of different things.
00:46:35<nbarterd>alex, have you heard of http://www.haskell.org/haskellwiki/Slim_instance_declaration ?
00:46:58<Saizan>no, anything which is a ToMessage can be converted to a ByteString and has a Content-Type
00:47:33<nbarterd>ah, only a bytestring. ok.
00:47:48<Saizan>it happens that everything that is an instance of Xml is also an instance of ToMessage, so you can easily get a ByteString that represent your data as xml
00:49:46<nbarterd>what's an instance of Xml in Happs-Begin/Main.hs if anything?
00:54:36<Saizan>well in main it uses String for the responses
00:57:53<Saizan>UserInfo is an instance however.
00:58:54<Saizan>even if :info doesn't list that explictly..
00:59:14<nbarterd>how can you infer that?
01:00:06<Saizan>well, you can check it by trying to use toXml on a value of that type
01:00:55<Saizan>also, every type defined inside a deriveAll is an instance of Xml via generics, if i understand this correctly
01:01:17<alexj>and if you don't want to create a value, you can do (toXml (defaultValue::MyType))
01:04:18<Saizan>however i agree that those "automatic" instances are quite obfuscating
01:05:54<nbarterd>it would be less obfuscating if there wasa an example in HAppS-Begin without autoderiving, and another example to compare against it that did auto derive.
01:08:33<alexj>Saizan: you can write your own Xml instance for whatever type you want.
01:08:38<alexj>it is just a PITA and adds little value.
01:09:02<alexj>I am trying to keep the boilerplate to an absolute minimum.
01:13:12<alexj>Saizan: do you like the idea of putting the xslt functionality into haskell instead of xslt? it means that you end up using an html lib instead of angle brackets etc.
06:01:18<Dazhbog>well.. easy things should be easy.. but the easy stuff shouldn't be totally unlike the complex stuff
06:04:36<Dazhbog>also .. xslt is pretty cool but I'd be concerned with requiring people to learn/use yet another language.. I think haskell / html / css / javascript is more than enough already
06:05:00<Dazhbog>I think some kind of templates are a requirement as well
06:05:51<Dazhbog>many people do this web kind of stuff with designers .. and their output is html/css
06:06:08<Dazhbog>designers' output is html/css to be clear
06:06:58<Dazhbog>and they may want to update the design .. it should be almost as easy as replacing the template file
07:44:23<RumataEstor>Hi. Can anyone show me example of MyEntries module?
07:48:00<RumataEstor>Or is there some kind of documentation for HAppS 0.9.1?
07:48:26<alexj_>pull happs-begin again.
07:48:34<alexj_>it was missing eaelier and now it is present.
07:49:52<RumataEstor>Ok, I'll try now. Thanks =)
07:57:26<RumataEstor>haskell/Main.hs:15:34: No instances for (Data.Generics.SYB.WithClass.Basics.Data XmlD TXH.Html, Default TXH.Html, Data.Generics.SYB.WithClass.Basics.Data NormalizeD TXH.Htm l) arising from use of `ok' at haskell/Main.hs:15:34-35
08:45:23<RumataEstor2>Is "ok $ TXH.renderHtml $ TXH.h1 $ TXH.toHtml "hello world"" right workaround to make example work?
09:39:39<RumataEstor2>exit
10:07:38<RumataEstor2>I'm trying to get newest version of HaXml from http://darcs.haskell.org/packages/HaXml using darcs but get error "Unapplicable patch" on patch 1. Is there any other place where I can find the package?
10:44:07<Saizan>RumataEstor2: i'm not sure happs work with the newest HaXml
10:44:49<Saizan>RumataEstor2: and the earlier error about TXH.Html sounds like you've forgotten to update HAppS-Data
10:52:39<RumataEstor2>I didn't. I used "runhaskell" to start it. When I use ghc to compile it fails to find interface for "Types".
10:54:14<Saizan>you've to specify the right include dir if you are not in it, e.g. ghc --make -ihaskell haskell/Main.hs
11:01:31<RumataEstor2>When i start HAppS-Begin I get "main.exe: internal error: asyncRead# on threaded RTS" when I connect to with my browser.
14:57:40<Saizan>alexj: the bad side of xslt is that you've to use xml syntax for templating stuff, the inline html is fine i think, actually useful if you start with code that comes from a designer
14:59:49<alexj>not sure I understand....the bad side is xml syntax for code. the good side is xml syntax for html.
14:59:51<alexj>?
15:00:19<Saizan>yes, the other good side is automatically dispatch of templates based on tags
15:01:35<alexj>yeah. I don't have a better idea for a template language. I htink the answer is probably better documentatin.
15:03:41<Saizan>yes, even if with a similar thing in haskell we might be able to use haskell types directly instead of their xml representation.. not sure if this is a real advantage.
15:04:56<alexj>I can think of other designs for template matching that i like e.g. genshi, but building them seems hard.
15:05:51<Dazhbog>I think (I may be wrong :) that Saizan tried to say that xml would be fine for generating dynamic html content.. however, if you're working with a web designer, he/she will prolly hand you a pile of html/css which should be used for template(s)
15:06:03<alexj>genshi works by taking the current data structure and using it to manipulate html that was produced by earlier wrappers (nt sure I can explain that well)
15:06:15<alexj>Dazhbog. exactly.
15:06:30<alexj>speaking of which, I am in need of a web designer right now. any referrals here?
15:07:20<Dazhbog>alexj: so .. you have html document in intermediate (tree) data structure you pass around...?
15:08:37<Dazhbog>alexj: the structure passes through various functions each modifying it .. and in the end the tree is transformed into html
15:09:09<Dazhbog>using that model we could use types to ensure valid (x)html
15:09:20<Dazhbog>or... xml
15:09:34<alexj>dazhbog: more or less.
15:10:44<Dazhbog>with certain utility functions (I think xslt could be used as a good example) it should be viable
15:11:10<alexj>dazhbog, the art is in making it a template language rather than using haskell syntax.
15:12:43<alexj>making it in xml rather than haskll syntax or providing some nice way to absorb the stuff you get from designers.
15:13:10<Dazhbog>alexj: what kind of project do you need the design(er) for?
15:13:16<alexj>facebook app.
15:13:30<alexj>back end is written in happs. the front end is ugly.
15:13:39<Dazhbog>hmm
15:13:59<Dazhbog>do you need more than a nice layout and some graphics?
15:14:15<alexj>I need html/fbml css and graphics.
15:14:24<alexj>and a nice layout sensibility.
15:16:16<Dazhbog>you might find a stopgap solution from oswd
15:16:52<Dazhbog>alexj: is this a commercial project?
15:19:11<alexj>yes commercieal. who/what is oswd?
15:20:52<Dazhbog>http://www.oswd.org/designs/favorites/
15:22:28<Dazhbog>free designs
15:22:29<alexj>useful site, but I need a facebook app design involving layout for form fields, text fonts etc.
15:22:35<alexj>but thank you.
15:23:15<Dazhbog>anytime =)
15:26:48<Saizan>alexj: Migrate only works for states saved as Xml right?
15:27:32<alexj>saizan: more or less. I think the current default size is binary serialization of xml.
15:27:38<alexj>and it works for that.
15:28:35<alexj>lemmih is working on code rebooting now. when that goes up, migrate will happen on live memory rather than disk.
15:31:03<Saizan>ok, so to port hpaste i've to instance Serialize directly
15:52:05<alexj>Saizan: not sure. The new code does a lot of that work for you.
15:52:46<alexj>Saizan: igloo is the author or the happs migrate stuff. you might ask him if there is a better way.
16:22:45<Saizan>Igloo: ping
16:22:53<shapr>ACTION throws ping pong balls
16:24:39<Saizan>heh
16:25:39<Saizan>is there an easy way to get a New.Data instance for a type you're not defining there? e.g. Data.Sequence.Seq
16:25:57<manu3000>hello, anybody's managed to install HAppS 0.92 on a Mac ?
16:28:03<Igloo>Saizan: $( deriveData [''Seq] )
16:29:15<Saizan>Igloo: where's that from?
16:29:23<Igloo>Data.Generics.SYB.WithClass.Derive
16:29:58<manu3000>I take thats a no then...
16:30:12<Saizan>manu3000: do you have a problem?
16:30:55<Saizan>Igloo: also, does Migrate work with plain Serialize or needs Xml?
16:31:30<manu3000>saizan : well I follow the instructions from Happs Website to install the blog example
16:32:03<manu3000>saizan: but it hangs whild dowloading some modules (hangs on Hlist actually...)
16:32:52<Igloo>migrate itself just works on Haskell values, doesn't it?
16:35:57<manu3000>saizan : is HAppS 0.92 working ?
16:38:01<Saizan>Igloo: http://hpaste.org/3326 <-- still some problems on deriving.. any advice?
16:38:47<Igloo>Saizan: Give a Default instance for Seq a
16:39:21<manu3000>right i'l try the one from hackage
16:53:23<Saizan>Igloo: like instance Default (Seq a) where defaultValue = empty? becuase i still get an error with Data.Sequence.FingerTree and Data.Sequence.Elem lacking a Data instance, since the derived Seq Data instance depends on those.. so i guess the only way is to write the Data instance for Seq by hand or not derive Default for PasteState
16:54:22<Igloo>Writing the Data instance by hand won't help
16:55:07<Igloo>You also need Default instances for the other types (or you can import ....Default.Generic - I forget the exact name - to give you a default instance for all types, although it may not always be a sensible one)
16:57:13<Saizan>what you get by having Data DefaultD as superclass of Default?
21:29:39<bakert>2.1 changes to trunk, 2.0.8 to 2.0 branch?
21:31:31<Dazhbog>bakert: how are the 0.9 tutorials? =)
21:31:54<bakert>hey Dazhbog - i think i kind of decided to abandon them yesterday
21:31:54<Dazhbog>bakert: I liked your previous ones
21:31:57<bakert>thanks
21:32:16<Dazhbog>hmm.. giving up?
21:33:33<bakert>i think 0.9 is still too much in flux
21:33:44<bakert>i spent a few hours trying to get hello world going to no avail
21:34:06<bakert>nbarterd and Saizan seemed to manage it between them yesterday after alexj made some changes to the codebase for them to pull :)
21:34:32<bakert>but my haskell is pretty rudimentary so i never know when i hit a bug or a missing bit of functionality ... i think it's my fault :)
21:35:28<Dazhbog>I understand
21:35:38<Dazhbog>I'm not much further myself
21:35:42<bakert>Dazhbog: perhaps you can convince me that HAppS is a goal worth pursuing? I keep trying to believe that when I "get it" it will be wonderful. But I am losing faith.
21:36:01<Dazhbog>hmm
21:36:18<bakert>I am beginning to think that it is perhaps more somebody's illustration of some neat ideas rather than a working framework exactly.
21:36:28<bakert>the MACID stuff and so on.
21:36:31<Dazhbog>my words don't have much weight
21:36:47<bakert>But neither do I want to write Haskell CGI programs. Nor do I want to write non-web apps.
21:36:58<bakert>So if I give up HAppS I am sort of giving up on Haskell by proxy :(
21:37:03<Dazhbog>yes.. how about wash?
21:37:04<bakert>Which I don't want to do.
21:37:21<bakert>Dazhbog: I looked at WASH a little before. It's not under active development though, is it?
21:37:30<Dazhbog>I don't know
21:37:44<Dazhbog>also it's kind of it's own language... I think
21:37:51<Dazhbog>built on haskell
21:37:59<bakert>two bug fixes this year only.
21:38:04<bakert>so i guess it's fairly dormant.
21:38:51<Dazhbog>this is depressing.. I'd so much want to like haskell and do something with it..
21:39:03<Dazhbog>but my real world 'somethings' are web apps at the moment
21:40:02<Dazhbog>oh well.. maybe it's not wise to talk like this here..
21:40:40<Dazhbog>I wouldn't want to demoralize the happs developers (like they would care a shit what a noob like me talks =)
21:42:54<Dazhbog>anyway.. maybe I can come back after a while (months maybe) and find a bit more mature happs and start building something on it =)
21:44:08<bakert>well alexj is clearly forging ahead with HAppS based on his own needs. i'm sure he's a very bright guy so something very good might come out of that. but like you surmise i'm not sure it's ready for other developers to use yet.
21:44:21<bakert>that said, glguy seemed to write hpaste.org in the 0.8 version
21:44:29<bakert>so if you are a haskell whizz maybe ..
21:46:46<Saizan>i'm going to port it to 0.9 by the end of the week
21:47:43<bakert>Saizan: port what? hello world?
21:48:09<bakert>oh sorry hpaste
21:48:10<bakert>:)
21:48:34<Saizan>yeah hpaste
21:49:18<bakert>you're a brave man :
21:49:19<bakert>:)
21:55:54<Dazhbog>I'm looking forward to .. something interesting =)
21:57:27<Dazhbog>but now .. I need to sleep
21:57:58<Dazhbog>g'nite
22:41:27<Saizan>for example i don't get why method is the only primitive that doesn't take a ServerPart.. probably to go along with ok

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