Safe Haskell | None |
---|---|
Language | Haskell2010 |
System.OsString.Internal.Types
Synopsis
- newtype WindowsString = WindowsString {}
- pattern WS :: ShortByteString -> WindowsString
- unWS :: WindowsString -> ShortByteString
- newtype PosixString = PosixString {}
- unPS :: PosixString -> ShortByteString
- pattern PS :: ShortByteString -> PosixString
- type PlatformString = PosixString
- newtype WindowsChar = WindowsChar {}
- unWW :: WindowsChar -> Word16
- pattern WW :: Word16 -> WindowsChar
- newtype PosixChar = PosixChar {}
- unPW :: PosixChar -> Word8
- pattern PW :: Word8 -> PosixChar
- type PlatformChar = PosixChar
- newtype OsString = OsString {}
- newtype OsChar = OsChar {}
- coercionToPlatformTypes :: Either (Coercion OsChar WindowsChar, Coercion OsString WindowsString) (Coercion OsChar PosixChar, Coercion OsString PosixString)
Documentation
newtype WindowsString #
Commonly used windows string as wide character bytes.
Constructors
WindowsString | |
Fields |
Instances
pattern WS :: ShortByteString -> WindowsString #
Just a short bidirectional synonym for WindowsString
constructor.
unWS :: WindowsString -> ShortByteString #
newtype PosixString #
Commonly used Posix string as uninterpreted char[]
array.
Constructors
PosixString | |
Fields |
Instances
Monoid PosixString # | |||||
Defined in System.OsString.Internal.Types Methods mempty :: PosixString # mappend :: PosixString -> PosixString -> PosixString # mconcat :: [PosixString] -> PosixString # | |||||
Semigroup PosixString # | |||||
Defined in System.OsString.Internal.Types Methods (<>) :: PosixString -> PosixString -> PosixString # sconcat :: NonEmpty PosixString -> PosixString # stimes :: Integral b => b -> PosixString -> PosixString # | |||||
Generic PosixString # | |||||
Defined in System.OsString.Internal.Types Associated Types
| |||||
Show PosixString # | Prints the raw bytes without decoding. | ||||
Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> PosixString -> ShowS # show :: PosixString -> String # showList :: [PosixString] -> ShowS # | |||||
NFData PosixString # | |||||
Defined in System.OsString.Internal.Types Methods rnf :: PosixString -> () # | |||||
Eq PosixString # | |||||
Defined in System.OsString.Internal.Types | |||||
Ord PosixString # | |||||
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 # | |||||
Defined in System.OsString.Internal.Types Methods lift :: Quote m => PosixString -> m Exp # liftTyped :: forall (m :: Type -> Type). Quote m => PosixString -> Code m PosixString # | |||||
type Rep PosixString # | |||||
Defined in System.OsString.Internal.Types type Rep PosixString = D1 ('MetaData "PosixString" "System.OsString.Internal.Types" "os-string-2.0.2.1-Hjy1RWYob6R165kcPeCUb" 'True) (C1 ('MetaCons "PosixString" 'PrefixI 'True) (S1 ('MetaSel ('Just "getPosixString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ShortByteString))) |
unPS :: PosixString -> ShortByteString #
pattern PS :: ShortByteString -> PosixString #
Just a short bidirectional synonym for PosixString
constructor.
type PlatformString = PosixString #
newtype WindowsChar #
Constructors
WindowsChar | |
Fields |
Instances
Generic WindowsChar # | |||||
Defined in System.OsString.Internal.Types Associated Types
| |||||
Show WindowsChar # | |||||
Defined in System.OsString.Internal.Types Methods showsPrec :: Int -> WindowsChar -> ShowS # show :: WindowsChar -> String # showList :: [WindowsChar] -> ShowS # | |||||
NFData WindowsChar # | |||||
Defined in System.OsString.Internal.Types Methods rnf :: WindowsChar -> () # | |||||
Eq WindowsChar # | |||||
Defined in System.OsString.Internal.Types | |||||
Ord WindowsChar # | |||||
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 # | |||||
Defined in System.OsString.Internal.Types type Rep WindowsChar = D1 ('MetaData "WindowsChar" "System.OsString.Internal.Types" "os-string-2.0.2.1-Hjy1RWYob6R165kcPeCUb" 'True) (C1 ('MetaCons "WindowsChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "getWindowsChar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16))) |
unWW :: WindowsChar -> Word16 #
pattern WW :: Word16 -> WindowsChar #
Just a short bidirectional synonym for WindowsChar
constructor.
Constructors
PosixChar | |
Fields |
Instances
Generic PosixChar # | |||||
Defined in System.OsString.Internal.Types Associated Types
| |||||
Show PosixChar # | |||||
NFData PosixChar # | |||||
Defined in System.OsString.Internal.Types | |||||
Eq PosixChar # | |||||
Ord PosixChar # | |||||
type Rep PosixChar # | |||||
Defined in System.OsString.Internal.Types |
type PlatformChar = PosixChar #
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.
Constructors
OsString | |
Fields |
Instances
Monoid OsString # | "String-Concatenation" for | ||||
Semigroup OsString # | |||||
Generic OsString # | |||||
Defined in System.OsString.Internal.Types Associated Types
| |||||
Show OsString # | On windows, decodes as UCS-2. On unix prints the raw bytes without decoding. | ||||
NFData OsString # | |||||
Defined in System.OsString.Internal.Types | |||||
Eq OsString # | Byte equality of the internal representation. | ||||
Ord OsString # | Byte ordering of the internal representation. | ||||
Defined in System.OsString.Internal.Types | |||||
Lift OsString # | |||||
type Rep OsString # | |||||
Defined in System.OsString.Internal.Types type Rep OsString = D1 ('MetaData "OsString" "System.OsString.Internal.Types" "os-string-2.0.2.1-Hjy1RWYob6R165kcPeCUb" 'True) (C1 ('MetaCons "OsString" 'PrefixI 'True) (S1 ('MetaSel ('Just "getOsString") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PlatformString))) |
Newtype representing a code unit.
On Windows, this is restricted to two-octet codepoints Word16
,
on POSIX one-octet (Word8
).
Constructors
OsChar | |
Fields |
Instances
Generic OsChar # | |||||
Defined in System.OsString.Internal.Types Associated Types
| |||||
Show OsChar # | |||||
NFData OsChar # | |||||
Defined in System.OsString.Internal.Types | |||||
Eq OsChar # | Byte equality of the internal representation. | ||||
Ord OsChar # | Byte ordering of the internal representation. | ||||
type Rep OsChar # | |||||
Defined in System.OsString.Internal.Types type Rep OsChar = D1 ('MetaData "OsChar" "System.OsString.Internal.Types" "os-string-2.0.2.1-Hjy1RWYob6R165kcPeCUb" 'True) (C1 ('MetaCons "OsChar" 'PrefixI 'True) (S1 ('MetaSel ('Just "getOsChar") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PlatformChar))) |
coercionToPlatformTypes :: Either (Coercion OsChar WindowsChar, Coercion OsString WindowsString) (Coercion OsChar PosixChar, Coercion OsString PosixString) #
This is a type-level evidence that OsChar
is a newtype wrapper
over WindowsChar
or PosixChar
and OsString
is a newtype wrapper
over WindowsString
or PosixString
. If you pattern match on
coercionToPlatformTypes
, GHC will know that relevant types
are coercible to each other. This helps to avoid CPP in certain scenarios.