From: pho Date: Fri, 11 Dec 2009 06:04:34 +0000 (+0900) Subject: Cosmetic changes suggested by hlint X-Git-Tag: RELEASE-0_4_1^0 X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=f557285fa55e17ae2b3467b1cda6152c9ee1d004;p=Lucu.git Cosmetic changes suggested by hlint Ignore-this: e333aa419e29b709beba6d17b9411ebb darcs-hash:20091211060434-62b54-d2c7c3f3a7bcfb6959eca959acd7fb6a4f91d49c.gz --- diff --git a/Network/HTTP/Lucu/Resource/Tree.hs b/Network/HTTP/Lucu/Resource/Tree.hs index 660d8ff..4cb4932 100644 --- a/Network/HTTP/Lucu/Resource/Tree.hs +++ b/Network/HTTP/Lucu/Resource/Tree.hs @@ -15,6 +15,7 @@ module Network.HTTP.Lucu.Resource.Tree ) where +import Control.Arrow import Control.Concurrent import Control.Concurrent.STM import Control.Exception @@ -140,13 +141,10 @@ data ResNode = ResNode (Maybe ResourceDef) ResSubtree -- ] -- @ mkResTree :: [ ([String], ResourceDef) ] -> ResTree -mkResTree = processRoot . mapFirst canonicalisePath +mkResTree = processRoot . map (first canonicalisePath) where - mapFirst :: (a -> a') -> [(a, b)] -> [(a', b)] - mapFirst f = map (\ (a, b) -> (f a, b)) - canonicalisePath :: [String] -> [String] - canonicalisePath = filter (\ x -> x /= "") + canonicalisePath = filter (/= "") processRoot :: [ ([String], ResourceDef) ] -> ResTree processRoot list