pathtype: Type-safe replacement for System.FilePath etc

[ bsd3, library, system ] [ Propose Tags ]

This module provides type-safe access to filepath manipulations.

It is designed to be imported instead of System.FilePath and System.Directory and is intended to provide versions of functions from those modules which have equivalent functionality but are more typesafe.

The heart of this module is the Path ar fd abstract type which represents file and directory paths. The idea is that there are two phantom type parameters - the first should be Abs or Rel, and the second File or Dir. A number of type synonyms are provided for common types:

type AbsFile    = Path Abs File
type RelFile    = Path Rel File
type AbsDir     = Path Abs Dir
type RelDir     = Path Rel Dir
type RelPath fd = Path Rel fd
type DirPath ar = Path ar Dir

The type of the combine (aka </>) function gives the idea:

(</>) :: DirPath ar -> RelPath fd -> Path ar fd

Together this enables us to give more meaningful types to a lot of the functions, and (hopefully) catch a bunch more errors at compile time.

The basic API (and properties satisfied) are heavily influenced by Neil Mitchell's System.FilePath module.

WARNING -- THE API IS NOT YET STABLE -- WARNING

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1, 0.0.2, 0.0.3, 0.5, 0.5.1, 0.5.2, 0.5.3, 0.5.4, 0.5.4.1, 0.5.4.2, 0.5.4.3, 0.5.5, 0.6, 0.7, 0.7.0.1, 0.8, 0.8.1, 0.8.1.1, 0.8.1.2, 0.8.1.3
Dependencies base (>=3 && <5), directory (>=1 && <2), QuickCheck (>=1.2 && <2) [details]
License BSD-3-Clause
Author Ben Moseley
Maintainer ben@moseley.name
Category System
Uploaded by BenMoseley at 2009-11-07T18:09:09Z
Distributions LTSHaskell:0.8.1.3, NixOS:0.8.1.3, Stackage:0.8.1.3
Reverse Dependencies 5 direct, 18 indirect [details]
Downloads 14475 total (43 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]