diff options
author | Joey Hess <joeyh@joeyh.name> | 2016-02-14 16:26:39 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2016-02-14 16:26:39 -0400 |
commit | 3c72634bb790eac407291b579afb4f501b3a4a11 (patch) | |
tree | 31b63c19e2818587c3721a60fd1503690f11c4d1 /Utility | |
parent | a9d21cdd040783b41bbecbcec94fbc1559c6928b (diff) |
better types
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Format.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Utility/Format.hs b/Utility/Format.hs index 784496310..1ebf68d6c 100644 --- a/Utility/Format.hs +++ b/Utility/Format.hs @@ -103,7 +103,7 @@ empty _ = False {- Decodes a C-style encoding, where \n is a newline, \NNN is an octal - encoded character, and \xNN is a hex encoded character. -} -decode_c :: FormatString -> FormatString +decode_c :: FormatString -> String decode_c [] = [] decode_c s = unescape ("", s) where @@ -141,14 +141,14 @@ decode_c s = unescape ("", s) handle n = ("", n) {- Inverse of decode_c. -} -encode_c :: FormatString -> FormatString +encode_c :: String -> FormatString encode_c = encode_c' (const False) {- Encodes more strictly, including whitespace. -} -encode_c_strict :: FormatString -> FormatString +encode_c_strict :: String -> FormatString encode_c_strict = encode_c' isSpace -encode_c' :: (Char -> Bool) -> FormatString -> FormatString +encode_c' :: (Char -> Bool) -> String -> FormatString encode_c' p = concatMap echar where e c = '\\' : [c] |