Cabal-2.0.1.0: A framework for packaging Haskell software

Copyright | Duncan Coutts 2008
License | BSD3
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | None
Language | Haskell2010

Distribution.ModuleName

Contents

- Internal

Description

Data type for Haskell module names.

Synopsis

- newtype ModuleName = ModuleName ShortTextLst
- fromString :: IsString a => String -> a
- fromComponents :: [String] -> ModuleName
- components :: ModuleName -> [String]
- toFilePath :: ModuleName -> FilePath
- main :: ModuleName
- simple :: String -> ModuleName
- validModuleComponent :: String -> Bool

# Documentation

newtype ModuleName #

A valid Haskell module name.

Constructors

ModuleName ShortTextLst |

Instances

Eq ModuleName # |
Methods (==) :: ModuleName -> ModuleName -> Bool # (/=) :: ModuleName -> ModuleName -> Bool #
Data ModuleName # |

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ModuleName -> c ModuleName Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ModuleName Source #

toConstr :: ModuleName -> Constr Source #

dataTypeOf :: ModuleName -> DataType Source #

dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ModuleName) Source #

dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleName) Source #

gmapT :: (forall b. Data b => b -> b) -> ModuleName -> ModuleName Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ModuleName -> r Source #

gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ModuleName -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ModuleName -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleName -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName Source #

Ord ModuleName # |
Methods compare :: ModuleName -> ModuleName -> Ordering # (<) :: ModuleName -> ModuleName -> Bool # (<=) :: ModuleName -> ModuleName -> Bool # (>) :: ModuleName -> ModuleName -> Bool # (>=) :: ModuleName -> ModuleName -> Bool # max :: ModuleName -> ModuleName -> ModuleName # min :: ModuleName -> ModuleName -> ModuleName #
Read ModuleName # |
Methods readsPrec :: Int -> ReadS ModuleName Source # readList :: ReadS [ModuleName] Source # readPrec :: ReadPrec ModuleName Source # readListPrec :: ReadPrec [ModuleName] Source #
Show ModuleName # |
Methods showsPrec :: Int -> ModuleName -> ShowS Source # show :: ModuleName -> String Source # showList :: [ModuleName] -> ShowS Source #
IsString ModuleName # | 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.
Methods fromString :: String -> ModuleName Source #
Generic ModuleName # |
Associated Types type Rep ModuleName :: * -> * Source # Methods from :: ModuleName -> Rep ModuleName x Source # to :: Rep ModuleName x -> ModuleName Source #
NFData ModuleName # |
Methods rnf :: ModuleName -> () Source #
Binary ModuleName # |
Methods put :: ModuleName -> Put Source # get :: Get ModuleName Source # putList :: [ModuleName] -> Put Source #
Text ModuleName # |
Methods disp :: ModuleName -> Doc # parse :: ReadP r ModuleName #
ModSubst (Set ModuleName) # |
Methods modSubst :: OpenModuleSubst -> Set ModuleName -> Set ModuleName #
type Rep ModuleName # |
type Rep ModuleName

fromString :: IsString a => String -> a Source #

fromComponents :: [String] -> ModuleName #

Construct a `ModuleName` from valid module components, i.e. parts separated by dots.

components :: ModuleName -> [String] #

The individual components of a hierarchical module name. For example

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

toFilePath :: ModuleName -> FilePath #

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

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

main :: ModuleName #

The module name `Main`.

simple :: String -> ModuleName #

Deprecated: use ModuleName.fromString instead

# Internal

validModuleComponent :: String -> Bool #