Skip to content

Make System.OsString.Posix.fromBytes and Systen.OsString.Windows.encodeFS total #6

@Bodigrim

Description

@Bodigrim

Currently we have symmetric types:

System.OsString.Posix.fromBytes :: MonadThrow m => ByteString -> m PosixString
System.OsString.Windows.fromBytes :: MonadThrow m => ByteString -> m WindowsString

System.OsString.Posix.encodeFS :: String -> IO PosixString
System.OsString.Windows.encodeFS :: String -> IO WindowsString

It's not uncommon to work on a single-platform application or an area, which utilises only one flavour of OsString on both platforms. Recent work on tar is a prominent example, where PosixString is used as an internal representation even on Windows.

IMO it would be better to break the symmetry and provide

System.OsString.Posix.fromBytes :: ByteString -> PosixString
System.OsString.Windows.encodeFS :: String -> WindowsString

The lack of total conversions is the biggest friction point in my experience so far; if we can alleviate it at least in some scenarios, it's worth doing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions