Go to file
2016-04-17 18:09:50 +02:00
3rdparty Use latest posix-paths 2016-04-16 19:12:23 +02:00
src Add withAbsPath/withRelPath/withFnPath 2016-04-17 18:09:50 +02:00
.ghci Basic Path type with parsers and test suite 2015-05-08 13:14:54 +02:00
.gitignore Fork chrisdone's path library 2016-03-08 22:53:42 +01:00
.gitmodules Use latest posix-paths 2016-04-16 19:12:23 +02:00
CHANGELOG Fork chrisdone's path library 2016-03-08 22:53:42 +01:00
doctests.hs Clean up, rewrite stuff 2016-04-16 18:17:44 +02:00
hpath.cabal Clean up, rewrite stuff 2016-04-16 18:17:44 +02:00
LICENSE Fork chrisdone's path library 2016-03-08 22:53:42 +01:00
README.md Clean up, rewrite stuff 2016-04-16 18:17:44 +02:00
Setup.hs First commit 2015-05-07 20:15:42 +02:00

HPath

Support for well-typed paths in Haskell.

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.

Differences to 'path'

  • doesn't attempt to fake IO-related types into the path, so whether a path points to a file or directory is up to your IO-code to decide... this should be a library that is used with a proper IO File Type
  • 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
  • introduces a new Path Fn for safe filename guarantees and a RelC class
  • 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
  • remove TH, it sucks