Data.GI.CodeGen.SymbolNaming

Synopsis

# Documentation

Same as lowerSymbol, but accepts a Name. The namespace part of the name will be discarded.

### Examples

Expand
>>> lowerName (Name "Gtk" "main_quit")
"mainQuit"


Turn the given identifier into camelCase, starting with a lowercase letter.

### Examples

Expand
>>> lowerSymbol "main_quit"
"mainQuit"


Turn the given Name into CamelCase, starting with a capital letter.

### Examples

Expand
>>> upperName (Name "Foo" "bar_baz")
"BarBaz"


noName :: Text -> CodeGen () Source #

Save a bit of typing for optional arguments in the case that we want to pass Nothing.

Name for the given argument, making sure it is a valid Haskell argument name (and escaping it if not).

Return a qualified form of the constraint for the given name (which should correspond to a valid TInterface).

Same as classConstraint, but applicable directly to a type. The type should be a TInterface, otherwise an error will be raised.

Turn a hyphen-separated identifier into camel case.

### Examples

Expand
>>> hyphensToCamelCase "one-sample-string"
"OneSampleString"


Similarly to hyphensToCamelCase, turn a name separated_by_underscores into CamelCase. We preserve final and initial underscores, and n>1 consecutive underscores are transformed into n-1 underscores.

### Examples

Expand
>>> underscoresToCamelCase "sample_id"
"SampleId"

>>> underscoresToCamelCase "_internal_id_"
"_InternalId_"

>>> underscoresToCamelCase "multiple___underscores"
"Multiple__Underscores"


Foreign type associated with a callback type. It can be passed in qualified.

Haskell type exposing the closure arguments, which are generally elided.

The name of a function which takes a callback without closure arguments, and generates a function which does accep the closures, but simply ignores them.

The name of the dynamic wrapper for the given callback type. It can be passed in qualified.

The name for the foreign wrapper allocator (foreign import "wrapper" ...) for the given callback type. It can be passed in qualified.

The name of the Haskell to foreign wrapper for the given callback type. It can be passed in qualified.

The name of the Haskell to foreign wrapper for the given callback type, keeping the closure arguments (we usually elide them). The callback type can be passed in qualified.

The name for the closure generator for the given callback type. It can be passed in qualified.

Construct the submodule path where the given API element will live. This is the path relative to the root for the corresponding namespace. I.e. the GI.Gtk part is not prepended.

Return an identifier for the given interface type valid in the current module.

Construct an identifier for the given symbol in the given API.