Happstack を使用して単純なリクエスト ハンドラーを実装しようとしています。
main :: IO ()
main = simpleHTTP nullConf app
app :: ServerPart Response
app = msum [
dir "hello" $ method GET >> helloGet
, dir "hello" $ method POST >> helloPost
]
を繰り返さずに同様のことを達成するにはどうすればよいdir "hello"
ですか?
これ、
app :: ServerPart Response
app = msum [
dir "hello" $ do
method GET >> helloGet
method POST >> helloPost
, okResponse home
]
デフォルトの部分にのみ「フォールスルー」します。