It seems to me that FilePath being a type alias for String is less useful than a newType. Was this a deliberate decision, or am I missing something? Maybe not suitable for FFI? Too late to change it now, of course.
I don’t know for sure, but I suspect it’s one of:
- It’s just really old, and was originally written before newtypes for stuff like this were more common.
- Adding a newtype makes you ask what kind of instances should be available. For example, it’s arguable you’d want to support
Monoid
as concatenation of paths is super common. However, paths have more complex concatenation semantics thanString
, and something likeNode.Path.concat
is not portable. Path of least resistance (yuk yuk) may be to just avoid it.