Popularity
6.5
Declining
Activity
0.0
Stable
10
5
5

Monthly Downloads: 20
Programming language: Haskell
License: BSD 3-clause "New" or "Revised" License
Tags: Data    
Latest version: v2.1.1.0

data-filepath alternatives and similar packages

Based on the "Data" category.
Alternatively, view data-filepath alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of data-filepath or a related project?

Add another 'Data' Package

README

data-filepath

A type safe file path data structure.

File paths describe a path that can be:

  • to a file or a directory
  • either be from the root of a system or be relative to something else

We never want to mix up these types but we want to be able to compose values of these types.

The representation we use is a GADT parametric on

  • Path: what the path is pointing too (file or directory)
  • From: if the path is relative or absolute

The append function is defined as:

(</>) :: FilePath a Directory -> FilePath Relative b -> FilePath a b
p </> RelativePath = p
p </> (DirectoryPath u s) = DirectoryPath (p </> u) s
p </> (FilePath u s) = FilePath (p </> u) s

As such, you can only append to a Directory and you can only append relative paths.

The library also provides tools for working with values, such as safe to / from conversion functions and a quasi-quoter.