Copyright | Duncan Coutts 2008 |
---|---|
License | BSD3 |
Maintainer | cabal-devel@haskell.org |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Distribution.ModuleName
Contents
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 Source #
A valid Haskell module name.
Constructors
ModuleName ShortTextLst |
Instances
Eq ModuleName Source # | |
Data ModuleName Source # | |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ModuleName -> c ModuleName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ModuleName # toConstr :: ModuleName -> Constr # dataTypeOf :: ModuleName -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c ModuleName) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ModuleName) # gmapT :: (forall b. Data b => b -> b) -> ModuleName -> ModuleName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ModuleName -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ModuleName -> r # gmapQ :: (forall d. Data d => d -> u) -> ModuleName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ModuleName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ModuleName -> m ModuleName # | |
Ord ModuleName Source # | |
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 Source # | |
Methods readsPrec :: Int -> ReadS ModuleName # readList :: ReadS [ModuleName] # readPrec :: ReadPrec ModuleName # readListPrec :: ReadPrec [ModuleName] # | |
Show ModuleName Source # | |
Methods showsPrec :: Int -> ModuleName -> ShowS # show :: ModuleName -> String # showList :: [ModuleName] -> ShowS # | |
IsString ModuleName Source # | Construct a 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 |
Methods fromString :: String -> ModuleName # | |
Generic ModuleName Source # | |
Associated Types type Rep ModuleName :: * -> * # | |
Binary ModuleName Source # | |
NFData ModuleName Source # | |
Methods rnf :: ModuleName -> () # | |
Text ModuleName Source # | |
ModSubst (Set ModuleName) Source # | |
Methods modSubst :: OpenModuleSubst -> Set ModuleName -> Set ModuleName Source # | |
type Rep ModuleName Source # | |
fromString :: IsString a => String -> a #
fromComponents :: [String] -> ModuleName Source #
Construct a ModuleName
from valid module components, i.e. parts
separated by dots.
components :: ModuleName -> [String] Source #
The individual components of a hierarchical module name. For example
components (fromString "A.B.C") = ["A", "B", "C"]
toFilePath :: ModuleName -> FilePath Source #
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 Source #
The module name Main
.
simple :: String -> ModuleName Source #
Deprecated: use ModuleName.fromString instead
Internal
validModuleComponent :: String -> Bool Source #