[Haskell-beginners] do-notation question

aditya siram aditya.siram at gmail.com
Sat May 14 05:10:03 CEST 2011


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 at 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110513/9102eace/attachment-0001.htm>


More information about the Beginners mailing list