Safe Haskell | None |
---|---|
Language | Haskell2010 |
Exposes naming cases.
Synopsis
- data Pascal = Pascal UpperChar [AlphaNumChar]
- unPascal :: Pascal -> String
- parsePascal :: CodeParsing m => m Pascal
- pascalQ :: QuasiQuoter
- data NonEmpty = NonEmpty Char String
- unNonEmpty :: NonEmpty -> String
- parseNonEmpty :: CodeParsing m => m NonEmpty
- fromString :: String -> Maybe NonEmpty
- nonEmptyQ :: QuasiQuoter
- data Camel = Camel AlphaChar [AlphaNumChar]
- unCamel :: Camel -> String
- parseCamel :: CodeParsing m => m Camel
- camelQ :: QuasiQuoter
- data Sneak = Sneak SneakHeadChar [SneakChar]
- unSneakCase :: Sneak -> String
- parseSneakCase :: CodeParsing m => m Sneak
- sneakQ :: QuasiQuoter
- data LowerString = LowerString LowerChar [LowerChar]
- unLowerString :: LowerString -> String
- parseLowerString :: CodeParsing m => m LowerString
- lowerStringQ :: QuasiQuoter
Documentation
>>>
:set -XQuasiQuotes
Non empty PascalCase names "[A-Z][a-zA-Z0-9]*"
parsePascal :: CodeParsing m => m Pascal Source #
Non empty names ".+"
unNonEmpty :: NonEmpty -> String Source #
parseNonEmpty :: CodeParsing m => m NonEmpty Source #
nonEmptyQ :: QuasiQuoter Source #
Makes a non empty string from String on the compile time. Also throws compile error if the empty string is passed.
>>>
[nonEmptyQ|x|]
NonEmpty 'x' ""
>>>
[nonEmptyQ|foo|]
NonEmpty 'f' "oo"
>>>
[nonEmptyQ|Bar|]
NonEmpty 'B' "ar"
Non empty camelCase names "[a-zA-Z][a-zA-Z0-9]*"
parseCamel :: CodeParsing m => m Camel Source #
camelQ :: QuasiQuoter Source #
Non empty sneak_case names "[a-zA-Z_][a-zA-Z0-9_]*"
unSneakCase :: Sneak -> String Source #
parseSneakCase :: CodeParsing m => m Sneak Source #
sneakQ :: QuasiQuoter Source #
Simular to nonEmptyQ
,
but naming outsides of Sneak
will be rejected.
>>>
[sneakQ|foo_bar|]
Sneak (SneakHeadAlpha (AlphaLower F_)) [SneakAlphaNum (AlphaNumAlpha (AlphaLower O_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower O_)),SneakUnderscore,SneakAlphaNum (AlphaNumAlpha (AlphaLower B_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower A_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower R_))]
>>>
[sneakQ|__constructor|]
Sneak SneakHeadUnderscore [SneakUnderscore,SneakAlphaNum (AlphaNumAlpha (AlphaLower C_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower O_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower N_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower S_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower T_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower R_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower U_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower C_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower T_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower O_)),SneakAlphaNum (AlphaNumAlpha (AlphaLower R_))]
>>>
[sneakQ|FOO_MEE_9|]
Sneak (SneakHeadAlpha (AlphaUpper F)) [SneakAlphaNum (AlphaNumAlpha (AlphaUpper O)),SneakAlphaNum (AlphaNumAlpha (AlphaUpper O)),SneakUnderscore,SneakAlphaNum (AlphaNumAlpha (AlphaUpper M)),SneakAlphaNum (AlphaNumAlpha (AlphaUpper E)),SneakAlphaNum (AlphaNumAlpha (AlphaUpper E)),SneakUnderscore,SneakAlphaNum (AlphaNumDigit D9)]
data LowerString Source #
Non empty "veryflatten" names [a-z]+
Instances
Eq LowerString Source # | |
Defined in Data.String.Cases (==) :: LowerString -> LowerString -> Bool # (/=) :: LowerString -> LowerString -> Bool # | |
Show LowerString Source # | |
Defined in Data.String.Cases showsPrec :: Int -> LowerString -> ShowS # show :: LowerString -> String # showList :: [LowerString] -> ShowS # | |
Pretty LowerString Source # | |
Defined in Data.String.Cases pretty :: LowerString -> Doc ann # prettyList :: [LowerString] -> Doc ann # |
unLowerString :: LowerString -> String Source #
parseLowerString :: CodeParsing m => m LowerString Source #
lowerStringQ :: QuasiQuoter Source #
Simular to nonEmptyQ
,
but naming outsides of LowerString
will be rejected.
>>>
[lowerStringQ|imavimmer|]
LowerString I_ [M_,A_,V_,I_,M_,M_,E_,R_]