--- Log opened Sat Feb 14 00:00:13 2009
00:13 < dsrogers> anyone here?
13:55 < mae__> i am here :)
13:55 < mae__> but it is valentines day
13:55 < mae__> so not for long
14:04 < dcoutts> mae__: heh heh :-)
14:17 < mae__> dcoutts: i don't know where your at, but as far as what your doing with the server and webpart cleanup
14:17 < mae__> try to find a stopping point by the end of the month
14:17 < dcoutts> hmm?
14:18 < mae__> I think the release date for 0.2 will after the first week in march
14:18 < dcoutts> mae__: I've not touched the hackage-server for some time
14:18 < mae__> because I need also from you, a synopsis/writeup on the items changed
14:19 < mae__> hackage serer?
14:19 < dcoutts> mae__: are you confusing me with someone else?
14:19 < mae__> oh yeah i am
14:19 < mae__> shit
14:19 < mae__> dsrogers
14:19 < mae__> sorry
14:19 < dcoutts> np :-)
14:19 < dsrogers> hi
14:19 < mae__> so what are you doing for valentines day?
14:19 < mae__> dsrogers: darcs get http://src.seereason.com/examples/happs-hsp-quickstart/
14:19  * dcoutts will be making some nice dinner
14:19 < mae__> um
14:19 < mae__> wow wrong cut / paste
14:19 < dcoutts> ;-)
14:20 < mae__> dcoutts: same thing, making shrimp scampi, me and my wife are having like a dinner party
14:20 < dsrogers> oh nifty.  more docs.
14:20 < mae__> dsrogers: i don't know where your at, but as far as what your doing with the server and webpart cleanup, try to find a stopping point by the end of the month, because I want to release 0.2 in the first week of march
14:20 < dcoutts> btw, will either of you be making it for the Hackathon ?
14:21 < dsrogers> mae: I should have a patch ready this weekend.
14:21 < dsrogers> but I'll keep that in mind :-)
14:21 < mae__> dsrogers: and I still will need a synopsis/writeup of any semantic or coding changes + examples for the release notes, as we discussed before.
14:21 < dsrogers> yep
14:21 < dsrogers> that I'll have soonish after, but before the end of the month.
14:21 < mae__> dcoutts: the one in europe?
14:21 < mae__> prob not :(
14:21 < dcoutts> mae__: ah well
14:21 < dcoutts> long way if you're across the pond
14:22 < mae__> the pond, lol
14:22 < mae__> yep
14:22 < mae__> us americans in our third-world country :)
14:22 < dsrogers> I'm working on the patch for WebT right now.  I figured out applyFilter and also wrote a getFilter.
14:23 < dsrogers> now a lot of the type signatures have changed to use the new typeclasses.
14:23 < dsrogers> so it's just a bunch of shuffling at this poitn.
14:24 < dsrogers> I'm also amused at the number of layers:
14:24 < dsrogers> mkWebT = WebT . ErrorT . FilterT . WriterT . MaybeT
14:25 < mae__> hehe
14:25 < mae__> and WebT can string an IO monad through it right? :)
14:26 < dsrogers> yeah, of couse.  It even implements MonadIO
14:28 < dsrogers> actually it's a transformer.
14:28 < dsrogers> so you can add to the stack as much as you want.
14:29 < mae__> heh
14:29 < mae__> what does WriterT do?
14:30 < dsrogers> WriterT is for computations that produce something "on the side"
14:30 < dsrogers> in this case FilterT is just a wrapper for a WriterT with a paticuarl "on the side" type
14:30 < mae__> ic.
14:32 < Saizan__> do we need to expose the FilterT type?
14:32 < dsrogers> probably not.
14:32 < dsrogers> well....
14:32 < dsrogers>  maybe.
14:33 < dsrogers> at the very least you need mkWebT and ununWebT which will completely unwrap and wrap back up the monad.
14:33 < dsrogers> with those two, you can at least write new instances for WebT without knowing all the layer stacks.
14:34 < dsrogers> but in some cases, you might have to know the structure of your MonadTrans in order to write combinatory instances.
14:34 < dsrogers> see the instance of MonadError, for example.
14:35 < stepcut> mae__: that happs-hsp-quickstart is a bit out of date. Though it does demo dynamic template loading.
14:35 < dsrogers> OTOH, you might be saying "can we make FilterT a "type""
14:35 < dsrogers> yes, we can.
14:35 < stepcut> mae__: I was going to write a newer version that just demos Happstack+HSP
14:35 < Saizan> no, the first answer was more what i was asking :)
14:36 < mae__> stepcut: I want something like that in before 0.2
14:36 < mae__> i am working on it right now
14:36 < mae__> I want basic support for hsp + hstringtemplate
14:37 < Saizan> mae__: did you use "base > 3" instead of "base >= 3" for a specific reason in happstack.cabal?
14:37 < stepcut> mae__: ok, very little is needed, one moment
14:37 < stepcut> mae__: also, if you are pulling things from src.seereason.com, be sure to check in the ghc610 directory first. That will be changing next week, but right now that is where the latest stuff lives for a number of packages
14:38 < mae__> Saizan: not really, I just was trying to get it to build on windows ghc 6.8.3, I am not that familiar with what is needed for ghc 6.8.3 support in general.
14:38 < mae__> stepcut: basically I want to add a module to happstack
14:39 < mae__> that gets uses in tandem with the project skeleton
14:39 < mae__> maybe Happstack.Templates or something
14:39 < stepcut> mae: the minimum you need to use Happstack+HSP is probably this, http://src.seereason.com/ghc610/HAppS-Extra/src/HAppS/Server/HSP/HTML.hs
14:39 < stepcut> which adds ToMessage instances that work with with HSP's XML stuff
14:40 < mae__> right
14:40 < stepcut> also, I submitted my patches back to HSP so that the HSP at seereason will be the same as upstream
14:40 < mae__> so basically I want a folder templates
14:40 < mae__> for hstringtemplate
14:40 < stepcut> i didn't realize I had not done that -- I think I had to wait for a patch to HAppS to be committed, and then I forgot
14:40 < mae__> but I know that kind of thing won't really work for hsp, since it creates a haskell module
14:41 < mae__> so I'm debating whether I can really treat those two in a similar fashion
14:41 < mae__> hstringtemplate doesn't support static compilation
14:42 < mae__> as I understand it, hsp pages would be the same as haskell modules
14:42 < mae__> so they would be in the module namespace
14:42 < stepcut> right
14:42 < mae__> so they would need to be under src
14:42 < stepcut> in many respects HSP is almost exactly like Text.Html, except you get a special syntax you can use
14:42 < mae__> right
14:43 < stepcut> but, the trhsx preprocessor just turns that syntax into normal Haskell code
14:43 < mae__> stepcut: does trhsx work on windows? without special fidgeting?
14:43 < mae__> i know on linux i had to ad ~/.cabal/bin to my path
14:43 < mae__> probably have to do same on windows
14:43 < stepcut> mae__: no idea
14:43  * stepcut just does apt-get install trhsx and is done with it :)
14:44 < mae__> but you had to setup the bin path at one point, right?
14:44 < stepcut> no, the .deb installs trhsx into /usr/bin/trhsx
14:45 < mae__> ok
14:45 < stepcut> the only thing special for HSP (aside from PATH issus) is the module instances. The tricky question is where to put those. If we add them to the happstack, then that package would depend on the whole HSP stack -- which is a bit annoying if you don't plan to use HSP
14:46 < stepcut> probably a package like, happstack-hsp, would be good, even though it is such a tiny amount of code, since the dependencies are not trivial.
14:46 < mae__> nah, not in happstack
14:46 < mae__> um
14:46 < mae__> your suggesting creating yet another package? :)
14:46 < dsrogers> well this is neat...  I have to delete a bunch of type signatures because they became more polymorphic
14:47 < stepcut> mae__: yes, the only existing package that it can go in is happstack
14:47 < mae__> stepcut: have you seen this? http://patch-tag.com/publicrepos/happstack/happstack/templates/project
14:48 < mae__> stepcut: so semantically, happstack-hsp would be integration between -server and hsp
14:48 < stepcut> exactly
14:48 < mae__> you know what though
14:48 < mae__> I am ok with happstack depending on hsp
14:49 < mae__> because i see hsp and hstringtemplate as builtin/default options
14:49 < mae__> if more are added in the future, then we can create extra packages for those
14:49 < stepcut> me too, but that is because I use HSP :) Maybe I am not so exciting about hstringtemplate ;)
14:49 < mae__> stepcut: hstringtemplate is for everything that hsp cannot do
14:49 < stepcut> hsp can do everything :p
14:49 < stepcut> ;)
14:50 < mae__> i.e. txt files, or atom, or javascript even
14:50 < mae__> isn't hsp xml only?
14:50 < mae__> xml / html
14:50 < stepcut> the HSP family includes javascript combinators
14:50 < stepcut> but, yes, the normal HSP stuff is just xml
14:51 < mae__> hm
14:51 < Saizan> do you have an example of using hstringtemplate handy?
14:51 < mae__> nope, not yet
14:51 < mae__> so I gotta ask a really dumb question that was never clear to me
14:52 < stepcut> mae__: how would you feel about some simple flags in the .cabal to disable compilation of HSP and HStringTemplate? Enabled by default, but available as a way to skip those packages if you are installing from source and don't want them
14:52 < mae__> what additional functionality does ServerPartT provide over WebPartT
14:52 < Saizan> mae__: access to the Request
14:53 < mae__> stepcut: I would feel that this would be silly, happstack is the "kitchen sink package" which includes code generation etc. If you really don't want the kitchen sink, then you don't have to install happstack (meta)
14:53 < koeien> HStringTemplate, :(
14:53 < dsrogers> though we need some functinos to make this easy
14:53 < dsrogers> getRequest  or setHeader
14:53 < stepcut> mae__: but, maybe you only want part of the kitchen sink?
14:53 < dsrogers> without having to pass the rq
14:54 < mae__> stepcut: then you can install the pieces you want individually, i.e. happstack-server and happstack-state, since your probably not using my code generation tool anyways
14:54 < mae__> but with happstack (meta) the code generation tool will assume you have hsp / hstringtemplate
14:54 < mae__> so without that stuff the skeleton will not even work
14:54 < stepcut> mae__: right, but didn't we just decide to put some essential instances for HSP in happstack?
14:55 < stepcut> aka, the ToMessage instances for HSP?
14:55 < mae__> stepcut: correct.
14:55 < mae__> stepcut: so to answer your question, no, I don't think those flags really make too much sense
14:55 < mae__> happstack is for the lazies who want to get started fast
14:56 < Saizan> so, the users will have two choices: 1) install everything, 2) duplicate the HSP instances in your code
14:56 < mae__> Saizan: why would they do that if they already installed everything?
14:56 < mae__> happstack will have a module which has the instances
14:56 < mae__> (i'm not talking about generated code)
14:56 < Saizan> those are mutual exclusive choices..
14:57 < Saizan> *mutually
14:57 < mae__> um
14:57 < mae__> well ok
14:57 < mae__> Saizan: why would #2 not choose to 'install everything'
14:57 < mae__> i mean sure, maybe they don't use hstringtemplate
14:57 < Saizan> because he doesn't use hstringtemplate or code generation or whatever else
14:57 < mae__> for example, but its splitting hairs
14:57 < dsrogers> would it be bad to lift the monomorphism restriction in simpleHTTP?
14:57 < mae__> code generation is not required, it is just there if you want it.
14:58 < stepcut> mae__: but it's also there if you don't want it :)
14:58 < koeien> disregarding the fact that i dislike code generation, what is the problem?
14:58 < mae__> stepcut: theres lots of stuff in your windows or nix operating system that you don't want / neeed, but you don't go through it with a fine tooth comb and purge it. hard disk space is not expensive :)
14:58 < koeien> a few KB/MB
14:59 < stepcut> mae__: if everything cabal installs from hackagedb, then it is ok, but people have complained that installing HSP is too hard...
15:00 < stepcut> anyway, we can just wait and see if people complain or not
15:00 < mae__> stepcut: right, well, it is a requirement that everything installs from hackagedb no? Are you referring to those who choose to not use cabal, for instance? debian packages?
15:00 < Saizan> dsrogers: not particulary, but we need to have type signatures for toplevel symbols anyway
15:01 < stepcut> mae__: I have no idea why people have a hard time installing HSP
15:01 < stepcut> mae__: anyway, let's just wait and see what happens
15:01 < stepcut> it's easy to change things later
15:01 < dsrogers> Saizan: this is not a simple case.
15:01 < dsrogers> Saizan: let me paste
15:01 < stepcut> mae__: I think I am not use to having cabal install around :)
15:02 < Saizan> heh, back in the days..
15:02 < dsrogers> http://hpaste.org/fastcgi/hpaste.fcgi/view?id=1395#a1395
15:02 < stepcut> Saizan: yeah, back in the day we didn't even have hierarchical module names, much less cabal ;)
15:02 < koeien> dsrogers: why not copy/paste it from the ghc output?
15:02 < stepcut> installing anything involved editing the Makefile until it worked on your system
15:03 < koeien> or from the ghci output
15:03 < dsrogers> koeien: I did.
15:03 < stepcut> despite my complaints about cabal, it is 100x better than they way things were before
15:03 < mae__> ok regarding the whole "i don't want to install the happstack package because I don't use code generation", come on! you don' t have to use it. and yeah, if people complain that they don't want happstack but they do want hsp support, then we can always split it out later.
15:03 < Saizan> ah, Cabal was already there when i started using haskell, not cabal-install though
15:04 < mae__> and regarding the whole code generation tool -- you guys not liking it -- i don't like it either -- rather it is not something I will use myself.
15:04 < koeien> dsrogers: how can you get the monomorphism restriction then :/ appearantly my understanding of it blows
15:04 < mae__> but at the same time, giving a simple starting point to beginners will bring alot more users
15:04 < mae__> IMO
15:05 < koeien> that's not really an opinion :)
15:05 < Saizan> dsrogers: those definitions have a type signature or not in the source?
15:05 < mae__> I could be wrong, but my whole thought is just that I want it to be less painful to use, the learning curve right now is like going up a cliff
15:05 < mae__> koeien: what do you mean? :)
15:05 < koeien> i dislike it, but i would not complain about a few more bytesx used on my harddrive
15:05 < Saizan> dsrogers: if they have one, and it's correct, i don't see how the MonomorphismRestriction applies
15:05 < dsrogers> not in the source.  I removed them because the became wrong.  Was going to wait until I compiled everything and get GHC to tell me the new ones.
15:06 < koeien> mae__: you are stating that if there exists code generation, we will have more users than if we don't have it. that is not an opinion, but something we could (in theory) measure ;)
15:06 < Saizan> dsrogers: ah, ok, then :set -XNoMonomorphismRestriction in ghci, so that you can copy/paste back
15:07 < koeien> mae__: but n/m
15:07 < dsrogers> I can't get simpleHTTP.hs loaded in GHCI
15:07 < stepcut> mae__: I have two suggestions for the main function in the template: (1) it should create a checkpoint on shutdown (2) it should have a cron job that creates checkpoints
15:07 < dsrogers> it complains about hidden stuff.
15:07 < mae__> koeien: yeah I see your point, but I think it will bring more users :) even if it is not measurable, it is my instinct :)
15:07 < mae__> stepcut: Agreed, the whole checkpoint thing on shutdown I avoided, and here is why:
15:08 < dsrogers> oh mn.
15:08 < dsrogers> i just tried something, and it worked.
15:08 < koeien> mae__: i think a lot of examples (of increasing complexity) would also help, and have the same effect :) (that's my instinct :)
15:08 < stepcut> mae__: also, I don't mind the code generator / template thing. I like that part -- it's a good way to establish best practices.
15:08 < mae__> I figured that fast shutdown is preferable to a slow shutdown in many cases, because sometimes people kill processes (or the os does) when they are trying to shutdown and it is taking too long..
15:08 < Saizan> dsrogers: you've to start ghci from happstack/happstack-server/src/
15:09 < stepcut> mae__: slow startup makes the process look hung, how would you feel about having some messages printed on stdout/stderr?
15:09 < dsrogers> I set -XNoMonomorphismRestriction but now :r is giving me the same problem.
15:09 < stepcut> mae__: this is the main function I use: http://src.seereason.com/happstack-extra/src/Happstack/Server/Main.hs
15:09 < koeien> stepcut, mae__: and what about logging in general?
15:09 < mae__> koeien: true, this is for the long term, I guess this idea focuses more on the first 10 minutes of experience. I think if people can't get it up and running in a certain amount of time, they get frustrated and move on to something else. It is the "first impression" that this is targetting really.
15:10 < stepcut> mae__: I, personally, like to have happs print a message once it is really up and server pages so I know that I can load the page now...
15:10 < Saizan> dsrogers: try enabling it in the file
15:10 < mae__> stepcut: you should try running the template, it does print messages. I turned on the logging facilities that are already there.
15:10 < Saizan> dsrogers: but maybe the error is caused by something else
15:11 < koeien> stepcut: yes, i would like more log messages in general (like Apache)
15:11 < mae__> logging: i turned on logging in the template i created, there is already quite a bit of logging using hslogger in -state and -server already
15:11 < mae__> seriously, try out the template i made
15:11 < koeien> ah ok. then i missed that :)
15:11 < mae__> bin/run.sh
15:11  * stepcut has never used the hslogger stuff in happstack-server
15:11 < mae__> all the stuff i did to turn on logging
15:11  * koeien will start
15:11 < mae__> is in AppLogger.hs
15:11 < dsrogers> you're not allowed to set NoMonoMorphismRestriction without restarting ghci
15:13 < dsrogers> ah got it.
15:13 < dsrogers> I'm still not sure what's causing it, but I have my type signatures now.
15:13 < dsrogers> and my patch compiles.
15:13 < stepcut> mae__: I think that checkpointing on shutdown might be better, because certain migrations only work right if you don't have any events since the last checkpoint?
15:13 < dsrogers> thanks for the help!
15:13 < dsrogers> off to the movies, though
15:14 < koeien> stepcut: this can be ok as long as a message is printed somewhere
15:14 < koeien> some applications do this, such as lighttpd
15:14 < koeien> "Graceful shutdown started"
15:14 < stepcut> koeien: that is my feeling, "Server is shutting down, this may take a while."
15:14 < koeien> yeah that is fine
15:14 < stepcut> koeien: though, if it does take a while, then maybe you need to run your cron job more often :)
15:15 < koeien> as long as it's not ridiculous :)
15:15 < mae__> right now the logging tells you that it is checkpointing
15:15 < stepcut> mae__: does the logging show up on standard out?
15:15 < mae__> but yeah ok, so checkpoint on shutdown instead of startup
15:15 < koeien> mae__: i don't see the run script
15:15 < mae__> thats fine
15:15 < mae__> stepcut: yes it does
15:15 < mae__> koeien: bin/run.sh
15:15 < koeien> mae__: it's absent here :(
15:15 < stepcut> mae__: and, how do you feel about having a default cron job that does checkpoints?
15:15 < mae__> eh?
15:16 < mae__> stepcut: thats fine, but just try to keep the template terse and to the point in general
15:16 < mae__> more comments is certainly needed also
15:16 < mae__> since it is meant to instruct
15:16 < koeien> mae__: ah other folder
15:16 < koeien> n/m
15:16 < mae__> also, i need to make a .bat version of those scripts also
15:16 < mae__> but haven't done that yet
15:16 < mae__> :)
15:16 < mae__> (for windoze)
15:16 < mae__> also, I wanted to turn run-interactive into something useful
15:17 < stepcut> mae__: right. It is my belief that all happstack applications that use state should do periodic checkpoints, so putting it in the default main seems like a good place to instruct on that
15:17 < mae__> like, be able to interactively query the state and whatnot
15:17 < mae__> just needs a little tweaking
15:17 < mae__> possibly a different main.hs file
15:17 < koeien> it would also be nice to able to easily export the whole state into XML or plaintext where possible :)
15:17 < mae__> ideally, if we can work out reasonable defaults, perhaps Main.hs should be a module in happstack
15:17 < mae__> so the user doesn't have to worry about it
15:18 < mae__> koeien: i agree, this is something i want to do later.
15:18 < stepcut> mae__: that is how we do it at seereason. We just important that Main.hs
15:18 < stepcut> s/important/import/
15:18 < mae__> stepcut: right
15:18 < mae__> so the issue is
15:18 < mae__> can we standardize main.hs
15:19 < mae__> i mean of course people can build a home brewed one from the diff packages
15:19 < stepcut> koeien: exporting as XML should be pretty easy using the existing happstack-data stuff. In fact, the state used to be serialize as XML by default.
15:19 < mae__> but for kitchen sink people
15:19 < koeien> stepcut: yeah i know :)
15:19 < stepcut> koeien: :)
15:19 < koeien> but why was XML abandoned? performance?
15:19 < stepcut> koeien: probably
15:19 < stepcut> koeien: and size?
15:19 < koeien> yeah the gzread it :)
15:20 < koeien> then*
15:20 < mae__> ok getting in the shower
15:20 < mae__> bbl
15:20 < stepcut> mae__: I have make command-line interfaces to happs apps before
15:20 < stepcut> mae__: either right at the console, or via telnet
15:20 < stepcut> you can just add another, telnetId <- forkIO $ myTelnetInterface control
15:21 < stepcut> though, you have to actually implement myTelnetInterface
15:21 < Saizan> uhm, on which port is the generated application listening by default?
15:22 < koeien> mae__: i cannot run the script, it says i miss 'waitForTermination' from Happstack.Server :( what is wrong?
15:22 < stepcut> Saizan: 8000?
15:22 < Saizan> koeien: the exports of Happstack.Server changed recently
15:23 < koeien> ok
15:23 < Saizan> koeien: import Happstack.State.Control and remove waitForTermination from the .Server list
15:23 < Saizan> stepcut: yup!
15:26 < koeien> Saizan: this works :)
15:27 < koeien> i *hate* the fact that there is no escaping in the example application
15:28 < Saizan> eh
15:28 < koeien> i can put arbitrary html in a guestbook entry :)
15:28 < stepcut> koeien: sucka!
15:28 < stepcut> koeien: I am hacking up an HSP version now, which does not need an explicit escaping ;)
15:29 < koeien> i believe HSTringTemplate suffers from the same problem?
15:33 < koeien> maybe we should use the XHtml package instead in the example app?
15:33  * stepcut thinks that no one should use XHtml
15:33 < koeien> stepcut: care to elaborate? :)
15:34 < stepcut> koeien: well, unless you don't plan to support IE
15:34 < koeien> i did not realize there were problems with the combination
15:34 < stepcut> no version of IE supports xhtml
15:35 < koeien> i know my website looks like shit in IE but i don't care . of course that is no option for others :)
15:35 < mae__> stepcut: if you want to make it use hsp thats great
15:35 < mae__> would love some patches
15:35 < mae__> the main thing is
15:35 < mae__> lets keep it as small and straightforward as possible
15:35 < stepcut> mae__: indeed, I have no desire to do anything fancy
15:36 < mae__> kk
15:36 < stepcut> mae__: I got *real work* to do after all ;)
15:37 < mae__> RE: "What about logging?" I think that what we have right now is OK, but we need to probably add more, if someone sees something that should be logged, feel free to put it in -state, or -server. If you are unsure of what level, DEBUG is always safe.
15:38 < mae__> stepcut: ah yes, we all do :)
15:39 < stepcut> mae__: I have HSP-specific code for adding google analytics to your pages. Do we want that king of stuff to eventually going to end up in the happstack package or not?
15:39 < mae__> mm
15:39 < mae__> probably that would be like contrib
15:39 < stepcut> ah right
15:40 < stepcut> I forgot about contrib, that seems more logical
15:40 < mae__> yep
15:41 < stepcut> mae__: you wanted me to remove the happstack-test package and fold it into the happstack package?
15:42 < mae__> yes please
15:42 < stepcut> ok
15:42 < stepcut> and also move webQuery/webUpdate into the happstack package?
15:42 < mae__> yeah
15:42 < mae__> and remove the server dep on state
15:42 < stepcut> any suggestions for the module name ?
15:42 < mae__> hm
15:42 < mae__> not really
15:42 < stepcut> Happstack.Server.State.{webQuery|webUpdate}
15:43 < mae__> I have never used those
15:43 < stepcut> mae__: ??
15:43 < mae__> webQuery / webUpdate
15:43  * stepcut wonders how you could not use those
15:43 < mae__> hehe
15:43 < mae__> whatever you think.
15:43 < stepcut> do you just do, liftIO query everywhere?
15:43 < mae__> something like that :)
15:44 < mae__> I haven't ever gotten to happs nirvana
15:44 < mae__> i've only been stuck in the trenches hacking it together
15:44 < mae__> thats kind of the point of me creating happstack
15:44 < mae__> : D
15:45 < stepcut> mae__: ok, what exactly do you want to see for the happstack+hsp stuff I am adding in happstack?
15:46 < mae__> well
15:46 < stepcut> mae__: I should add an entirely new directory in templates?
15:46 < mae__> i had planned to make the add comment form on the same page
15:46 < mae__> stepcut: I am not quite sure, really it boils down to making it pretty and intuitive, I am more of a hands on kind of learner.
15:47 < mae__> i leave it up to you
15:47 < stepcut> mae__: but what is the vision? I template for HStringTemplate,  a template for XHtml, a template for HSP?
15:47 < stepcut> and there is  some tool, happstack --make-hsp-project that copies the template in place?
15:47 < mae__> i haven't really decided, although since hsp pages become part of the module namespace
15:47 < mae__> i was thinking they would belong under src
15:47 < mae__> and hstringtemplate would be under templates
15:47 < mae__> since they are not in the module namespace, and eval'd at runtime
15:48 < mae__> stepcut: nah, no duplicate versions
15:48 < mae__> rather I was thinking of creating an example of something that hstringtemplate would be more suitable for.
15:48 < mae__> for instance, sending test/javascript mime type to an ajax request, (and then gets eval'd in the browser)
15:49 < mae__> something along those lines
15:49 < mae__> or maybe a README with mimetype text/plain
15:49 < mae__> or dynamic css page, the list goes on
15:49 < stepcut> mae__: I am still not sure what I am creating here. Am I just making a simple demo that uses happstack+hsp ?
15:49 < mae__> but yeah, i want the "standard" to be that any xml/html stuff should belong in hsp
15:50 < mae__> stepcut: for hsp, just take the guestbook app and convert it to using hsp.
15:50 < stepcut> ok
15:50 < mae__> probably you could add some nicer css, and images, if you felt creative.
15:50 < stepcut> ok
15:50 < stepcut> I can do that
15:50 < mae__> and another thing, the index.html says "welcome to happstack" kind of thing
15:50 < stepcut> maybe a flash intro?
15:50 < mae__> so if that can be spruced up also
15:50 < mae__> that would be cool
15:51 < mae__> sure.
15:51 < stepcut> :p
15:51 < stepcut> maybe I can web 1.0 it up with the blink and marquee tags
15:52 < mae__> ohh yeahhh
15:52 < stepcut> and, is this going to somehow integrate with the happstack command eventually?
15:52 < mae__> it already does
15:52 < mae__> you can type happstack new project <dir>
15:52 < mae__> but that implementation (the code that copies the files) is really messy
15:52 < stepcut> mae__: should I modify the existing project directory? Or create a new project-hsp directory?
15:53 < mae__> basically everything under templates/project has to be added to data-files in the cabal
15:53 < mae__> stepcut: existing directory
15:53 < mae__> stepcut: it was my intention to use hsp in that example anyways, this was just a rough draft
15:53 < geezusfreeek> how are we doing on the documentation effort?
15:54 < stepcut> ok, no love for buggy String based html generation :)
15:54 < mae__> stepcut: hehe, lol
15:54 < mae__> geezusfreeek: doing ok, feel free to jump in and submit some patches though :)
15:55 < geezusfreeek> mae__, i think i will :)
15:55 < geezusfreeek> i find that the lack of documentation is the most frustrating thing about trying to use happs
15:55 < mae__> stepcut: if you can just get that template folder working, I will fix the relevant bits in the cabal file and in the happstack.hs file (under commands folder).
15:55 < mae__> unless your a glutton for punishment :)
15:56 < stepcut> :)
15:56 < mae__> that code got really ugly
15:56 < mae__> towards the end
15:56  * stepcut hacks it up
15:56 < mae__> particularly: newProject: http://patch-tag.com/publicrepos/happstack/happstack/commands/happstack.hs
15:57 < stepcut> FIXME: OMG...
15:58 < stepcut> -- THIS CODE MAKES BABY JESUS CRY
15:58 < geezusfreeek> ... but it should work on unix / win32
15:58 < mae__> hah
15:58 < mae__> yeah it wa s late
15:58 < mae__> i didn't see the second "This is so hacky".
15:58 < mae__> so grammatically bad.
16:00 < mae__> it really boils down to the fact that System.Directory sucks.
16:00 < mae__> its not recursive
16:00 < stepcut> :)
16:01 < mae__> it doesn't let you specify a folder as the second argument to copyFile
16:01 < mae__> so i'll probably end up literally specifying each file
16:01 < mae__> but thats ok
16:02 < stepcut> I'll look later, first things first
16:02 < mae__> hah
16:02 < mae__> stepcut: you don't have to do EVERYTHING you know :)
16:02 < stepcut> gotta have something worth copying
16:03 < stepcut> might be able to use the traverse function from here: http://src.seereason.com/ghc610/haskell-unixutils/System/Unix/Directory.hs
16:04 < mae__> does that work on windows
16:04 < stepcut> beats me, I didn't write it
16:04 < stepcut> that find function is broken, I wrote a better one >:(
16:04 < mae__> heh
16:05 < stepcut> there is also installFiles, http://src.seereason.com/ghc610/haskell-extra/Extra/Files.hs
16:05 < mae__> ok well gents and ladies, thanks for your time, i gotta go put away christmas stuff so my wife doesn't kill my on valentines day when she comes home.
16:05 < stepcut> mae__: well, it *is* beheading day
16:05 < stepcut> so, if she does kill you, you can kiss your head goodbye
16:06 < mae__> hmm
16:06 < mae__> sounds nice.
16:06 < mae__> NOT
16:07 < stepcut> tell that to saint valentine
17:42 < stepcut> the hsp example is kickin' butt, but it is 4:42PM and I have not eaten breakfast yet. So I am going to take a break.
18:57 < geezusfreeek> would it be considered better practice, in your opinions, to do validation in fromData or to delay it for a separate step?
18:58 < stepcut> geezusfreeek: if validation requires querying the state, would that affect things?
18:58 < Saizan_> inside fromData you can't query it
18:58 < geezusfreeek> i guess it would
18:58 < Saizan_> also you can't get useful error messages out of it
18:59 < geezusfreeek> you could if you return your data in a wrapped Error monad or something
18:59 < Saizan_> and if you get a form with invalid data you probably don't want to backtrack to the next handler, but rather report an error
18:59 < geezusfreeek> but i see that it would probably be cleaner to just validate after fromData
19:00 < geezusfreeek> oh, fromData backtracks the handler?
19:00 < Saizan_> ah, yeah, if the result is not just the "pure" data
19:00 < Saizan_> geezusfreeek: when used by withData
19:03 < mae__> stepcut: can't wait for the hsp example + integration code : )
19:04 < stepcut> mae__: it's coming along
19:04 < stepcut> mae__: I should have it working locally in an hour
19:04 < stepcut> mae__: other cleanups needed before I commit
19:06  * stepcut checks out haha/rotating-lambda
20:29 < mae__> stepcut: neat, I just peeled 4 LBS of shrimp :)
20:31 < stepcut> mae__: yay!
20:34 < mae__> if only I could write a function to do that...
20:35 < stepcut> :)
20:35 < stepcut> mae__: if you write enough functions worth enough $$ you can pay someone to do it ;)
20:37  * stepcut wonders if webQuery and webUpdate are needed anymore
20:38  * stepcut thinks ... no
20:40 < Saizan_> query/update are prelifted?
20:40 < stepcut> update :: (Control.Monad.Trans.MonadIO m,
20:40 < stepcut>            Happstack.State.ComponentSystem.UpdateEvent ev res) =>
20:40 < stepcut>           ev -> m res
20:40 < stepcut> I think update and query used to be, IO res
20:41 < stepcut> and, webQuery = liftIO query, etc
20:41 < Saizan_> yeah
20:41 < Saizan_> i wonder since when that changed
20:41 < stepcut> but, now,  WebT is a MonadIO and update is (MonadIO m) => m res
20:41 < stepcut> so webUpdate and webQuery are vestigial
20:42 < Saizan_> we might want to keep them for darwinists
20:42 < stepcut> I am tempted to completely deprecate and remove them
20:43 < Saizan_> make sure to add that to the changelog
20:43 < stepcut> yeah
20:57 < stepcut> alright dudes! how does this look http://hacketeria.com/
20:57 < stepcut> I have not test IE, only safari, opera, and firefox
20:58 < stepcut> ... and links
20:59 < Saizan_> it should have a white background?
21:01 < stepcut> yes
21:03 < Saizan_> then it's not working well on my firefox, because the main part is grey, which is my default
21:03 < stepcut> ah
21:03 < Saizan_> quite cool otherwise :)
21:03 < stepcut> I'll fix that
21:03 < stepcut> one moment
21:04 < stepcut> it should look like this: http://hacketeria.com/screenshot.png
21:06 < stepcut> Saizan_: try it now
21:07 < stepcut> it should support utf-8 and be immune to SQL and javascript attacks
21:07 < stepcut> though, perhaps not XSS
21:07 < stepcut> I don't have anything in there to check the referrer header
21:07 < stepcut> we should add that lib function
21:08 < Saizan_> now it works :)
21:08 < stepcut> if you scale the font size up and down it probably does not work either, but ... too bad.
21:09 < stepcut> would be easy to update it to support pandoc, but that is probably overkill ;)
21:10 < Saizan_> for a demo i guess so :)
21:10 < stepcut> in a few weeks, it should be trivial to add facebook connect support :p
21:10 < stepcut> I like this theme, I maybe I should hack a few more hours and make it as real blog system ;)
21:11 < Saizan_> then i want latex-style literate haskell support :)
21:12 < stepcut> Saizan_: can pandoc do that?
21:12 < stepcut> I use bird-style literate haskell to make by blogposts
21:12 < mae__> stepcut: web*, deprecate and make server not depend on state YES, drop support completely NOT YET.
21:13 < stepcut> mae__: if you have to modify your code to import webQuery/webUpdate from a different location, isn't it almost as easy to just change the names to query/update?
21:14 < mae__> it would be nice to have a blog system :) but thats probably out of scope for a "getting started" kit.
21:14 < mae__> stepcut: thats true.
21:14 < Saizan_> stepcut: not sure about what pandoc can handle
21:14 < mae__> stepcut: your saying that webUpdate, webQuery don't do anything in addition to update and query?
21:14 < stepcut> mae__: nope, one moment
21:15 < mae__> is this something to do with the changes dsrogers made?
21:15 < mae__> because i thought you said at one point that it was useful
21:15 < stepcut> webQuery :: (MonadIO m, QueryEvent ev res) => ev -> WebT m res
21:15 < stepcut> webQuery = liftIO . query
21:16 < stepcut> at one point in time, query had the type, query :: ev -> IO res, and WebT did not have a MonadIO instance. So, you had to use webQuery in the WebT monad. But now you don't.
21:16 < stepcut> now it is done "The Right Way(tm)"
21:17 < stepcut> mae__: did you see hacketeria.com ?
21:17 < mae__> yeah
21:17 < stepcut> but you didn't leave a comment :(
21:17 < mae__> stepcut: is this something to do with the changes dsrogers made? or this is pre happstack that this was "done right"
21:17 < mae__> ah
21:17 < stepcut> mae__: no idea when it was fixed
21:17 < mae__> wow
21:17 < mae__> this is awesome
21:17  * stepcut looks in the old code base
21:18 < mae__> great look and feel
21:18  * stepcut is an expert Internet surfer
21:18 < mae__> ok i left comments
21:18 < mae__> so this is what you made
21:18 < mae__> its fantastic!
21:19 < stepcut> well, I didn't make the theme
21:19 < stepcut> I just adapted it, see the link at the bottom
21:19 < mae__> yeah i know
21:19 < mae__> but still
21:19 < mae__> not bad for hacking it together in a few hours
21:19 < mae__> this will make people feel good about happstack when they install it
21:19 < mae__> bling goes a long way
21:19 < stepcut> it supports utf-8 as well
21:20 < mae__> probably should change "comments" to say something else
21:20 < mae__> like "Guests"
21:20 < stepcut> it doesn't check that you actually left a username/comment
21:20 < stepcut> yeah... though they are comments left by guests
21:20 < mae__> right
21:20 < stepcut> I am happy to change it though
21:21 < mae__> well if you wanna go all out and make a blog then fine :) but for the release lets focus on the terseness/beauty of the basic skeleton
21:21 < mae__> post-0.2 i really want to take a look ad making the TH stuff nicer to use
21:22 < stepcut> mae__: which TH stuff?
21:22 < mae__> stepcut: the existing stuff
21:22 < stepcut> my only TH complaint is that you can't put ''Serialize, in the deriveAll clause...
21:22 < stepcut> but I could be convinced that more is wrong :)
21:22 < mae__> in other words, fix bugs (like the compiler warnings), expand functionality, make nicer.
21:22 < stepcut> oh yeah, the warnings are annoying
21:22 < mae__> i.e. i want to make some more TH functions which build rest interfaces for your data
21:23 < mae__> anyways
21:23 < mae__> guests are arriving, hehe damn i wanna hack tonight
21:23 < mae__> valentines day..
21:23 < mae__> ttyl
21:23 < stepcut> :)
21:23  * stepcut did beheading day in the morning
21:35 < stepcut> thanks to on-the-fly validation, the guestbook is also valid HTML 4.01 Strict ;)
21:36 < stepcut> and the <label> tag works in browsers that support it ;)
21:50 < stepcut> I can't seem to get things so that you can hit 'tab' to get to the submit button after completing your message
21:53 < Saizan_> it works like that here
21:54 < stepcut> it is not working for me in safari or ff, it just skips to the URL bar :(
21:54 < stepcut> what browser?
21:54 < Saizan_> ff 3.0.6
21:54 < stepcut> hrm, odd
22:03 < stepcut> ok I updated the 'Comments' text :)
22:04 < stepcut> also, I added accesskeys :)
22:05 < stepcut> but, I am done for the day. Tomorrow I will get everything in order and commit a patch
22:55 < dsrogers> greetings
22:58 < stepcut> greetings
22:59 < dsrogers> type ServerPartT m a = ReaderT Request (WebT m) a
22:59 < dsrogers> I could make ServerPartT go away
23:00 < dsrogers> not sure what the consequences of that are, though
23:09 < dsrogers> ah.
23:09 < dsrogers> I know what they are.
23:09 < dsrogers> it makes it hard to combine ServerPartT with your ReaderT
23:35 < dsrogers> there is nothing like implementing a few monads to teach you why you want to implement monads.
--- Log closed Sun Feb 15 00:00:14 2009