Skip to content

Commit cd66c7e

Browse files
Rename Typed module to SegNode
1 parent 55f493c commit cd66c7e

File tree

6 files changed

+35
-35
lines changed

6 files changed

+35
-35
lines changed

core/src/Streamly/FileSystem/Path/Typed.hs renamed to core/src/Streamly/FileSystem/Path/SegNode.hs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
-- |
2-
-- Module : Streamly.FileSystem.Path.Typed
2+
-- Module : Streamly.FileSystem.Path.SegNode
33
-- Copyright : (c) 2023 Composewell Technologies
44
-- License : BSD3
55
-- Maintainer : [email protected]
66
-- Portability : GHC
77
--
88

9-
module Streamly.FileSystem.Path.Typed
9+
module Streamly.FileSystem.Path.SegNode
1010
(
1111
-- * Statically Verified Path Literals
1212
-- | Quasiquoters.
@@ -27,4 +27,4 @@ module Streamly.FileSystem.Path.Typed
2727
)
2828
where
2929

30-
import Streamly.Internal.FileSystem.Path.Typed
30+
import Streamly.Internal.FileSystem.Path.SegNode
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-- |
2-
-- Module : Streamly.Internal.FileSystem.Path.Typed
2+
-- Module : Streamly.Internal.FileSystem.Path.SegNode
33
-- Copyright : (c) 2023 Composewell Technologies
44
-- License : BSD3
55
-- Maintainer : [email protected]
@@ -11,10 +11,10 @@
1111
#define OS_PATH PosixPath
1212
#endif
1313

14-
module Streamly.Internal.FileSystem.Path.Typed
14+
module Streamly.Internal.FileSystem.Path.SegNode
1515
(
16-
module Streamly.Internal.FileSystem.OS_PATH.Typed
16+
module Streamly.Internal.FileSystem.OS_PATH.SegNode
1717
)
1818
where
1919

20-
import Streamly.Internal.FileSystem.OS_PATH.Typed
20+
import Streamly.Internal.FileSystem.OS_PATH.SegNode

core/src/Streamly/Internal/FileSystem/PosixPath/Typed.hs renamed to core/src/Streamly/Internal/FileSystem/PosixPath/SegNode.hs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#endif
1313

1414
-- |
15-
-- Module : Streamly.Internal.FileSystem.OS_PATH.Typed
15+
-- Module : Streamly.Internal.FileSystem.OS_PATH.SegNode
1616
-- Copyright : (c) 2023 Composewell Technologies
1717
-- License : BSD3
1818
-- Maintainer : [email protected]
@@ -23,7 +23,7 @@
2323
-- a) or Dir (Rooted a) are not allowed but Rooted (Dir a) and Rooted (File a) are
2424
-- allowed.
2525

26-
module Streamly.Internal.FileSystem.OS_PATH.Typed
26+
module Streamly.Internal.FileSystem.OS_PATH.SegNode
2727
(
2828
-- * Statically Verified Path Literals
2929
-- | Quasiquoters.
@@ -65,9 +65,9 @@ For APIs that have not been released yet.
6565
>>> import Streamly.Internal.FileSystem.PosixPath (PosixPath)
6666
>>> import Streamly.Internal.FileSystem.PosixPath.Node (Dir, File, dir, file)
6767
>>> import Streamly.Internal.FileSystem.PosixPath.Seg (Rooted, Branch, rt, br)
68-
>>> import Streamly.Internal.FileSystem.PosixPath.Typed (rtdir, brdir, rtfile, brfile)
68+
>>> import Streamly.Internal.FileSystem.PosixPath.SegNode (rtdir, brdir, rtfile, brfile)
6969
>>> import qualified Streamly.Internal.FileSystem.PosixPath as Path
70-
>>> import qualified Streamly.Internal.FileSystem.PosixPath.Typed as PathTyp
70+
>>> import qualified Streamly.Internal.FileSystem.PosixPath.SegNode as SegNode
7171
-}
7272

