00:41:01 <donri> stepcut: nice find: darcs send -O, like -o but using the recorded patch name
00:41:07 <donri> it's the little things :)
00:46:57 <Saizan> is happstack still using syb-with-class somewhere?
00:49:11 <Saizan> seems not
00:52:33 <Saizan> oh, ixset does
02:33:31 <stepcut> Saizan
02:33:43 <stepcut> Saizan: should we 'fix' that so it doesn't?
02:35:12 <stepcut> Igloo: the speed of loading a checkpoint is largely determined by the speed of how fast cereal can deserialize your data. I think that in hackage 2, the Safecopy instances call the code that parses the .cabal files, which is supposedly quite slow
02:35:42 <stepcut> Igloo: basically.. loading a checkpoint involves parsing every single .cabal file in the repository right now
02:36:09 <stepcut> perhaps a more intelligent SafeCopy instance could be constructed
02:36:42 <Saizan> stepcut: nah, i'm just looking for testcases in the wild, since apparently deriving Data for recursive types has been broken since 2008
02:36:52 <stepcut> ah
02:37:46 <Saizan> http://www.haskell.org/pipermail/haskell-cafe/2012-September/103238.html
09:10:40 <Reko_> Are there any examples on doing I18N with Blaze-html?
09:33:01 <donri> Reko_: i18n with blaze kinda sucks
09:33:26 <Reko_> donri: I've figured this out by experience, I'm wondering if it can not suck?
09:34:32 <donri> the least sucky method i guess would be to pass in a function to render messages (either via a reader or function argument)
09:34:52 <donri> a reader means you'll need to use "return" for the actual template, and a function argument means you'll have to pass it around to all sub-templates
09:35:39 <Reko_> Well, I've been using a reader. But having to mBlahBlah <- msg MsgBlahBlah for each string before html $ do really sucks...
09:35:48 <donri> or i guess you could use blaze-markup with your own combinators in a proper monad transformer, but then you'll need to generate or write those combinators
09:36:24 <donri> Reko_: well what i suggest is you do, msg <- asks msg; return $ p (msg MsgBlaBlah)
09:36:24 <donri> etc
09:36:54 <donri> that way you just have to ask for the msg function once per "template"
09:39:37 <donri> Reko_: but really, if you want i18n you're better off with hsx or hamlet
09:39:47 <Reko_> Yeah, I was thinking of switching to hamlet
09:40:12 <Reko_> This is what I have currently http://hpaste.org/74281
09:40:16 <donri> with hsx you can just do, <p><% MsgBlah %></p>, with hamlet i think it's <p>_{MsgBlah}
09:40:32 <Reko_> Hamlet builds on top of blaze-html, right?
09:40:49 <donri> yea
09:41:03 <Reko_> Guess I'll switch then.
09:41:04 <donri> although that doesn't really mean much
09:41:14 <Reko_> Well, true
09:41:28 <donri> blaze is mostly write-only
09:41:39 <donri> although i think since 0.5 it's a bit more read-accessy
09:41:55 <Reko_> How do you mean write-only?
09:42:13 <donri> but i don't think hamlet using blaze gives you much more than preEscapedText etc
09:42:33 <donri> with that function you get similar "compatibility" with any other system
09:43:27 <donri> Reko_: i mean blaze doesn't have some kind of internal HTML data structure, it's basically just a bytestring builder
09:43:40 <Reko_> Yeah.
09:43:53 <donri> with hsx  you can actually pattern match on xml etc
09:44:03 <donri> isImg <img/> = True
09:44:11 <Reko_> Is that so? I was actually wondering what the point of HSX was since it looked really like Blaze at first sight.
09:44:33 <Reko_> 'Blaze but with preprocessor' seemed very blech to me...
09:44:38 <donri> hsx is really powerful, though far from perfect
09:44:56 <Reko_> eh, what is perfect? only aliens can create perfect software
09:45:00 <donri> :)
09:46:03 <donri> hsx uses parametric type classes for value interpolation which gives you a lot of power with much less boilerplate
09:47:34 <Reko_> Ah, see, this is what I'm thinking, HSX has this type class
09:47:55 <donri> and it's monadic so you can do things like look up the i18n language / msg function while interpolating a message
09:48:13 <Reko_> Whereas with Blaze I'm spending hours trying to figure out how to make an instance to convert 'MsgBlahBlah' automatically and thinking 'if only blaze could be monadic' and not really knowing whether what I want is possible since I'm new to Haskell
09:48:17 <donri> or go nuts and issue acid-state queries from a template ;)
09:48:23 <Reko_> ...heh. You said basically the same thing.
09:50:08 <donri> hamlet supports a fixed set of predefined special syntax variants for different kinds of interpolation, but you can't really invent your own things, all you can do is value interpolation with #{} which is not monadic
09:50:37 <donri> i think it's kinda neat how you can do type safe routes and i18n on top of hsx without dedicated support for that built into hsx
09:50:43 <Reko_> So, I'd be better off with HSX if I wanted to do I18N things which weren't I18N?
09:50:57 <Reko_> -like things, I mean.
09:52:30 <donri> if you want monadic interpolation, yea
09:53:03 <donri> with hamlet you'd end up with like, do x <- somethingMonadic; return [hamlet|<p>#{x}|]
09:53:18 <donri> that whole thing with hsx could just be, <p><% somethingMonadic %></p>
09:53:32 <Reko_> Resistance is futile, huh. But HSX is going to support quasiquotes eventually, so the trhsx step won't be forever, right?
09:53:43 <donri> some might argue it's a feature of hamlet to enforce separation of logic and presentation, but "meh" :)
09:54:07 <donri> yea, the QQ is actually already implemented, just the maintainer is a bit busy lately
09:54:26 <Reko_> Heh. The nice thing about blaze is how I can interpolate code and HTML and it doesn't feel like I'm doing something godawful
09:54:45 <Reko_> No, let me rephrase that. I like the fact that I can construct templates with the full power of Haskell
09:55:16 <donri> i think the reasons behind why mixing logic into views is considered bad is made less relevant with haskell/hsx and similar
09:55:24 <Reko_> I used to work with Mako in Python. Learn how to define blocks, etc. With Blaze, it's just Haskell. Just use it like... Haskell. There's something nice about that.
09:56:43 <donri> first of all you have templates inside code, not code inside templates. second, related to the first point, these templates are neatly structured in modules and functions, not giant php files mixing side effects with templating arbitrarily. third, well strong types and whatnot.
09:59:24 <donri> i actually kinda like the pattern of doing acid-state queries inside hsx templates though. it's not really the kind of side-effect that hurts in such a situation, and might even help make sure you get the right content in the output...
09:59:56 <donri> example: https://github.com/dag/happaste/blob/master/src/Happaste/HTML.hs#L80
10:01:12 <donri> then i can just do, <% recentPastesList %> in some other template
10:01:57 <donri> it's even unit testing friendly in some ways because the acid-state handle is looked up in a reader etc
10:02:53 <donri> (if i'm rambling it's because of sleep deprivation :p)
10:03:35 <Reko_> are there any haskell coders that don't subject themselves to sleep deprivation? :P
10:04:03 <donri> :)
10:05:25 <McManiaC> (:
10:05:52 <donri> i would also argue that hsx is more type safe than hamlet because it uses type classes to determine every interpolation; with hamlet you could typo and use the wrong interpolater and, probably not common in practice, but in theory the same type might be valid for different interpolators but handled differently
10:05:59 <donri> but, splitting hairs
11:07:00 <Palmik> donri, sorry for not responding yesterday. I will look into what you said... what would you want insertion to look like with autoincrement index? Do you prefer the way kdtree hadles indexes or the way ixset handles indexes?
11:11:15 <Palmik> Well, the first question is a bit premature...
11:18:30 <donri> duno how kdtree does it but the lack of type safety in ixset indexes certainly sucks
11:19:15 <donri> i think higgsset uses type families although stepcut hinted that it could be done with simple type classes (does he mean non-MPTCs?)
11:20:02 <donri> or do you mean implementation, not API?
11:20:38 <donri> i think it was bitonic who told me that kdmaps could potentially be more awesome but are "hard to balance"
11:21:25 <donri> and he suggested something to the end of that higgsset ultimately suffers from similar problems as ixset in how it's implemented under the hood. not sure what exactly he meant since the way i understood higgsset is it doesn't recalculate indexes for multiqueries...
11:58:43 <rlpowell> 04-12:40 <       donri> might be best to focus efforts on something that stepcut doesn't have concrete plans for himself yet (e.g. not new server backend) -- I'm working on an authenticated version of ControlV, partly as a good example and partly to work on fixing things so happpstack-authenticate works with happstack-foundatino.
11:59:18 <donri> +1
11:59:38 <donri> rlpowell: stepcut is back btw
12:00:06 <rlpowell> donri: Looks like you had a long convo about hsv vs. blaze, which is interesting to me because hapstack-authenticate and most of the crash course are blaze, but happstack-foundation is HSX, and I've found that odd.
12:00:17 <donri> yea
12:00:36 <rlpowell> So, can you summarize?
12:00:45 <rlpowell> Because it seems like things have shifted around here in that regard.
12:00:49 <rlpowell> And I was wondering why?
12:01:07 <donri> what do you mean shifted?
12:01:28 <rlpowell> Well, the older stuff is blazed and -foundatino, which I gather is newer, is HSX.
12:01:35 <rlpowell> That implies a shift in preference to me.
12:01:41 <donri> stepcut prefers and uses hsx himself, but uses blaze for tutorials for simplicity
12:02:04 <donri> duno why authenticate only directly supports blaze, maybe for sake of having less dependencies?
12:02:07 <rlpowell> Huh.  THat's odd to me, I don't find the Blaze tutorials any simpler to read.
12:02:15 <rlpowell> *nod*
12:02:32 <donri> yea, but blaze doesn't require a preprocessor and doesn't throw horrible errors for overlapping instances :)
12:02:40 <rlpowell> Ah, OK.
12:03:53 <donri> so what did you want me to summarize? hsx vs blaze?
12:06:44 <rlpowell> Yeah.
12:06:49 <rlpowell> Which I think you just did.  :)
12:07:04 <donri> blaze is faster and a bit safer (can't typo tags or attributes as easily) and simpler, but usually too simple for any non-trivial dynamic web application
12:08:22 <rlpowell> Cool, thanks.
12:08:25 <donri> great for things like generating html in a syntax highlighter though
12:08:57 <Igloo> stepcut: Hmm, that might be some of it, but it's also slow ad shutting down, which shouldn't involve parsing
12:09:09 <Igloo> stepcut: I don't actually understand why it should be so slow, though
12:28:22 <rlpowell> donri: So that +1 was you thinking that's a good thing to be working on?
12:28:45 <donri> sure!
12:28:56 <rlpowell> Woo.
12:29:02 <rlpowell> Because it's been a *lot* of work.  :P
12:29:06 <donri> they seem naturally related in both being fullstack-oriented
12:29:29 <donri> so making sure they work well together makes sense
13:46:14 <Reko> <donri> yea, but blaze doesn't require a preprocessor and doesn't throw horrible errors for overlapping instances :)
13:46:23 <Reko> HSX is driving me insane with errors about overlapping instances.
13:46:58 <Reko> Any common mistakes that cause it?
14:07:29 <stepcut>  Reko: either, forgetting to import the module that contains the required EmbedAsChild instance, using a value which doesn't have one in the first place, or using a value would could have multiple types (such as a  number literal)
14:08:01 <Reko> Thanks, I'm running screaming to Hamlet for the time being.
14:08:08 <Reko> Maybe I'll revisit it when I'm better at Haskell.
14:08:09 <Reko> :|
14:09:08 <stepcut> there was a GSoC project to add a type-checker to haskell-src-exts would could help significantly with this
14:09:36 <stepcut> the error messages are the #1 reason why I am hesitant to recommend HSP more strongly
14:10:19 <stepcut> the underlying errors themselves are usually very simple, but the resulting error messages are pretty crazy
15:16:37 <tazjin> What do you all think about this new templating thing that was announced on Reddit last week?
15:16:59 <tazjin> Found it: http://palmik.net/posts/2012-08-23-introducing-hsml.html
15:57:52 <stepcut> happstack-authenticate uses blaze-html because it is easy to embed blaze-html into other template systems
15:57:56 <stepcut> though I am open to other ideas
16:14:43 <rlpowell> stepcut: No, that's a perfectly good answer.
16:14:54 <rlpowell> I just found it odd that -auth and -foundation use different libs.
16:19:10 <stepcut> yeah, they serve slightly different audiences. But, really, the right solution is to fix the warts with HSP so that we can recommend it 100%
16:19:30 <stepcut> looks like haskell type exts passed its GSoC eval, so that should eventually help a lot with the type errors
16:20:13 <stepcut> after I get back from CUFP I will work with niklas to get the refactoring of HSP done so that it does not depend on HJScript and so that we can release the QuasiQuoter for HSX as well
16:23:50 <stepcut> whoa.. pipes is already 8+ months old
16:27:33 <mightybyte> Wow, time flies
16:27:41 <stepcut> yeah
16:46:56 <rlpowell> stepcut: I'm mostly trying to figure out auth on my own, but I gotta ask: what is this Arbitrary thing for?
17:34:07 <LambdaDusk> hello... when is that version 8 due for happstack? I wanted to research about websocket support with it
22:06:54 <donri> stepcut: new pipes, but 2.3
22:08:34 <donri> "Bidirectionality: The library now provides a bidirectional Pipe type, called a Proxy." seems to be the major new thing
22:10:52 <donri> edward is working on something he calls "machines" too which is supposedly similar, although he said pipes would currently be better for a web server
22:15:57 <rlpowell> So I want to optionally generate a Blaze element; how does that look?
22:16:21 <donri> rlpowell: what do you mean?
22:16:43 <rlpowell> I want to be like "if foo then H.li $ some crap else [nothing]
22:17:01 <rlpowell> Which, obviously, isn't going to work as written.  :)
22:17:24 <donri> rlpowell: when foo $ li $ some crap
22:17:28 <donri> import Control.Monad
22:17:32 <rlpowell> Thanks.
22:18:17 <donri> or, if foo ... else return () -- what 'when' does
22:18:32 <donri> @src when
22:18:32 <lambdabot> when p s = if p then s else return ()
22:19:00 <rlpowell> Oh *neat* bot use.  Funny bot name.  :D
22:19:07 <donri> :)
22:34:08 <stepkut> donri: I just installed pipes 2.2 this morning :(
22:35:05 <donri> heh
23:42:40 <rlpowell> donri: BTW, using when in this blaze stuff gives Couldn't match expected type `()' with actual type `Html'
23:49:22 <rlpowell> donri: Erm, nevermind.  Shitty error message, but different issue looks like.