scala-pathy icon indicating copy to clipboard operation
scala-pathy copied to clipboard

Path for URI

Open MasseGuillaume opened this issue 10 years ago • 2 comments

I want to use pathy for the path part in the URI. currently I only have access to

def currentDir[S]: Path[Rel, Dir, S] = Current
def rootDir[S]: Path[Abs, Dir, S] = Root

something like:

def current[T, S]: Path[Rel, T, S] = Current
def root[T, S]: Path[Abs, T, S] = Root

would be useful.

MasseGuillaume avatar Sep 04 '15 14:09 MasseGuillaume

I don’t understand – Current and Root always need to be directories. What does the second version buy you?

sellout avatar Sep 04 '15 14:09 sellout

Uri has a notion of Path and it's not really bound to Directories or Files: https://tools.ietf.org/html/rfc3986#section-3.3

In http4s Path is not really well typed: https://github.com/http4s/http4s/blob/14d9f28babc5a4205132fd2e7fbab161125e3469/core/src/main/scala/org/http4s/Uri.scala#L141

MasseGuillaume avatar Sep 04 '15 14:09 MasseGuillaume