Hi, thanks for this great library! I was just starting to write my own solution when I realized this exists.
One thing I noticed is that when I want to specify the type of Path in my code, I have following options:
import Path and then myPath :: Path Rel File.
import qualified Path as P and then myPath :: P.Path P.Rel P.File
import Path (Path, Rel, Abs, File, Dir) and then myPath :: Path Rel File
and so on.
Problem with having Path, Rel, Abs, File, Dir directly as names in the scope for me is that these are really short names and might likely come in conflict with some of my own datatypes (in my case, I had data type File). On the other hand, having them qualified and then prefixing them all with P. or smth similar doesn't look nice.
What I did is define module Path.Aliases which has
type RelFile = Path Rel File
type AbsFile = Path Abs File
type RelDir = Path Rel Dir
type AbsDir = Path Abs Dir
and now if I import it as import qualified Path.Aliases as Path I can do :: Path.RelFile and similar.
Would it make sense to offer smth like this as part of the Path package?
I am aware there is a high change you already thought about this, but I could not phantom a reason against it (I am somewhat new to Haskell though), so I thought I should ask.
Closing this -> as codebase evolved, I actually found that rarely there is a conflict with other types, so I don't think any more that this brings a lot of value.
Hi, thanks for this great library! I was just starting to write my own solution when I realized this exists.
One thing I noticed is that when I want to specify the type of Path in my code, I have following options:
import Path
and thenmyPath :: Path Rel File
.import qualified Path as P
and thenmyPath :: P.Path P.Rel P.File
import Path (Path, Rel, Abs, File, Dir)
and thenmyPath :: Path Rel File
and so on.Problem with having Path, Rel, Abs, File, Dir directly as names in the scope for me is that these are really short names and might likely come in conflict with some of my own datatypes (in my case, I had data type File). On the other hand, having them qualified and then prefixing them all with
P.
or smth similar doesn't look nice.What I did is define module Path.Aliases which has
and now if I import it as
import qualified Path.Aliases as Path
I can do:: Path.RelFile
and similar.Would it make sense to offer smth like this as part of the Path package? I am aware there is a high change you already thought about this, but I could not phantom a reason against it (I am somewhat new to Haskell though), so I thought I should ask.