better types
This commit is contained in:
parent
4100dd9733
commit
613d6056f5
1 changed files with 4 additions and 4 deletions
|
@ -103,7 +103,7 @@ empty _ = False
|
||||||
{- Decodes a C-style encoding, where \n is a newline, \NNN is an octal
|
{- Decodes a C-style encoding, where \n is a newline, \NNN is an octal
|
||||||
- encoded character, and \xNN is a hex encoded character.
|
- encoded character, and \xNN is a hex encoded character.
|
||||||
-}
|
-}
|
||||||
decode_c :: FormatString -> FormatString
|
decode_c :: FormatString -> String
|
||||||
decode_c [] = []
|
decode_c [] = []
|
||||||
decode_c s = unescape ("", s)
|
decode_c s = unescape ("", s)
|
||||||
where
|
where
|
||||||
|
@ -141,14 +141,14 @@ decode_c s = unescape ("", s)
|
||||||
handle n = ("", n)
|
handle n = ("", n)
|
||||||
|
|
||||||
{- Inverse of decode_c. -}
|
{- Inverse of decode_c. -}
|
||||||
encode_c :: FormatString -> FormatString
|
encode_c :: String -> FormatString
|
||||||
encode_c = encode_c' (const False)
|
encode_c = encode_c' (const False)
|
||||||
|
|
||||||
{- Encodes more strictly, including whitespace. -}
|
{- Encodes more strictly, including whitespace. -}
|
||||||
encode_c_strict :: FormatString -> FormatString
|
encode_c_strict :: String -> FormatString
|
||||||
encode_c_strict = encode_c' isSpace
|
encode_c_strict = encode_c' isSpace
|
||||||
|
|
||||||
encode_c' :: (Char -> Bool) -> FormatString -> FormatString
|
encode_c' :: (Char -> Bool) -> String -> FormatString
|
||||||
encode_c' p = concatMap echar
|
encode_c' p = concatMap echar
|
||||||
where
|
where
|
||||||
e c = '\\' : [c]
|
e c = '\\' : [c]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue