summaryrefslogtreecommitdiff
path: root/Utility/Format.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-01-21 02:24:12 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-01-21 02:49:32 -0400
commit183bdacca219065e6a888385e3bf309708e827ec (patch)
tree6ee1c6ba8b75de8b182fd969b612a8557f72360c /Utility/Format.hs
parenteb9001044f3db682236d1007aded58f47109d6a6 (diff)
treak
Diffstat (limited to 'Utility/Format.hs')
-rw-r--r--Utility/Format.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/Utility/Format.hs b/Utility/Format.hs
index 2c2042cc2..d8b7e4549 100644
--- a/Utility/Format.hs
+++ b/Utility/Format.hs
@@ -37,9 +37,11 @@ data Frag = Const String | Var String Justify
data Justify = LeftJustified Int | RightJustified Int | UnJustified
deriving (Show)
+type Variables = M.Map String String
+
{- Expands a Format using some variables, generating a formatted string.
- This can be repeatedly called, efficiently. -}
-format :: Format -> M.Map String String -> String
+format :: Format -> Variables -> String
format f vars = concatMap expand f
where
expand (Const s) = s