filepath-1.4.100.4: Library for manipulating FilePaths in a cross platform way.

Safe Haskell | Safe-Inferred
Language | Haskell2010

System.OsPath.Types

Contents

- FilePath types
- OsString reexports

Synopsis

- type OsPath = OsString
- type WindowsPath = WindowsString
- type PosixPath = PosixString
- type PlatformPath = PosixPath
- data WindowsString
- data PosixString
- data WindowsChar
- data PosixChar
- data OsString
- data OsChar

# FilePath types

type OsPath = OsString Source #

Type representing filenames/pathnames.

This type doesn't add any guarantees over `OsString`.

type WindowsPath = WindowsString Source #

Filepaths are `wchar_t*` data on windows as passed to syscalls.

type PosixPath = PosixString Source #

Filepaths are `char[]` data on unix as passed to syscalls.

type PlatformPath = PosixPath Source #

Ifdef around current platform (either `WindowsPath` or `PosixPath`).

# OsString reexports

data WindowsString Source #

Commonly used windows string as wide character bytes.

#### Instances

Instances details

Monoid WindowsString Source # |
Instance details Defined in System.OsString.Internal.Types Methods mempty :: WindowsString Source # mappend :: WindowsString -> WindowsString -> WindowsString Source # mconcat :: [WindowsString] -> WindowsString Source #
Semigroup WindowsString Source # |
Instance details Defined in System.OsString.Internal.Types Methods (<>) :: WindowsString -> WindowsString -> WindowsString Source # sconcat :: NonEmpty WindowsString -> WindowsString Source # stimes :: Integral b => b -> WindowsString -> WindowsString Source #
Generic WindowsString Source # |
Instance details Defined in System.OsString.Internal.Types Associated Types type Rep WindowsString :: Type -> Type Source # Methods from :: WindowsString -> Rep WindowsString x Source # to :: Rep WindowsString x -> WindowsString Source #
Show WindowsString Source # | Decodes as UCS-2.
Instance details Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> WindowsString -> ShowS Source # show :: WindowsString -> String Source # showList :: [WindowsString] -> ShowS Source #
NFData WindowsString Source # |
Instance details Defined in System.OsString.Internal.Types Methods rnf :: WindowsString -> () Source #
Eq WindowsString Source # |
Instance details Defined in System.OsString.Internal.Types Methods (==) :: WindowsString -> WindowsString -> Bool # (/=) :: WindowsString -> WindowsString -> Bool #
Ord WindowsString Source # |

Instance details

Defined in System.OsString.Internal.Types

Methods

compare :: WindowsString -> WindowsString -> Ordering #

(<) :: WindowsString -> WindowsString -> Bool #

(<=) :: WindowsString -> WindowsString -> Bool #

(>) :: WindowsString -> WindowsString -> Bool #

(>=) :: WindowsString -> WindowsString -> Bool #

max :: WindowsString -> WindowsString -> WindowsString #

min :: WindowsString -> WindowsString -> WindowsString #

