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 <..>
332332-- | if the last path segment is root directory, current directory, or parent
333333-- | directory).
334334peel
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
341335 :: forall a b s
342336 . Path a b s
343337 -> 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'
348342 _ -> Nothing
349- unsafePeel (In p n) = Just $ Tuple p n
343+ peel (In p n) = Just $ Tuple p n
350344
351345-- | Returns the depth of the path. This may be negative in some cases, e.g.
352346-- | `./../../../` has depth `-3`.
@@ -482,7 +476,7 @@ relativeTo p1 p2 = relativeTo' (canonicalize p1) (canonicalize p2)
482476 relativeTo' cp1 cp2
483477 | identicalPath cp1 cp2 = pure Current
484478 | otherwise = do
485- Tuple cp1Path name <- unsafePeel cp1
479+ Tuple cp1Path name <- peel cp1
486480 rel <- relativeTo' cp1Path cp2
487481 pure case dirOrFileName name of
488482 Left dirN -> joinSplit $ rel </> In (Current :: Path Rel Dir s' ) dirN
You can’t perform that action at this time.
0 commit comments