Community
Modules 11

System.OsString.Internal.Types

4 generation diagnostics
  • No documentation declaration for System.OsString.Internal.Types.unWS
  • No documentation declaration for System.OsString.Internal.Types.unPS
  • No documentation declaration for System.OsString.Internal.Types.unWW
  • No documentation declaration for System.OsString.Internal.Types.unPW

WS :: BS.ShortByteString -> WindowsString

Just a short bidirectional synonym for WindowsString constructor.

newtype PosixString

Commonly used Posix string as uninterpreted char[] array.

PS :: BS.ShortByteString -> PosixString

Just a short bidirectional synonym for PosixString constructor.

newtype WindowsChar

This represents a "wide char" on windows.

A better name would maybe have been WindowsWord, since this is just Word16 in a UCS-2 sequence.

WW :: Word16 -> WindowsChar

Just a short bidirectional synonym for WindowsChar constructor.

newtype PosixChar

This represents a byte.

A better name would maybe have been PosixWord, since it is just Word8 in an encoded byte sequence.

PW :: Word8 -> PosixChar

Just a short bidirectional synonym for PosixChar constructor.

newtype OsString

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.

newtype OsChar

Newtype representing a code unit.

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

This should maybe have been worded OsWord, since it is not a unicode code point by any means. It represents a byte in a

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.

Instances

48
  • instance Eq WindowsString
  • instance Ord WindowsString
  • instance Semigroup WindowsString
  • instance Monoid WindowsString
  • instance Typeable WindowsString
  • instance Generic WindowsString
  • instance NFData WindowsString
  • instance Lift WindowsString
  • instance Show WindowsString

    Decodes as UCS-2.

  • instance Eq PosixString
  • instance Ord PosixString
  • instance Semigroup PosixString
  • instance Monoid PosixString
  • instance Typeable PosixString
  • instance Generic PosixString
  • instance NFData PosixString
  • instance Lift PosixString
  • instance Show PosixString

    Prints the raw bytes without decoding.

  • instance Eq WindowsChar
  • instance Ord WindowsChar
  • instance Typeable WindowsChar
  • instance Generic WindowsChar
  • instance NFData WindowsChar
  • instance Lift WindowsChar
  • instance Show WindowsChar
  • instance Eq PosixChar
  • instance Ord PosixChar
  • instance Typeable PosixChar
  • instance Generic PosixChar
  • instance NFData PosixChar
  • instance Lift PosixChar
  • instance Show PosixChar
  • instance Typeable OsString
  • instance Generic OsString
  • instance NFData OsString
  • instance Lift OsString
  • instance Show OsString

    On windows, decodes as UCS-2. On unix prints the raw bytes without decoding.

  • instance Eq OsString

    Byte equality of the internal representation.

  • instance Ord OsString

    Byte ordering of the internal representation.

  • instance Monoid OsString

    "String-Concatenation" for OsString. This is not the same as </>.

  • instance Semigroup OsString
  • instance Typeable OsChar
  • instance Generic OsChar
  • instance NFData OsChar
  • instance Lift OsChar
  • instance Show OsChar
  • instance Eq OsChar

    Byte equality of the internal representation.

  • instance Ord OsChar

    Byte ordering of the internal representation.

Build record and source files

Community contribution. The service has not verified this documentation. The generator reported 4 diagnostics.

Target: Linux on x86-64. Some inferred types and resolved links are not available.

Generator: aihc-haddock-858b1951-web-1

Metadata snapshot: 467adfa4e90b59b0072712e32d97437632176e89f16e62151dd53a2e41646abb

Open the dependency plan · Download the documentation model

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.