私は次のコードを持っています:
{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses,
TemplateHaskell, OverloadedStrings #-}
module Simple where
import Yesod
data HelloWorld = HelloWorld
mkYesod "HelloWorld" [parseRoutes|
/ HomeR GET
|]
instance Yesod HelloWorld
getHomeR = defaultLayout [whamlet|Hello World!|]
withHelloWorld f = toWaiApp HelloWorld >>= f
main = warpDebug 3000 HelloWorld
GHCIで実行すると、正常に実行されます。
Ok, modules loaded: Simple.
*Simple> main
Application launched, listening on port 3000
しかし、それを次のように実行すると:
wai-handler-devel 3000 Simple withHelloWorld
コンソールはエラーを報告します:
pshuvaev@pshuvaev-K73SV:~/works/haskell/yesod/SimpleSite$ wai-handler-devel 3000 Simple.hs withHelloWorld
Attempting to interpret your app...
Compile failed:
Could not find module `Yesod'
Use -v to see a list of the files searched for.
何が問題なのですか?Yesodが設定され、の出力に表示されますghc-pkg list
。