Cabal-1.16.0: A framework for packaging Haskell software

Safe HaskellSafe-Inferred



Data type for Haskell module names.



data ModuleName Source

A valid Haskell module name.

fromString :: String -> ModuleNameSource

Construct a ModuleName from a valid module name String.

This is just a convenience function intended for valid module strings. It is an error if it is used with a string that is not a valid module name. If you are parsing user input then use simpleParse instead.

components :: ModuleName -> [String]Source

The individual components of a hierarchical module name. For example

 components (fromString "A.B.C") = ["A", "B", "C"]

toFilePath :: ModuleName -> FilePathSource

Convert a module name to a file path, but without any file extension. For example:

 toFilePath (fromString "A.B.C") = "A/B/C"

main :: ModuleNameSource

The module name Main.

simple :: String -> ModuleNameSource

Deprecated: use ModuleName.fromString instead