hpath/hpath
Julian Ospald 3abc68cdd6
Remove RelC and Fn wrt #29
'Path Fn </> Path Fn' leads to incorrect semantics.
The only fix is introducing complicated type family
machinery, which isn't justified.
2020-01-20 19:51:00 +01:00
..
src Remove RelC and Fn wrt #29 2020-01-20 19:51:00 +01:00
CHANGELOG Bump versions 2020-01-18 18:59:21 +01:00
LICENSE Split packages into hpath{,-io,-filepath} 2020-01-04 17:55:14 +01:00
README.md Remove RelC and Fn wrt #29 2020-01-20 19:51:00 +01:00
Setup.hs Split packages into hpath{,-io,-filepath} 2020-01-04 17:55:14 +01:00
hpath.cabal Bump versions 2020-01-18 18:59:21 +01:00
run-doctests.sh Fix run-doctests working dir 2020-01-16 02:05:34 +01:00

README.md

HPath

Gitter chat Hackage version Build Status Hackage-Deps

Support for well-typed paths in Haskell.

This package is part of the HPath suite, also check out hpath-filepath and hpath-io.

Motivation

The motivation came during development of hsfm which has a pretty strict File type, but lacks a strict Path type, e.g. for user input.

The library that came closest to my needs was path, but the API turned out to be oddly complicated for my use case, so I decided to fork it.

Goals

  • well-typed paths
  • safe filepath manipulation, never using String as filepath, but ByteString

Note: this library was written for posix systems and it will probably not support other systems.

Differences to 'path'

  • doesn't attempt to fake IO-related information into the path, so whether a path points to a file or directory is up to your IO-code to decide...
  • trailing path separators will be preserved if they exist, no messing with that
  • uses safe ByteString for filepaths under the hood instead of unsafe String
  • fixes broken dirname
  • renames dirname/filename to basename/dirname to match the POSIX shell functions
  • allows pattern matching via unidirectional PatternSynonym
  • uses simple doctest for testing
  • allows ~/ as relative path, because on posix level ~ is just a regular filename that does NOT point to $HOME