Portability | portable |
---|---|
Stability | experimental |
Maintainer | Daniel Fischer <daniel.is.fischer@web.de> |
Transform camelCased identifiers to separated_words.
- unCamelHTML :: Char -> String -> String
- unCamelSource :: Char -> String -> String
Transformation Functions
unCamelHTML :: Char -> String -> StringSource
Transform identifiers in (haddock-produced) HTML files from camelCase to separated_words.
The separation character is freely choosable, but it is
recommended to take one of those in Transform.Separators. Since
underscore-separated identifiers are used in some
libraries, choosing lowLine
may lead to confusion.
The separation character is inserted between a lowercase character and an uppercase character immediately following. If that uppercase character is followed by a lowercase letter, it is also transformed to lower case.
String
literals appearing in haddock comments are also
transformed. Deal with it or yell.
unCamelSource :: Char -> String -> StringSource
Transform identifiers in (non-literate) source files from camelCase to separated_words.
The separation character is freely choosable, but it is
recommended to take one of those in Transform.Separators. Since
underscore-separated identifiers are used in some
libraries, choosing lowLine
may lead to confusion.
On the other hand, it is the only one which has a
fighting chance of producing valid Haskell code.
The separation character is inserted between a lowercase character and an uppercase character immediately following. If that uppercase charcter is followed by a lowercase letter, it is also transformed to lower case.
Operators including two or more consecutive dashes are
handled correctly, i.e. |--
or --:
are not treated
as the start of a line-comment.
Single quotes in identifiers, as in foldl'
or f'2''d
, are
not considered to begin a character literal. An unfortunate
consequence of that and the simple algorithm is that in an
expression like
replicate 5'\\'
(with no space between number and character literal), the closing quote is considered to begin a character literal.
Comments are not transformed, which may lead to inconsistencies between code and comments. That may change in the future.