openapi3-code-generator-0.1.0.6: OpenAPI3 Haskell Client Code Generator

Safe HaskellNone
LanguageHaskell2010

OpenAPI.Generate.Internal.Util

Description

Utility functions for the OpenAPI code generator

Synopsis

Documentation

haskellifyText Source #

Arguments

:: Bool

Should the identifier be transformed to CamelCase?

-> Bool

Should the first character of the identifier be uppercase?

-> Text

The identifier to transform

-> String

The resulting identifier

Transform an identifier to ensure it is a valid Haskell identifier Additionally, this function applies style settings according to the need of the consumer.

haskellifyName :: Bool -> Bool -> Text -> Name Source #

The same as haskellifyText but transform the result to a Name

transformToModuleName :: Text -> Text Source #

Transform a module name to ensure it is valid for file names

uppercaseFirstText :: Text -> Text Source #

Uppercase the first character of a Text

mapMaybeM :: Monad m => (a -> m (Maybe b)) -> [a] -> m [b] Source #

liftedAppend :: (Applicative f, Semigroup a) => f a -> f a -> f a Source #

Lifted version of <> which can be used with Semigroups inside Applicatives

splitOn :: Eq a => a -> [a] -> [[a]] Source #

Split a list on on a given element

joinWithPoint :: [String] -> String Source #

Concat a list of strings with a point

>>> joinWithPoint ["a", "b", "c"]
"a.b.c"

joinWith :: Monoid a => a -> [a] -> a Source #

Concat a list of values separated by an other value