path-0.5.11: Support for well-typed paths

Safe Haskell | None
Language | Haskell98

Path.Internal

Description

Internal types and functions.

Synopsis

- newtype Path b t = Path FilePath

# Documentation

newtype Path b t #

Path of some base and type.

Internally is a string. The string can be of two formats only:

1. File format: `file.txt`, `foo/bar.txt`, `/foo/bar.txt`
2. Directory format: `foo/`, `/foo/bar/`

All directories end in a trailing separator. There are no duplicate path separators `//`, no `..`, no `./`, no `~/`, etc.

Constructors

Path FilePath |

Instances

Eq (Path b t) # | String equality. The following property holds:
    show x == show y ≡ x == y
Methods (==) :: Path b t -> Path b t -> Bool # (/=) :: Path b t -> Path b t -> Bool #
Ord (Path b t) # | String ordering. The following property holds:
    show x `compare` show y ≡ x `compare` y
Methods compare :: Path b t -> Path b t -> Ordering # (<) :: Path b t -> Path b t -> Bool # (<=) :: Path b t -> Path b t -> Bool # (>) :: Path b t -> Path b t -> Bool # (>=) :: Path b t -> Path b t -> Bool # max :: Path b t -> Path b t -> Path b t # min :: Path b t -> Path b t -> Path b t #
Show (Path b t) # | Same as `toFilePath`. The following property holds:
    x == y ≡ show x == show y
Methods showsPrec :: Int -> Path b t -> ShowS # show :: Path b t -> String # showList :: [Path b t] -> ShowS #
FromJSON (Path Rel Dir) # |
Methods parseJSON :: Value -> Parser (Path Rel Dir) # parseJSONList :: Value -> Parser [Path Rel Dir] #
FromJSON (Path Rel File) # |
Methods parseJSON :: Value -> Parser (Path Rel File) # parseJSONList :: Value -> Parser [Path Rel File] #
FromJSON (Path Abs Dir) # |
Methods parseJSON :: Value -> Parser (Path Abs Dir) # parseJSONList :: Value -> Parser [Path Abs Dir] #
FromJSON (Path Abs File) # |
Methods parseJSON :: Value -> Parser (Path Abs File) # parseJSONList :: Value -> Parser [Path Abs File] #
ToJSON (Path b t) # |
Methods toJSON :: Path b t -> Value # toEncoding :: Path b t -> Encoding # toJSONList :: [Path b t] -> Value # toEncodingList :: [Path b t] -> Encoding #
NFData (Path b t) # |
Methods rnf :: Path b t -> () #