[Ur] Attempting to do Exercise 7.3 of Gian Perrone's UrWeb (blog) tutorial - trying to a logout() function and link to it - getting compiler errors

Stefan Scott Alexander stefanscottalexx at gmail.com
Wed Jan 28 17:38:34 EST 2015


On a related note:

Is it even considered "good practice" to take a function which returns a
page, and attempt to modify it by (first "unrwapping" it and then)
appending another fragment of xml to it (and then "rewrapping" it into a
[transaction page] again)?

This is what I have been trying to do in Exercise 7.3 of Gian Perrone's
tutorial - append a logout link to all the pages on the website (when the
user is already authenticated).

Then I realized that my function [pageWithLogout()] might not work very
well. For example, given a page [pg], it tries to output another page made
up of: an empty <head/> tag, with the "unwrapped" [pg] appended to it.

What if [pg] itself had a head tag?

I remember some framework I was studying was "smart" enough, when joining
<xml> fragments, to "merge" all the the content of their <head> tags into a
*single* <head> tag - but I can't remember if that framework was UrWeb
(maybe it was Yesod? :-).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20150128/d9ff505b/attachment.html>


More information about the Ur mailing list