05:49:25 <stepcut> kxra: yeah, I am aware of that
12:53:23 <jonkri> What are the benefits of using HSX over Blaze?
12:54:06 <jonkri> Oh, there _is_ a pros and cons HSP section in http://happstack.com/docs/crashcourse/Templates.html. Nevermind!
12:57:11 <bergmark> much nicer to write regular xml imo
12:58:45 <jonkri> I was just going to say that Blaze looked pretty nice. :-)
12:59:27 <jonkri> Maybe XML is a bit more readable in larger documents though.
13:00:36 <donri> jonkri: the blaze dsl is great because it's compositional but the blaze-html package is not great for dynamic web apps because it puts performance above expressiveness which makes for really messy code once you start doing things like i18n, type safe routing...
13:01:31 <donri> in particular, it's not a monad transformer and the dsl is monomorphic so you have to call the type class methods yourself
13:03:26 <jonkri> And HSX does not have these shortcomings?
13:04:01 <donri> not those no; hsp is very expressively powerful
13:04:09 <donri> it has its own problems though :)
13:05:16 <jonkri> The cons list doesn't look too bad. What are the major shortcomings of HSX to you? Also, are there any alternatives that you think that I should take a look at? Thanks.,
13:06:47 <donri> hsp requires a preprocessor or quasi-quoting; it can spew out really long and cryptic type errors; it's not built up with combinators so can be less trivially compositional
13:07:47 <jonkri> I see.
13:08:37 <donri> el !. cls = el ! class_ cls
13:08:51 <donri> container = div !. "outer" . div !. "inner"
13:09:04 <donri> it's great how blaze lets you build things like this with just haskell combinators
13:09:46 <donri> hspContainer inside = <div class="outer"><div class="inner"><% inside %></div></div>
13:10:17 <donri> on the other hand,
13:12:39 <donri> blazeLink Environment{..} = a ! href (toValue (route SomeRouteR)) $ toHtml (msg SomeMsg)
13:12:58 <donri> hspLink = <a href=SomeRoutR><% SomeMsg %></a>
13:13:14 <donri> blaze gets messy when you need effects
13:13:44 <jonkri> Hmm...
13:14:12 <donri> so my take is: blaze for static content, hsp for dynamic applications
13:14:52 <jonkri> Thank you. :-)
13:14:56 <donri> for example, i'd use blaze in a syntax highlighting library for generating html
13:15:03 <donri> but i'd use hsp in a web application
13:15:31 <bergmark> for static content i don't think it matters that much... it's the easiest to do
13:15:53 <donri> well "static" might be the wrong term here...
13:15:56 <bergmark> but syntax highlighting i agree on
13:24:29 <bergmark> and also that hsp would be better for a web app
13:26:00 <bergmark> it's really hard to make generic html combinators for something like that
13:27:04 <donri> jonkri: also, with hsp you can use any element and attribute you want. with blaze you... can, but it's not as natural. this can be a good thing: typos are caught, but it can get in the way especially with html5
13:27:15 <donri> jonkri: plus you can use hsp for any xml content, not just html
13:27:39 <donri> OTOH no real html5 rendering support in hsp :/
13:28:00 <jonkri> Ah, I see. I just saw the API at <http://hackage.haskell.org/package/hsp> and was worried I couldn't deliver HTML5 documents. :-)
13:28:08 <jonkri> Ah.
13:28:18 <donri> stepcut: maybe we should make hsp default to xhtml5. that way we get html5 features but safe rendering? not sure if IE accepts it though
13:29:08 <bergmark> the only templating language i've been really happy with is jade, but then i realized that javascript sucks
13:29:46 <jonkri> What do you mean by "real html5 rendering"?
13:29:48 <donri> jonkri: well you sort of can, but also not quite
13:30:34 <donri> jonkri: i mean the html renderer doesn't know anything about html5, i don't know if that matters but it depends on if there are any new self-closing elements in html5...
13:30:51 <bergmark> heist comes pretty close with splices and applied templates though
13:30:59 <donri> and happstack's hsp support adds a html4 doctype
13:32:06 <donri> jonkri: consider <br/> or <br></br> in hsp. with html rendering it becomes <br>
13:32:47 <donri> jonkri: it knows to do that for the right html4 elements, but any other elements render as xml...
13:33:28 <donri> so xhtml5 would work, but not sure IE can parse that correctly
13:33:29 <jonkri> That's okay, I think. (Although I'd rather see <br /> in the actual output.)
13:33:35 <bergmark> which other html elements should render as non-closing?
13:33:48 <donri> well <br /> is invalid html
13:34:13 <donri> bergmark: duno them all... hr is another example
13:34:18 <jonkri> So is IMG.
13:34:24 <donri> right
13:34:42 <bergmark> i don't really care about invalid html in that sense
13:34:50 <donri> :)
13:35:19 <donri> https://www.webkit.org/blog/68/understanding-html-xml-and-xhtml/
14:03:10 <bergmark> :o oh well xmlhtml does it for me :)
14:41:08 <HugoDaniel> how is the performance of ekmett tables ?
14:45:52 <Taneb> a) this is the wrong channel, #haskell-lens is more appropriate, and b) not great, it's still very much in development
14:58:02 <HugoDaniel> Taneb: thanks, sorry
15:00:08 <donri> HugoDaniel: much better than ixset, but completely unusable for me because of a bug ;)
15:01:44 <Taneb> donri, I didn't realise it was that efficient!
15:01:53 <Taneb> And I've been working on making it quicker!
15:02:11 <donri> Taneb: could be because of that bug, maybe it's not even making the indices
15:02:25 <donri> Taneb: but i did notice that loading my acid-state became much quicker
15:02:53 <Taneb> Unfortunately I do not feel experienced enough to tackle that bug
15:03:00 <donri> Taneb: ixset performance is pretty terrible though
15:03:23 <Taneb> Do you know how IxSet serializes?
15:03:30 <donri> list
15:03:39 <donri> i could even load my existing state as a table :P
15:03:47 <Taneb> Hehe
15:03:51 <Taneb> Brilliant! :)
15:04:38 <HugoDaniel> i usually wrap stuff in a sequence
15:05:09 <HugoDaniel> then hashmaps for each index with an Int of the sequence position
15:05:46 <HugoDaniel> it works nice, despite the loads of code to update indices
15:05:57 <HugoDaniel> but breaks when i need to do some deletion
15:06:23 <HugoDaniel> i dont know how to do them fast in sequence
15:07:00 <donri> there's benchmarks for tables and ixset in the data-store repo
15:11:46 <donri> HugoDaniel: but basically inverted indices don't work in tables so you can't do all queries you can with ixset/data-store
15:12:28 <donri> stuff like index on each item in a set
15:12:55 <donri> basically, no many-to-many type of indices IIRC
17:23:16 <jonkri> Either I'm doing something wrong, or the Crash Course needs an update. If I uncomment line 51 and/or 52, the program fails to compile. You can see the error of uncommenting 52 below.
20:54:17 <stepcut> jonkri: line 51/52 of what..
20:54:34 <jonkri> stepcut: I'm sorry, I forgot to paste. :>
20:54:49 <jonkri> stepcut: http://pastebin.ca/2414907
20:55:05 <stepcut> link says it has expired..
20:55:39 <jonkri> stepcut: http://pastebin.ca/2414999
20:57:22 <stepcut> ah
20:57:28 <stepcut> you have OverloadedStrings enabled?
20:57:43 <stepcut> oh, yes i see it there
20:57:53 <stepcut> you will need to change the bit to,  <% "this." :: String %>
20:57:58 <stepcut> or  <% "this." :: Text %>
20:58:03 <stepcut> because it isn't sure which
20:58:11 <stepcut> I am working on a fix for that right now actually
20:58:24 <bergmark> how do you fix that?
20:58:34 <stepcut> well.. not really actually
20:58:58 <stepcut> I am working on a patch that makes the use of OverloadedStrings not required for hsp >= 0.8
20:59:04 <stepcut> which is related but different
20:59:22 <stepcut> there is really no fix for this particular issue
20:59:55 <jonkri> i did remove the overloadedstrings import later on when i reached that point in the tutorial, but i didn't realize that that was the problem :> thanks
21:00:11 <stepcut> do you understand why it is causing a problem?
21:00:20 <jonkri> yes :)
21:00:55 <jonkri> how do i go from "ServerPartT IO XML" to a "Response"?
21:09:23 <stepcut> resp <- toResponse <$> someServerPartTIOXML
21:09:47 <stepcut> or: do xml <- someServerPartTIOXML ; return (toResponse xml)
21:12:44 <jonkri> thanks :)
21:23:03 <jonkri> can html comments be used with hsp?
21:30:54 <jonkri> also, is there some way hsp can allow for single quotes?
23:26:35 <jonkri> thanks for your help! good night