Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Data.GI.CodeGen.ModulePath
Description
Abstract representation for paths into modules.
- newtype ModulePath = ModulePath {
- modulePathToList :: [Text]
- toModulePath :: Text -> ModulePath
- (/.) :: ModulePath -> Text -> ModulePath
- dotModulePath :: ModulePath -> Text
Documentation
newtype ModulePath #
A path to a module.
Constructors
ModulePath | |
Fields
|
Instances
Eq ModulePath # | |
Ord ModulePath # | |
Show ModulePath # | |
IsString ModulePath # | Construct a |
Monoid ModulePath # |
|
toModulePath :: Text -> ModulePath #
Construct a path into the given GIR namespace. The given Text
will be split along ".".
Examples
>>>
dotModulePath (toModulePath "Foo")
"Foo"
>>>
dotModulePath ("Foo" <> toModulePath "Bar.Baz")
"Foo.Bar.Baz"
>>>
dotModulePath ("Foo" <> toModulePath "bar.baz")
"Foo.Bar.Baz"
(/.) :: ModulePath -> Text -> ModulePath #
Append the given component to the given module path.
Examples
>>>
dotModulePath ("Foo" /. "Bar")
"Foo.Bar"
dotModulePath :: ModulePath -> Text #
Turn a module path into the corresponding dotted string. Note that the implementation ensures that the module names start with a capital letter.
Examples
>>>
dotModulePath ("Foo" /. "Bar" /. "Baz")
"Foo.Bar.Baz"
>>>
dotModulePath ("foo" /. "bar" /. "baz")
"Foo.Bar.Baz"