multipart-names-0.0.1: Handling of multipart names in various casing styles

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.MultipartNames

Contents

Description

Multipart names and Prisms for them.

Synopsis

Type

data MultipartName Source

An opaque type that represents a multipart name. The initial character of each segment must be a cased letter. Currently, only ASCII letters are allowed as first characters of segments.

Construction

mkMultipartName :: [String] -> MultipartName Source

Creates a multipart name from its segments.

mkMultipartNameFromWords :: String -> MultipartName Source

Creates a multipart name from words. Equivalent to mkMultipartName . words.

isLegalSegment :: String -> Bool Source

Is this string a legal segment for a MultipartName?

Query

toSegments :: MultipartName -> [CI String] Source

Returns the segments of the name

Display

camel-case

showLowerCamel :: MultipartName -> String Source

Display as lowerCamelCased.

showUpperCamel :: MultipartName -> String Source

Display as UpperCamelCased.

hyphenated

showLowerHyphenated :: MultipartName -> String Source

Display as lower-hyphenated.

showUpperHyphenated :: MultipartName -> String Source

Display as UPPER-HYPHENATED.

underscored

showLowerUnderscored :: MultipartName -> String Source

Display as lower_underscored.

showUpperUnderscored :: MultipartName -> String Source

Display as UPPER_UNDERSCORED.

Prisms

camel-case

hyphenated

_Hyphenated :: Prism' String MultipartName Source

A Prism' to convert case-insensitive-hyphenated Strings to MultipartNames.

underscored

_Underscored :: Prism' String MultipartName Source

A Prism' to convert Case_Insensitive_Underscored Strings to MultipartNames.