Convert a relative path to an absolute path

Viewed 127

Lets say I have an application which stores absolute paths. In order to save users from having to type out absolute paths for everything, the application should convert relative paths to absolute paths before storing them. The problem is I have no idea how to do that in Haskell.

I am aware of the path and filepath libraries, however I cannot find any functionality in either of them which provides this (path provides strict typing for absolute and relative paths but no way to convert between them, as far as I can see).

Is there an existing library to do this? Or at least a reliable (and preferably simple) way to do this with existing libraries?

1 Answers

The directory library has a function called makeAbsolute which does exactly what I wanted.

Related