Skip to content

Commit bf881de

Browse files
Add doc and some doctests
1 parent ed2cc9f commit bf881de

File tree

1 file changed

+13
-1
lines changed
  • core/src/Streamly/Internal/FileSystem/Path

1 file changed

+13
-1
lines changed

core/src/Streamly/Internal/FileSystem/Path/Common.hs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,24 @@ append :: (Unbox a, Integral a) =>
485485
append os toStr a b =
486486
withAppendCheck os toStr b (doAppend os a b)
487487

488-
-- |
488+
-- | Split a path into components separated by the path separator. "."
489+
-- components in the path are ignored except in the leading position. Multiple
490+
-- consecutive separators are ignored.
491+
--
489492
-- >>> :{
490493
-- splitPath Common.Posix = Stream.toList . fmap unpackPosix . Common.splitPath Common.Posix . packPosix
491494
-- splitPath Common.Windows = Stream.toList . fmap unpackWindows . Common.splitPath Common.Windows . packWindows
492495
-- :}
493496
--
497+
-- >>> splitPath Common.Posix "."
498+
-- ["."]
499+
--
500+
-- >>> splitPath Common.Posix "././"
501+
-- ["."]
502+
--
503+
-- >>> splitPath Common.Posix "./a/b/."
504+
-- [".","a","b"]
505+
--
494506
-- >>> splitPath Common.Posix "home//user/./..////\\directory/."
495507
-- ["home","user","..","\\directory"]
496508
--

0 commit comments

Comments
 (0)