Lift WindowsString Source # |
Instance details Defined in System.OsString.Internal.Types Methods lift :: Quote m => WindowsString -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => WindowsString -> Code m WindowsString Source #
type Rep WindowsString Source # |
Instance details Defined in System.OsString.Internal.Types type Rep WindowsString = D1 ('MetaData "WindowsString" "System.OsString.Internal.Types" "filepath-1.4.100.4" 'True) (C1 ('MetaCons "WindowsString" 'PrefixI 'True) (S1 ('MetaSel ('Just "getWindowsString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))

data PosixString Source #

Commonly used Posix string as uninterpreted `char[]` array.

#### Instances

Instances details

Monoid PosixString Source # |
Instance details Defined in System.OsString.Internal.Types Methods mempty :: PosixString Source # mappend :: PosixString -> PosixString -> PosixString Source # mconcat :: [PosixString] -> PosixString Source #
Semigroup PosixString Source # |
Instance details Defined in System.OsString.Internal.Types Methods (<>) :: PosixString -> PosixString -> PosixString Source # sconcat :: NonEmpty PosixString -> PosixString Source # stimes :: Integral b => b -> PosixString -> PosixString Source #
Generic PosixString Source # |
Instance details Defined in System.OsString.Internal.Types Associated Types type Rep PosixString :: Type -> Type Source # Methods from :: PosixString -> Rep PosixString x Source # to :: Rep PosixString x -> PosixString Source #
Show PosixString Source # | Prints the raw bytes without decoding.
Instance details Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> PosixString -> ShowS Source # show :: PosixString -> String Source # showList :: [PosixString] -> ShowS Source #
NFData PosixString Source # |
Instance details Defined in System.OsString.Internal.Types Methods rnf :: PosixString -> () Source #
Eq PosixString Source # |
Instance details Defined in System.OsString.Internal.Types Methods (==) :: PosixString -> PosixString -> Bool # (/=) :: PosixString -> PosixString -> Bool #
Ord PosixString Source # |
Instance details Defined in System.OsString.Internal.Types Methods compare :: PosixString -> PosixString -> Ordering # (<) :: PosixString -> PosixString -> Bool # (<=) :: PosixString -> PosixString -> Bool # (>) :: PosixString -> PosixString -> Bool # (>=) :: PosixString -> PosixString -> Bool # max :: PosixString -> PosixString -> PosixString # min :: PosixString -> PosixString -> PosixString #
Lift PosixString Source # |
Instance details Defined in System.OsString.Internal.Types Methods lift :: Quote m => PosixString -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => PosixString -> Code m PosixString Source #
type Rep PosixString Source # |
Instance details Defined in System.OsString.Internal.Types type Rep PosixString = D1 ('MetaData "PosixString" "System.OsString.Internal.Types" "filepath-1.4.100.4" 'True) (C1 ('MetaCons "PosixString" 'PrefixI 'True) (S1 ('MetaSel ('Just "getPosixString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString)))

data WindowsChar Source #

#### Instances

Instances details

Generic WindowsChar Source # |
Instance details Defined in System.OsString.Internal.Types Associated Types type Rep WindowsChar :: Type -> Type Source # Methods from :: WindowsChar -> Rep WindowsChar x Source # to :: Rep WindowsChar x -> WindowsChar Source #
Show WindowsChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> WindowsChar -> ShowS Source # show :: WindowsChar -> String Source # showList :: [WindowsChar] -> ShowS Source #
NFData WindowsChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods rnf :: WindowsChar -> () Source #
Eq WindowsChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods (==) :: WindowsChar -> WindowsChar -> Bool # (/=) :: WindowsChar -> WindowsChar -> Bool #
Ord WindowsChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods compare :: WindowsChar -> WindowsChar -> Ordering # (<) :: WindowsChar -> WindowsChar -> Bool # (<=) :: WindowsChar -> WindowsChar -> Bool # (>) :: WindowsChar -> WindowsChar -> Bool # (>=) :: WindowsChar -> WindowsChar -> Bool # max :: WindowsChar -> WindowsChar -> WindowsChar # min :: WindowsChar -> WindowsChar -> WindowsChar #
type Rep WindowsChar Source # |
Instance details Defined in System.OsString.Internal.Types type Rep WindowsChar = D1 ('MetaData "WindowsChar" "System.OsString.Internal.Types" "filepath-1.4.100.4" 'True) (C1 ('MetaCons "WindowsChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "getWindowsChar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16)))

data PosixChar Source #

#### Instances

Instances details

Generic PosixChar Source # |
Instance details Defined in System.OsString.Internal.Types Associated Types type Rep PosixChar :: Type -> Type Source # Methods from :: PosixChar -> Rep PosixChar x Source # to :: Rep PosixChar x -> PosixChar Source #
Show PosixChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> PosixChar -> ShowS Source # show :: PosixChar -> String Source # showList :: [PosixChar] -> ShowS Source #
NFData PosixChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods rnf :: PosixChar -> () Source #
Eq PosixChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods (==) :: PosixChar -> PosixChar -> Bool # (/=) :: PosixChar -> PosixChar -> Bool #
Ord PosixChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods compare :: PosixChar -> PosixChar -> Ordering # (<) :: PosixChar -> PosixChar -> Bool # (<=) :: PosixChar -> PosixChar -> Bool # (>) :: PosixChar -> PosixChar -> Bool # (>=) :: PosixChar -> PosixChar -> Bool # max :: PosixChar -> PosixChar -> PosixChar # min :: PosixChar -> PosixChar -> PosixChar #
type Rep PosixChar Source # |
Instance details Defined in System.OsString.Internal.Types type Rep PosixChar = D1 ('MetaData "PosixChar" "System.OsString.Internal.Types" "filepath-1.4.100.4" 'True) (C1 ('MetaCons "PosixChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "getPosixChar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8)))

data OsString Source #

Newtype representing short operating system specific strings.

Internally this is either `WindowsString` or `PosixString`, depending on the platform. Both use unpinned `ShortByteString` for efficiency.

The constructor is only exported via System.OsString.Internal.Types, since dealing with the internals isn't generally recommended, but supported in case you need to write platform specific code.

#### Instances

Instances details

Monoid OsString Source # | "String-Concatenation" for `OsString`. This is not the same as `(</>)`.
Instance details Defined in System.OsString.Internal.Types Methods mempty :: OsString Source # mappend :: OsString -> OsString -> OsString Source # mconcat :: [OsString] -> OsString Source #
Semigroup OsString Source # |
Instance details Defined in System.OsString.Internal.Types Methods (<>) :: OsString -> OsString -> OsString Source # sconcat :: NonEmpty OsString -> OsString Source # stimes :: Integral b => b -> OsString -> OsString Source #
Generic OsString Source # |
Instance details Defined in System.OsString.Internal.Types Associated Types type Rep OsString :: Type -> Type Source # Methods from :: OsString -> Rep OsString x Source # to :: Rep OsString x -> OsString Source #
Show OsString Source # | On windows, decodes as UCS-2. On unix prints the raw bytes without decoding.
Instance details Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> OsString -> ShowS Source # show :: OsString -> String Source # showList :: [OsString] -> ShowS Source #
NFData OsString Source # |
Instance details Defined in System.OsString.Internal.Types Methods rnf :: OsString -> () Source #
Eq OsString Source # | Byte equality of the internal representation.
Instance details Defined in System.OsString.Internal.Types Methods (==) :: OsString -> OsString -> Bool # (/=) :: OsString -> OsString -> Bool #
Ord OsString Source # | Byte ordering of the internal representation.
Instance details Defined in System.OsString.Internal.Types Methods compare :: OsString -> OsString -> Ordering # (<) :: OsString -> OsString -> Bool # (<=) :: OsString -> OsString -> Bool # (>) :: OsString -> OsString -> Bool # (>=) :: OsString -> OsString -> Bool # max :: OsString -> OsString -> OsString # min :: OsString -> OsString -> OsString #
Lift OsString Source # |
Instance details Defined in System.OsString.Internal.Types Methods lift :: Quote m => OsString -> m Exp Source # liftTyped :: forall (m :: Type -> Type). Quote m => OsString -> Code m OsString Source #
type Rep OsString Source # |
Instance details Defined in System.OsString.Internal.Types type Rep OsString = D1 ('MetaData "OsString" "System.OsString.Internal.Types" "filepath-1.4.100.4" 'True) (C1 ('MetaCons "OsString" 'PrefixI 'True) (S1 ('MetaSel ('Just "getOsString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PlatformString)))

data OsChar Source #

Newtype representing a code unit.

On Windows, this is restricted to two-octet codepoints `Word16`, on POSIX one-octet (`Word8`).

#### Instances

Instances details

Generic OsChar Source # |
Instance details Defined in System.OsString.Internal.Types Associated Types type Rep OsChar :: Type -> Type Source # Methods from :: OsChar -> Rep OsChar x Source # to :: Rep OsChar x -> OsChar Source #
Show OsChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> OsChar -> ShowS Source # show :: OsChar -> String Source # showList :: [OsChar] -> ShowS Source #
NFData OsChar Source # |
Instance details Defined in System.OsString.Internal.Types Methods rnf :: OsChar -> () Source #
Eq OsChar Source # | Byte equality of the internal representation.
Instance details Defined in System.OsString.Internal.Types Methods (==) :: OsChar -> OsChar -> Bool # (/=) :: OsChar -> OsChar -> Bool #
Ord OsChar Source # | Byte ordering of the internal representation.
Instance details Defined in System.OsString.Internal.Types Methods compare :: OsChar -> OsChar -> Ordering # (<) :: OsChar -> OsChar -> Bool # (<=) :: OsChar -> OsChar -> Bool # (>) :: OsChar -> OsChar -> Bool # (>=) :: OsChar -> OsChar -> Bool # max :: OsChar -> OsChar -> OsChar # min :: OsChar -> OsChar -> OsChar #
type Rep OsChar Source # |
Instance details Defined in System.OsString.Internal.Types type Rep OsChar = D1 ('MetaData "OsChar" "System.OsString.Internal.Types" "filepath-1.4.100.4" 'True) (C1 ('MetaCons "OsChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "getOsChar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PlatformChar)))