pathtype-0.7: Type-safe replacement for System.FilePath etc

Safe HaskellSafe



This module provides type-safe access to filepath manipulations.

Normally you would import Path (which will use the default implementation for the host platform) instead of this. However, importing this explicitly allows for manipulation of non-native paths.



type Path = Path Posix Source

type AbsPath fd = Path Abs fd Source

type RelPath fd = Path Rel fd Source

type FilePath ar = Path ar File Source

type DirPath ar = Path ar Dir Source

asPath :: (AbsRelClass ar, FileDirClass fd) => String -> Path ar fd Source

Deprecated: Use maybePath, parsePath or path instead.

asRelFile :: String -> RelFile Source

Deprecated: Use relFile instead.

asRelDir :: String -> RelDir Source

Deprecated: Use relDir instead.

asAbsFile :: String -> AbsFile Source

Deprecated: Use absFile instead.

asAbsDir :: String -> AbsDir Source

Deprecated: Use absDir instead.

asRelPath :: FileDirClass fd => String -> RelPath fd Source

Deprecated: Use relPath instead.

asAbsPath :: FileDirClass fd => String -> AbsPath fd Source

Deprecated: Use absPath instead.

asFilePath :: AbsRelClass ar => String -> FilePath ar Source

Deprecated: Use filePath instead.

asDirPath :: AbsRelClass ar => String -> DirPath ar Source

Deprecated: Use dirPath instead.

extSeparator :: Char Source

File extension character

> Posix.extSeparator == '.'

isExtSeparator :: Char -> Bool Source

Is the character an extension character?

> Posix.isExtSeparator a == (a == Posix.extSeparator)

searchPathSeparator :: Char Source

The character that is used to separate the entries in the $PATH environment variable.

isSearchPathSeparator :: Char -> Bool Source

Is the character a file separator?

> Posix.isSearchPathSeparator a == (a == Posix.searchPathSeparator)

addTrailingPathSeparator :: String -> String Source

Deprecated: Use System.FilePath.addTrailingPathSeparator instead.

This is largely for FilePath compatibility

dropTrailingPathSeparator :: String -> String Source

Deprecated: Use System.FilePath.dropTrailingPathSeparator instead.

This is largely for FilePath compatibility

hasTrailingPathSeparator :: String -> Bool Source

Deprecated: Use System.FilePath.hasTrailingPathSeparator instead.

This is largely for FilePath compatibility

testAll :: [(String, IO ())] Source