
6 Jul
2011
6 Jul
'11
4:02 p.m.
On Wed, Jul 6, 2011 at 12:18 PM, Dmitriy Nikitinskiy
Hello All.
I have following code:
getMyRoute :: String -> Handler RepXml getMyRoute r = liftM RepXml $ hamletToContent [hamlet|
getOtherRoute :: Handler () getOtherRoute = do (RepXml mycontent) <- getMyRoute "something" -- how write mycontent to file here? -- let str = ???? or str <- ???? -- liftIO $ writeFile "myfile.xml" str return ()
How convert Yesod.Content.Content to String or Text?
Hi Dmitry,
I would try to convert the Content. Instead, I'd write a helper function:
myXml :: String -> Hamlet MyRoute
myXml r = [hamlet|