]> gitweb @ CieloNegro.org - Lucu.git/blobdiff - Network/HTTP/Lucu/Resource/Tree.hs
Exodus to GHC 6.8.1
[Lucu.git] / Network / HTTP / Lucu / Resource / Tree.hs
index 2cd498f7ade7c7f4e5435d2344e161a5717cf65e..cef168cb522322e80bdbb164a68f3e2db678f3a5 100644 (file)
@@ -31,7 +31,7 @@ import           Network.HTTP.Lucu.Resource
 import           Network.HTTP.Lucu.Response
 import           Network.HTTP.Lucu.Interaction
 import           Network.HTTP.Lucu.Utils
-import           Network.URI
+import           Network.URI hiding (path)
 import           System.IO
 import           System.IO.Error hiding (catch)
 import           Prelude hiding (catch)
@@ -114,7 +114,7 @@ data ResNode    = ResNode !(Maybe ResourceDef) !ResSubtree
 --             ]
 -- @
 mkResTree :: [ ([String], ResourceDef) ] -> ResTree
-mkResTree list = list `seq` processRoot list
+mkResTree xs = xs `seq` processRoot xs
     where
       processRoot :: [ ([String], ResourceDef) ] -> ResTree
       processRoot list
@@ -166,14 +166,14 @@ findResource (ResTree (ResNode rootDefM subtree)) fbs uri
     where
       walkTree :: ResSubtree -> [String] -> [String] -> Maybe ([String], ResourceDef)
 
-      walkTree subtree (name:[]) soFar
-          = case M.lookup name subtree of
+      walkTree tree (name:[]) soFar
+          = case M.lookup name tree of
               Nothing               -> Nothing
               Just (ResNode defM _) -> do def <- defM
                                           return (soFar ++ [name], def)
 
-      walkTree subtree (x:xs) soFar
-          = case M.lookup x subtree of
+      walkTree tree (x:xs) soFar
+          = case M.lookup x tree of
               Nothing                      -> Nothing
               Just (ResNode defM children) -> case defM of
                                                 Just (ResourceDef { resIsGreedy = True })
@@ -215,6 +215,7 @@ runResource def itr
               POST   -> resPost def
               PUT    -> resPut def
               DELETE -> resDelete def
+              _      -> undefined
 
       notAllowed :: Resource ()
       notAllowed = do setStatus MethodNotAllowed
@@ -239,7 +240,7 @@ runResource def itr
                            ErrorCall    msg  -> Abortion InternalServerError emptyHeaders $ Just msg
                            IOException  ioE  -> Abortion InternalServerError emptyHeaders $ Just $ formatIOE ioE
                            DynException dynE -> case fromDynamic dynE of
-                                                  Just (abo :: Abortion) -> abo
+                                                  Just (a :: Abortion) -> a
                                                   Nothing
                                                       -> Abortion InternalServerError emptyHeaders
                                                          $ Just $ show exc