, extra_frameworks= e_frames
})
where
- expandStrings = mapM expandString
+ expandStrings vs = do
+ xs <- mapM expandString vs
+ -- Flatten the elements of the expanded list; this is
+ -- to permit substitutions for list-valued variables. e.g.,
+ -- package_deps["${deps}"] where env var (say) 'deps'
+ -- is "base,haskell98,network"
+ return (concat (map (wordsBy (==',')) xs))
-- Just for fun, keep this in the IO monad.
expandString :: String -> IO String
show nm)
return "")
+wordsBy :: (Char -> Bool) -> String -> [String]
+wordsBy p s = case dropWhile p s of
+ "" -> []
+ s' -> w : wordsBy p s'' where (w,s'') = break p s'
+
-----------------------------------------------------------------------------
getProgramName :: IO String