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.
Currently we have symmetric types:
It's not uncommon to work on a single-platform application or an area, which utilises only one flavour of
OsStringon both platforms. Recent work ontaris a prominent example, wherePosixStringis used as an internal representation even on Windows.IMO it would be better to break the symmetry and provide
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.