7373
-- Note that (Rooted a) may also be a directory if "a" is (Dir b), but it can also
@@ -245,36 +245,36 @@ brfile = mkQ brfileE
245245
-- If the second path does not have 'File' or 'Dir' information then the return
246246
-- type too cannot have it.
247247
--
248-
-- >> Path.toString (PathTyp.append [rtdir|/usr|] [seg|bin|] :: Rooted PosixPath)
248+
-- >> Path.toString (SegNode.append [rtdir|/usr|] [br|bin|] :: Rooted PosixPath)
249249
-- "/usr/bin"
250-
-- >> Path.toString (PathTyp.append [brdir|usr|] [seg|bin|] :: Branch PosixPath)
250+
-- >> Path.toString (SegNode.append [brdir|usr|] [br|bin|] :: Branch PosixPath)
251251
-- "usr/bin"
252252
--
253-
-- >> Path.toString (PathTyp.append [loc|/usr|] [seg|bin|] :: Rooted PosixPath)
253+
-- >> Path.toString (SegNode.append [rt|/usr|] [br|bin|] :: Rooted PosixPath)
254254
-- "/usr/bin"
255-
-- >> Path.toString (PathTyp.append [seg|usr|] [seg|bin|] :: Branch PosixPath)
255+
-- >> Path.toString (SegNode.append [br|usr|] [br|bin|] :: Branch PosixPath)
256256
-- "usr/bin"
257257
--
258258
-- If the second path has 'File' or 'Dir' information then the return type
259259
-- also has it.
260260
--
261-
-- >> Path.toString (PathTyp.append [loc|/usr|] [brdir|bin|] :: Rooted (Dir PosixPath))
261+
-- >> Path.toString (SegNode.append [rt|/usr|] [brdir|bin|] :: Rooted (Dir PosixPath))
262262
-- "/usr/bin"
263-
-- >> Path.toString (PathTyp.append [loc|/usr|] [brfile|bin|] :: Rooted (File PosixPath))
263+
-- >> Path.toString (SegNode.append [rt|/usr|] [brfile|bin|] :: Rooted (File PosixPath))
264264
-- "/usr/bin"
265-
-- >> Path.toString (PathTyp.append [seg|usr|] [brdir|bin|] :: Branch (Dir PosixPath))
265+
-- >> Path.toString (SegNode.append [br|usr|] [brdir|bin|] :: Branch (Dir PosixPath))
266266
-- "usr/bin"
267-
-- >> Path.toString (PathTyp.append [seg|usr|] [brfile|bin|] :: Branch (File PosixPath))
267+
-- >> Path.toString (SegNode.append [br|usr|] [brfile|bin|] :: Branch (File PosixPath))
268268
-- "usr/bin"
269269
--
270270
-- Type error cases:
271271
--
272-
-- >> PathTyp.append [dir|/usr|] [seg|bin|] -- first arg must be Rooted/Branch
273-
-- >> PathTyp.append [file|/usr|] [seg|bin|] -- first arg must be Rooted/Branch
274-
-- >> PathTyp.append [rtfile|/usr|] [seg|bin|] -- first arg must be a dir
275-
-- >> PathTyp.append [loc|/usr|] [loc|/bin|] -- second arg must be seg
276-
-- >> PathTyp.append [loc|/usr|] [dir|bin|] -- second arg must be seg
277-
-- >> PathTyp.append [loc|/usr|] [file|bin|] -- second arg must be seg
272+
-- >> SegNode.append [dir|/usr|] [br|bin|] -- first arg must be Rooted/Branch
273+
-- >> SegNode.append [file|/usr|] [br|bin|] -- first arg must be Rooted/Branch
274+
-- >> SegNode.append [rtfile|/usr|] [br|bin|] -- first arg must be a dir
275+
-- >> SegNode.append [rt|/usr|] [rt|/bin|] -- second arg must be seg
276+
-- >> SegNode.append [rt|/usr|] [dir|bin|] -- second arg must be seg
277+
-- >> SegNode.append [rt|/usr|] [file|bin|] -- second arg must be seg
278278
--
279279
{-# INLINE append #-}
280280
append ::
@@ -290,13 +290,13 @@ append a (Branch c) = unsafeFromPath $ OS_NAME.unsafeAppend (toPath a) (toPath c
290290

291291
-- | Append a branch type path to a directory.
292292
--
293-
-- >>> Path.toString (PathTyp.append [rtdir|/usr|] [brdir|bin|] :: Rooted (Dir PosixPath))
293+
-- >>> Path.toString (SegNode.append [rtdir|/usr|] [brdir|bin|] :: Rooted (Dir PosixPath))
294294
-- "/usr/bin"
295-
-- >>> Path.toString (PathTyp.append [rtdir|/usr|] [brfile|bin|] :: Rooted (File PosixPath))
295+
-- >>> Path.toString (SegNode.append [rtdir|/usr|] [brfile|bin|] :: Rooted (File PosixPath))
296296
-- "/usr/bin"
297-
-- >>> Path.toString (PathTyp.append [brdir|usr|] [brdir|bin|] :: Branch (Dir PosixPath))
297+
-- >>> Path.toString (SegNode.append [brdir|usr|] [brdir|bin|] :: Branch (Dir PosixPath))
298298
-- "usr/bin"
299-
-- >>> Path.toString (PathTyp.append [brdir|usr|] [brfile|bin|] :: Branch (File PosixPath))
299+
-- >>> Path.toString (SegNode.append [brdir|usr|] [brfile|bin|] :: Branch (File PosixPath))
300300
-- "usr/bin"
301301
--
302302
{-# INLINE append #-}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#define IS_WINDOWS
2+
#include "Streamly/Internal/FileSystem/PosixPath/SegNode.hs"

core/src/Streamly/Internal/FileSystem/WindowsPath/Typed.hs

Lines changed: 0 additions & 2 deletions
This file was deleted.

core/streamly-core.cabal

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,17 +382,17 @@ library
382382
, Streamly.Internal.FileSystem.Path
383383
, Streamly.Internal.FileSystem.Path.Seg
384384
, Streamly.Internal.FileSystem.Path.Node
385-
, Streamly.Internal.FileSystem.Path.Typed
385+
, Streamly.Internal.FileSystem.Path.SegNode
386386

387387
, Streamly.Internal.FileSystem.PosixPath
388388
, Streamly.Internal.FileSystem.PosixPath.Seg
389389
, Streamly.Internal.FileSystem.PosixPath.Node
390-
, Streamly.Internal.FileSystem.PosixPath.Typed
390+
, Streamly.Internal.FileSystem.PosixPath.SegNode
391391

392392
, Streamly.Internal.FileSystem.WindowsPath
393393
, Streamly.Internal.FileSystem.WindowsPath.Seg
394394
, Streamly.Internal.FileSystem.WindowsPath.Node
395-
, Streamly.Internal.FileSystem.WindowsPath.Typed
395+
, Streamly.Internal.FileSystem.WindowsPath.SegNode
396396

397397
, Streamly.Internal.FileSystem.Handle
398398
, Streamly.Internal.FileSystem.File
@@ -449,7 +449,7 @@ library
449449
, Streamly.FileSystem.Path
450450
, Streamly.FileSystem.Path.Seg
451451
, Streamly.FileSystem.Path.Node
452-
, Streamly.FileSystem.Path.Typed
452+
, Streamly.FileSystem.Path.SegNode
453453
, Streamly.Unicode.Parser
454454
, Streamly.Unicode.Stream
455455
, Streamly.Unicode.String

0 commit comments

Comments
 (0)