I'm building a simple application using Yesod and I'm having a hard time bringing in external files. Here is my code:
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
import Yesod
data GomokuServer = GomokuServer
mkYesod "GomokuServer" [parseRoutes|
/ HomeR GET
|]
instance Yesod GomokuServer
getHomeR :: Handler Html
getHomeR = defaultLayout $ do
$(hamletFile "./src/templates/home.hamlet")
$(luciusFile "./src/templates/home.lucius")
main :: IO ()
main = warp 3000 GomokuServer
It works great when I use quasiquotes, or if I replace hamletFile
with whamletFile
, but otherwise it won't compile because it can't find hamletFile
or luciusFile
. I'm using Yesod version 1.4 and I thought those methods where imported with the core Yesod package. Are they not?