From f557285fa55e17ae2b3467b1cda6152c9ee1d004 Mon Sep 17 00:00:00 2001 From: pho Date: Fri, 11 Dec 2009 15:04:34 +0900 Subject: [PATCH] Cosmetic changes suggested by hlint Ignore-this: e333aa419e29b709beba6d17b9411ebb darcs-hash:20091211060434-62b54-d2c7c3f3a7bcfb6959eca959acd7fb6a4f91d49c.gz --- Network/HTTP/Lucu/Resource/Tree.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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 -- 2.40.0