The conditionally set PLATFORM_PATH_FORMAT is exposed in a fairly poor way to the user making it easy to run into builds that are ironically platform dependent.
If you unknowingly use a function that returns PLATFORM_PATH_FORMAT such as encode :: FilePath -> PLATFORM_PATH_FORMAT, rather than encodeString or fromText, when you compile the same code on a different platform you invariably end up with a broken build, due to an error like: Couldn't match expected type ByteString with Text (or vice versa).
Perhaps hiding the PLATFORM_PATH_FORMAT from the user entirely, or make use of some other abstraction which is independent of the compilation platform.
The conditionally set
PLATFORM_PATH_FORMATis exposed in a fairly poor way to the user making it easy to run into builds that are ironically platform dependent.If you unknowingly use a function that returns
PLATFORM_PATH_FORMATsuch asencode :: FilePath -> PLATFORM_PATH_FORMAT, rather thanencodeStringorfromText, when you compile the same code on a different platform you invariably end up with a broken build, due to an error like: Couldn't match expected typeByteStringwithText(or vice versa).Perhaps hiding the
PLATFORM_PATH_FORMATfrom the user entirely, or make use of some other abstraction which is independent of the compilation platform.