summaryrefslogtreecommitdiff
path: root/Utility/Format.hs
diff options
context:
space:
mode:
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