I try to create a new route in yesod / haskell with a handler called state, but I get the error empty 'do' block
The steps to reproduce are the following:
- Create new yesod application:
stack new haskellYesod yesodweb/simple yesod add-handlerfor adding a new handler with the params:- Name of route: State
- Route Pattern: /state/
- Methods: GET
- Add following code in
src/Handler/State.hs
module Handler.State where
import Import
getStateR :: Handler Html
getStateR = do
defaultLayout $ do
$(widgetFile "bla")
- Create simple HTML site
templates/bla.hamlet:
<h1> BLA!
- Start server with
stack exec yesod devel
After that I get the error:
src/Handler/State.hs:7:21: error: Empty 'do' block
|
7 | defaultLayout $ do