I have been trying to find in the Haskell reference the use of this:
getHomeR = defaultLayout $ do
setTitle "My Awesome Site"
$(widgetFile "home")
Specifically:
$(widgetFile "home")
I know that the $ operator gives precedence to whatever is to the right of it, but I have not been able to comprehend the usage of $(). Anyone?
This is not using the $
application operator, but is involving a Template Haskell slice.
Very roughly, widgetFile "home"
is code which is run at compile time: it generates Haskell code, which is then compiled as usual. It's a form of metaprogramming in Haskell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With