Created
April 17, 2011 21:04
-
-
Save ostronom/924468 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Views where | |
| import Control.Monad | |
| import Happstack.Server (ServerPart, Response, ok, toResponse, dir) | |
| import Text.Blaze ((!)) | |
| import qualified Text.Blaze.Html5 as H | |
| import qualified Text.Blaze.Html5.Attributes as A | |
| routes = msum [ dir "smth" $ notok | |
| , index | |
| ] | |
| mainTpl :: H.Html | |
| mainTpl = | |
| H.docTypeHtml $ do | |
| H.head $ do | |
| H.title "A" | |
| H.body $ do | |
| H.p "OK!" | |
| index :: ServerPart Response | |
| index = ok $ toResponse $ mainTpl | |
| notok :: ServerPart Response | |
| notok = ok $ toResponse "NOT OK!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Views.hs:26:14: | |
| No instance for (Happstack.Server.Response.ToMessage H.Html) | |
| arising from a use of `toResponse' | |
| Possible fix: | |
| add an instance declaration for | |
| (Happstack.Server.Response.ToMessage H.Html) | |
| In the expression: toResponse | |
| In the second argument of `($)', namely `toResponse $ mainTpl' | |
| In the expression: ok $ toResponse $ mainTpl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment