File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -332,21 +332,15 @@ infixl 6 parentAppend as <..>
332
332
-- | if the last path segment is root directory, current directory, or parent
333
333
-- | directory).
334
334
peel
335
- :: forall a b s
336
- . Path a b s
337
- -> Maybe (Tuple (Path a Dir Unsandboxed ) (Name b ))
338
- peel = unsafeCoerce unsafePeel
339
-
340
- unsafePeel
341
335
:: forall a b s
342
336
. Path a b s
343
337
-> Maybe (Tuple (Path a Dir s ) (Name b ))
344
- unsafePeel Current = Nothing
345
- unsafePeel Root = Nothing
346
- unsafePeel p@(ParentIn _) = case canonicalize' p of
347
- Tuple true p' -> unsafePeel p'
338
+ peel Current = Nothing
339
+ peel Root = Nothing
340
+ peel p@(ParentIn _) = case canonicalize' p of
341
+ Tuple true p' -> peel p'
348
342
_ -> Nothing
349
- unsafePeel (In p n) = Just $ Tuple p n
343
+ peel (In p n) = Just $ Tuple p n
350
344
351
345
-- | Returns the depth of the path. This may be negative in some cases, e.g.
352
346
-- | `./../../../` has depth `-3`.
@@ -482,7 +476,7 @@ relativeTo p1 p2 = relativeTo' (canonicalize p1) (canonicalize p2)
482
476
relativeTo' cp1 cp2
483
477
| identicalPath cp1 cp2 = pure Current
484
478
| otherwise = do
485
- Tuple cp1Path name <- unsafePeel cp1
479
+ Tuple cp1Path name <- peel cp1
486
480
rel <- relativeTo' cp1Path cp2
487
481
pure case dirOrFileName name of
488
482
Left dirN -> joinSplit $ rel </> In (Current :: Path Rel Dir s' ) dirN
You can’t perform that action at this time.
0 commit comments