on master help sign in
Add commented show instance to Path type
commit8e6653491ad6f9e2432c7380a3494833d2bcd7d1 authorHarendra Kumar <harendra@composewell.com> dateTue 9 Jan 2024, 07:49 (3 years ago) parent350b6ac
1 file changed+9
core/src/Streamly/Internal/FileSystem/Path.hs+9
core/src/Streamly/Internal/FileSystem/Path.hs+9
@@ -151,6 +151,15 @@ instance Exception PathException
151151-- | A type representing file system paths for directories or files.
152152newtype Path = Path (Array WORD_TYPE) -- deriving Eq
153153
154+-- Show instance prints raw bytes without any decoding for rountdtripping.
155+-- Should we print this as a string instead, may be useful for ascii chars but
156+-- utf8 encoded chars may be unprintable. Better use toString if you want to
157+-- pretty print the path.
158+{-
159+instance Show Path where
160+ show (Path x) = show x
161+-}
162+
154163-- XXX Do we need a type for file or dir Name as names cannot have the
155164-- separator char and there may be other restrictions on names? For example,
156165-- length restriction. A file name cannot be "." or "..". We can use the types