It is no secret that imports are one of the most confusing things about FP libraries and there has been a lot of work to simplify this. However, I'm still finding that it's easy to get confused between relative and absolute paths. How many cats, fs2, implicits or io packages are there now? All the interop imports just make it worse and worse.
We can help ourselves by ensuring we use root-based imports, but it's painfully ugly!
It is no secret that imports are one of the most confusing things about FP libraries and there has been a lot of work to simplify this. However, I'm still finding that it's easy to get confused between relative and absolute paths. How many
cats
,fs2
,implicits
orio
packages are there now? All the interop imports just make it worse and worse.We can help ourselves by ensuring we use root-based imports, but it's painfully ugly!
It'd be nice if we cleaned it up a little bit with a symbol alias for
_root_
. e.g.|
or.
or/
(pick one)and at the same time, ban the creation of packages named
_root_
so that it doesn't end up becoming a relative name!This could even be done in
parser
(taking care withPosition
), just naively rewritingimport[\w]+[|/.]
toimport _root_.