Created
December 22, 2012 12:39
-
-
Save crufter/4358747 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This works | |
import Network.Wai | |
app Request{requestMethod = m, pathInfo = p} = do | |
case (m, p) of | |
("GET", []) -> return index | |
_ -> return notFound | |
-- But not this | |
import qualified Network.Wai as Wai | |
app Wai.Request{requestMethod = m, pathInfo = p} = do | |
case (m, p) of | |
("GET", []) -> return index | |
_ -> return notFound | |
-- Above snippet fails with: | |
-- 'requestMethod' is not a (visible) field of constructor 'Wai.Request' | |
-- 'pathInfo' is not a (visible) field of constructor 'Wai.Request' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment