My guess is widgetToPageContent is a function that takes "do addCassius ..." and returns a value in the monad "m T" where "T" is some datatype like "data T = PageContent  x y z | ..." . The "<-" removes the "m" from "m T" and pattern matches  "x", "y" and "z" to "title", "headTags" and "bodyTags".


-deech

On Fri, May 13, 2011 at 9:55 PM, <blackcat@pro-ns.net> wrote:
In The Yesod Book, I see the following code:

defaultLayout contents = do
       PageContent title headTags bodyTags <- widgetToPageContent $ do
           addCassius ...

How does this work?  Is bodyTags drawn from widgetToPageContent and then used as the third argument to PageContent?

tia,
Lee


_______________________________________________
Beginners mailing list
Beginners@haskell.org
http://www.haskell.org/mailman/listinfo/beginners