Permalink
Browse files

remove unnecessary branch.

  • Loading branch information...
1 parent c5003bd commit 55c8d28bb2601010454255844538e9b6481020f0 @yihuang yihuang committed Feb 10, 2012
Showing with 7 additions and 9 deletions.
  1. +7 −9 Data/Configurator.hs
View
@@ -291,15 +291,13 @@ interpolate pfx s env
| otherwise = return s
where
lookupEnv name = msum $ map (flip H.lookup env) fullnames
- where fullnames = if T.null pfx
- then [name]
- else map (T.intercalate ".") -- ["a.b.c.x","a.b.x","a.x","x"]
- . map (reverse . (name:)) -- [["a","b","c","x"],["a","b","x"],["a","x"],["x"]]
- . tails -- [["c","b","a"],["b","a"],["a"],[]]
- . reverse -- ["c","b","a"]
- . filter (not . T.null) -- ["a","b","c"]
- . T.split (=='.') -- ["a","b","c",""]
- $ pfx -- "a.b.c."
+ where fullnames = map (T.intercalate ".") -- ["a.b.c.x","a.b.x","a.x","x"]
+ . map (reverse . (name:)) -- [["a","b","c","x"],["a","b","x"],["a","x"],["x"]]
+ . tails -- [["c","b","a"],["b","a"],["a"],[]]
+ . reverse -- ["c","b","a"]
+ . filter (not . T.null) -- ["a","b","c"]
+ . T.split (=='.') -- ["a","b","c",""]
+ $ pfx -- "a.b.c."
interpret (Literal x) = return (fromText x)
interpret (Interpolate name) =

0 comments on commit 55c8d28

Please sign in to comment.