私はこのコードを実行しようとしたたびに、コンパイラは変数redirectUrlGraphEmail
、、aboutContents
は「しない範囲で」エラーを返し、staticDir
:タプルに含まれる変数を定義する方法は?
staticDir <- getStaticDir
redirectUrlGraphEmail <- retrieveAuthURL testUrl
redirectUrlGraphPost <- retrieveAuthURL testPostUrl
aboutContents <- LazyIO.readFile $ markdownPath ++ "README.md"
privacyContents <- LazyIO.readFile $ markdownPath ++ "PRIVACY.md"
:
routes :: [ (String, ServerPart Response)]
routes = [
("graph-fb", seeOther redirectUrlGraphEmail $ toResponse ""),
("post-fb", seeOther redirectUrlGraphPost $ toResponse ""),
("about", aboutResponse aboutContents),
("static", serveDirectory DisableBrowsing [] staticDir)]
これらの変数がで宣言されています
しかし、私はこれらの行をどこにモジュールに追加するべきかわかりません。どんな助け?
完全な例を1つのファイルに表示できますか?あなたが変数がグローバルなものかそうであると期待しているようです。 –