From 607e67378c1d54e170459d82077d09c4168dafe4 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 20 Jan 2020 19:46:10 +0100 Subject: [PATCH] Improve documentation --- hpath/src/HPath.hs | 2 +- hpath/src/HPath/Internal.hs | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/hpath/src/HPath.hs b/hpath/src/HPath.hs index d68be84..25db614 100644 --- a/hpath/src/HPath.hs +++ b/hpath/src/HPath.hs @@ -31,7 +31,7 @@ module HPath -- * PatternSynonyms/ViewPatterns ,pattern Path #endif - -- * Path Parsing + -- * Path Construction ,parseAbs ,parseRel ,parseAny diff --git a/hpath/src/HPath/Internal.hs b/hpath/src/HPath/Internal.hs index efa2878..1e3d730 100644 --- a/hpath/src/HPath/Internal.hs +++ b/hpath/src/HPath/Internal.hs @@ -10,15 +10,19 @@ import Control.DeepSeq (NFData (..)) import Data.ByteString (ByteString) import Data.Data --- | Path of some base and type. +-- | The main Path type. -- --- Internally is a ByteString. The ByteString can be of two formats only: +-- The type variable 'b' is either: -- --- 1. without trailing path separator: @file.txt@, @foo\/bar.txt@, @\/foo\/bar.txt@ --- 2. with trailing path separator: @foo\/@, @\/foo\/bar\/@ +-- * Abs -- absolute path +-- * Rel -- relative path -- --- There are no duplicate --- path separators @\/\/@, no @..@, no @.\/@, no @~\/@, etc. +-- Internally is a ByteString. The path is guaranteed to +-- be normalised and contain no trailing Path separators, +-- except for the '/' root path. +-- +-- There are no duplicate path separators +-- @\/\/@, no @..@, no @.\/@, no @~\/@, etc. data Path b = MkPath ByteString deriving (Typeable)