00:12:41 <balor> I'm off to bed.  The stuff I've been working on is, as always, here https://patch-tag.com/r/balor/Folder/home
00:12:52 <balor> Thanks for all the help again
00:16:36 <stepcut> no problem
09:12:22 <balor> I've got a string and need to lift it into XMLGenT as XML i.e. I want "foo :: String -> XMLGenT (ServerPartT IO) XML".  (a) is that the correct way to ask the question, and (b) how might I go about writing foo?
12:35:51 <stepkut> balor: what do you mean by lift as xml?
12:46:44 <balor> stepkut, I misspoke.  I store a string in acid-store which is a serial representation of an XML fragment.  I'd like to turn it into a HSP.XML in order to add it to a larger fragment.
12:47:27 <balor> there's no straightforward parse :: String -> HSP.XML
12:53:23 <balor> My attempt is here http://hpaste.org/48465
12:54:30 <dsfox> <span><% s %></span>
12:59:08 <balor> dsfox, thanks
13:00:04 <balor> But that still escapes the xml tags in my string
13:01:08 <balor> So I see "<p>A Test Par</p>" in the browser as the source is "%lt;p&gt;A Test Par&lt;/p&gt;"
13:01:25 <dsfox> how did it come to stop being XML and be a string?
13:01:54 <balor> It's a string passed in a form to the handler.
13:02:42 <balor> So it's stored in acid-state as XML
13:03:52 <dsfox> its tricky
13:04:30 <balor> Sorry...it's stored in acid-state as a String
13:04:32 <balor> not XML
13:06:00 <balor> Next version I'll get the form to POST XML and derive Data, Eq, and other stuff for HSP.XML in order to store HSP.XML in acid-store
13:06:08 <dsfox> I don't see how you can do it without parsing it
13:06:13 <balor> but for the moment I Just Want It To Work(tm)
13:06:17 <dsfox> heh
13:06:26 <balor> I'm happy to parse it...I just can't find a parser
13:07:49 <stepkut> balor: you can do something like, cdata s
13:08:37 <stepkut> > renderAsHTML $ cdata "<p>foo</p>"
13:08:37 <stepkut> "<p>foo</p>"
13:08:37 <lambdabot>   Not in scope: `renderAsHTML'Not in scope: `cdata'
13:10:27 <balor> that still escapes the characters
13:10:56 <dsfox> there are parsers in haxml: Text.XML.HaXml.xmlParse, Text.XML.HaXml.Html.htmlParse
13:11:16 <balor> Which makes sense as it's cdata
13:12:12 <balor> dsfox, yes but HSP has its own definition of XML
13:12:42 <dsfox> yes, you have to convert it.  But at least its parsed
13:17:43 <balor> Is there a reason that HSP doesn't use haxml or xml or some other external parser?
13:35:11 <stepkut> balor: try pcdata instead
13:36:22 <stepkut> balor: because HSP is trying to parse files that contain a mixture of haskell and xml, not just xml
13:52:24 <balor> Isn't pcdata a synonym for cdata?
13:53:31 <stepkut> no
13:53:44 <stepkut> one causes the output to be escaped and one does not
13:53:51 <balor> oh
13:54:13 <stepkut> I am pretty sure you want cdata though..
13:54:32 <stepkut> renderAsHTML $ cdata "<p>foo</p>" --> "<p>foo</p>"
13:54:41 <stepkut> renderAsHTML $ pcdata "<p>foo</p>" --> "&lt;p&gt;foo&lt;/p&gt;"
13:55:16 <balor> great
13:55:21 <balor> works now
13:57:31 <balor> but not like above.. Like so foldrContent :: (EmbedAsChild (App) String) => String -> XMLGenT (App) XML
13:57:31 <balor> foldrContent s  =
13:57:31 <balor>              <span><% cdata s %></span>
13:59:58 <balor> I think the renderAsHTML escapes it
14:00:03 <balor> even the cdata
14:13:24 <stepkut> this works fine for me, http://hpaste.org/48468
14:14:28 <stepkut> perhaps the 's' value is already escaped by accident before you even pass it to cdata?
14:30:47 <balor> Ok, I was misusing renderAsHTML
14:31:03 <balor> ACTION notes not to Ctrl+c acid-state for a while after I think I've written to it.
14:33:37 <stepcut> balor: really?
14:35:14 <Lemmih> balor: Oh?
14:39:19 <balor> I'll try and break it again
15:05:07 <balor> No, my app simply doesn't like &nbsp;, but I don't know if it's not storing them or just not displaying them
15:05:24 <balor> Is there a way to dump all the contents of an acid-store to a "readable" format?
15:11:54 <stepcut> if the data type you are storing has a Show type, you can simple have a query that calls, 'ask' and returns the entire state. Then use print to show it.
15:39:47 <Lemmih> stepcut: happstack is difficult to use from ghci. Shouldn't there be a way to shutdown all the threads?
15:40:16 <Lemmih> Killing the thread that called 'simpleHTTP' doesn't always work.
15:40:32 <stepcut> Lemmih: right. GHCi does not seem to have any way to kill all background threads
15:41:21 <stepcut> Lemmih: so, instead you need to explicitly track every background thread you create so you can call in explicit killThread on them
15:42:15 <stepcut> Lemmih: In happstack-util, there is a version of fork that does that. If you compile with the right cabal flags
15:42:25 <Lemmih> stepcut: Does simpleHTTP start any threads that it doesn't kill itself?
15:42:54 <stepcut> Lemmih: I think so
15:43:25 <Lemmih> I'm fine with kill my own threads. But I can't really do anything about the threads created by simpleHTTP.
15:43:36 <stepcut> yep
15:44:46 <stepcut> it forks threads for each incoming connection
15:45:25 <stepcut> there is also a timeout thread
15:46:40 <HugoDaniel> how come http delete is idempotent !?
15:46:54 <HugoDaniel> http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
15:46:55 <HugoDaniel> here
15:46:56 <HugoDaniel> :/
15:47:08 <HugoDaniel> now my mind is in an infinite loop
15:47:17 <stepcut> Lemmih: what seems to be the actually problem you are having?
15:48:51 <stepcut> HugoDaniel: why would that be a problem?
15:49:53 <HugoDaniel> i mean, delete in the uri /myApp/stuff1 should be answered with a 2xx code if it deletes it
15:50:02 <HugoDaniel> if i do another delete to that same uri
15:50:44 <HugoDaniel> i should get a 410 or a 404 or something like that
15:51:06 <stepcut> the side effects are the same in both cases -- the data is not there
15:51:28 <stepcut> no matter how many times you delete it.. it won't be there :)
15:51:45 <HugoDaniel> oh hmm
15:52:02 <HugoDaniel> true :)
15:56:07 <stepcut> Lemmih: I don't actually see any reason why killing the simpleHTTP should not be sufficient. But I have seen problems in the past as well... so something is going on
20:04:24 <balor> Have a look at http://www.phoric.eu:8000/foldr/1 but I'll ask politely that you don't modify /0 as I've got no auth working yet.
20:06:14 <balor> and take it easy on my poor little ADSL line :)