Skip to content

Instantly share code, notes, and snippets.

@crufter
Created December 22, 2012 12:39
Show Gist options
  • Save crufter/4358747 to your computer and use it in GitHub Desktop.
Save crufter/4358747 to your computer and use it in GitHub Desktop.
-- 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