haskell-gi-0.26.17: Generate Haskell bindings for GObject Introspection capable libraries

Safe Haskell | None
Language | Haskell2010

Data.GI.CodeGen.ModulePath

Description

Abstract representation for paths into modules.

Synopsis

- newtype ModulePath = ModulePath {
  - modulePathToList :: [Text]
  }
- toModulePath :: Text -> ModulePath
- (/.) :: ModulePath -> Text -> ModulePath
- dotModulePath :: ModulePath -> Text

# Documentation

newtype ModulePath Source #

A path to a module.

Constructors

ModulePath |

Fields

- modulePathToList :: [Text]

#### Instances

Instances details

Monoid ModulePath Source # |
Instance details Defined in Data.GI.CodeGen.ModulePath Methods mempty :: ModulePath Source # mappend :: ModulePath -> ModulePath -> ModulePath Source # mconcat :: [ModulePath] -> ModulePath Source #
Semigroup ModulePath Source # |
Instance details Defined in Data.GI.CodeGen.ModulePath Methods (<>) :: ModulePath -> ModulePath -> ModulePath Source # sconcat :: NonEmpty ModulePath -> ModulePath Source # stimes :: Integral b => b -> ModulePath -> ModulePath Source #
IsString ModulePath Source # | Construct a `ModulePath` from a `String`.
Instance details Defined in Data.GI.CodeGen.ModulePath Methods fromString :: String -> ModulePath Source #
Show ModulePath Source # |
Instance details Defined in Data.GI.CodeGen.ModulePath Methods showsPrec :: Int -> ModulePath -> ShowS Source # show :: ModulePath -> String Source # showList :: [ModulePath] -> ShowS Source #
Eq ModulePath Source # |
Instance details Defined in Data.GI.CodeGen.ModulePath Methods (==) :: ModulePath -> ModulePath -> Bool Source # (/=) :: ModulePath -> ModulePath -> Bool Source #
Ord ModulePath Source # |

Instance details

Defined in Data.GI.CodeGen.ModulePath

Methods

compare :: ModulePath -> ModulePath -> Ordering Source #

(<) :: ModulePath -> ModulePath -> Bool Source #

(<=) :: ModulePath -> ModulePath -> Bool Source #

(>) :: ModulePath -> ModulePath -> Bool Source #

(>=) :: ModulePath -> ModulePath -> Bool Source #

max :: ModulePath -> ModulePath -> ModulePath Source #

min :: ModulePath -> ModulePath -> ModulePath Source #

toModulePath :: Text -> ModulePath Source #

Construct a path into the given GIR namespace. The given `Text` will be split along ".".

### Examples

Expand

    >>> dotModulePath (toModulePath "Foo")
    "Foo"

    >>> dotModulePath ("Foo" <> toModulePath "Bar.Baz")
    "Foo.Bar.Baz"

    >>> dotModulePath ("Foo" <> toModulePath "bar.baz")
    "Foo.Bar.Baz"

(/.) :: ModulePath -> Text -> ModulePath Source #

Append the given component to the given module path.

### Examples

Expand

    >>> dotModulePath ("Foo" /. "Bar")
    "Foo.Bar"

dotModulePath :: ModulePath -> Text Source #

Turn a module path into the corresponding dotted string. Note that the implementation ensures that the module names start with a capital letter.

### Examples

Expand

    >>> dotModulePath ("Foo" /. "Bar" /. "Baz")
    "Foo.Bar.Baz"

    >>> dotModulePath ("foo" /. "bar" /. "baz")
    "Foo.Bar.Baz"