antelude-0.1.0: Yet another alternative Prelude for Haskell.
Maintainerdneavesdev@pm.me
Safe HaskellSafe
LanguageGHC2021

Antelude.String.Case

Description

 
Synopsis

Documentation

data Case Source #

A listing of all real and theoretical cases to convert from/to.

For reference:

  • sentence cases use spaces like a regular sentence
  • snake_cases_use_underscores_between_words
  • hyphen-cases-use-hyphens-as-one-would-expect
  • dot.cases.use.periods.maybe.useful.for.codegen
  • forward/path/case/uses/forward/slashes
  • back\path\case\uses\back\slashes
  • camelCase and PascalCase look like these

Instances

Instances details
Show Case Source # 
Instance details

Defined in Antelude.String.Case

Methods

showsPrec :: Int -> Case -> ShowS #

show :: Case -> String #

showList :: [Case] -> ShowS #

Eq Case Source # 
Instance details

Defined in Antelude.String.Case

Methods

(==) :: Case -> Case -> Bool #

(/=) :: Case -> Case -> Bool #

String Deconstruction/Reconstruction

buildCase :: Case -> List String -> String Source #

Construct a String of a desired Case from a List of parts

identifyCase :: String -> Maybe Case Source #

Identify the Case the String is using

recase :: Case -> String -> Maybe String Source #

Given a desired Case and a String, try and convert to the given Case. Returns a Maybe, in case the original case could not be identified.

uncase :: String -> Maybe (List String) Source #

Deconstruct a String by identifying its Case. Returns a Maybe, in case the case could not be identified.

Simple Conversions

lowerCase :: String -> String Source #

Convert an entire String to lower case. May be good for preprocessing an ambiguous-case string before recase-ing, but results vary depending on the string.

screamingCase :: String -> String Source #

Convert an entire String to SCREAMING CASE. May be good for preprocessing an ambiguous-case string before recase-ing, but results vary depending on the string.

titleCase :: String -> String Source #

Convert an entire String to Title case. Results may vary depending on the string.