)
where
+import Control.Arrow
import Control.Concurrent
import Control.Concurrent.STM
import Control.Exception
-- ]
-- @
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