restyle-0.1.0: Convert between camel case and separated words style.

Portabilityportable
Stabilityexperimental
MaintainerDaniel Fischer <daniel.is.fischer@web.de>

Data.Transform.Camel

Description

Transform separated_words identifiers to camelCase in Haskell source. Based on Richard O'Keefe's preprocessor hspp.

Synopsis

Documentation

camelSource :: Char -> String -> StringSource

Transform Haskell code written in separated_words style to the more common camelCase style.

camelSource sep source removes all occurences of sep in identifiers in source between two letters of which the first is in lower case after processing and transforms the second to upper case. Thus camelSource '_' "a_b_c" == "aB_c" since after processing the first underscore, the second is no longer preceded by a lowercase letter.

Comments (and String literals) are not transformed, so haddock comments may need manual fixing.