@@ -276,18 +276,14 @@ pathName :: forall b s. AnyPath b s -> Either (Maybe (Name Dir)) (Name File)
276
276
pathName = bimap dirName fileName
277
277
278
278
-- | Given a directory path, appends either a file or directory to the path.
279
- appendPath :: forall a b s . SplitDirOrFile b => Path a Dir s -> Path Rel b s -> Path a b s
279
+ appendPath :: forall a b s . Path a Dir s -> Path Rel b s -> Path a b s
280
280
appendPath _ Root = unsafeCrashWith " Imposible as Root can't be Path Rel"
281
281
appendPath Current Current = Current
282
282
appendPath Root Current = Root
283
- -- TODO this shold be correct?
284
- -- appendPath (ParentIn p) c@Current = ParentIn (p </> c)
285
283
appendPath (ParentIn p) Current = ParentIn (p </> Current )
286
- appendPath (In p1 (Name f1)) c@Current = case dirOrFile c of
287
- Left dir -> In (p1 </> dir) (Name f1)
288
- Right _ -> unsafeCrashWith " Imposible"
284
+ appendPath (In p (Name d)) Current = In (p </> Current ) (Name d)
289
285
appendPath p1 (ParentIn p2) = ParentIn (p1 </> p2)
290
- appendPath p1 (In p2 f2 ) = In (p1 </> p2) f2
286
+ appendPath p1 (In p2 n2 ) = In (p1 </> p2) n2
291
287
292
288
infixl 6 appendPath as </>
293
289
@@ -306,8 +302,7 @@ infixl 6 setExtension as <.>
306
302
-- | its previous sandbox.
307
303
parentAppend
308
304
:: forall a b s s'
309
- . SplitDirOrFile b
310
- => Path a Dir s
305
+ . Path a Dir s
311
306
-> Path Rel b s'
312
307
-> Path a b Unsandboxed
313
308
parentAppend d p = parentDir d </> unsandbox p
@@ -346,7 +341,7 @@ unsandbox (In p n) = In (unsandbox p) n
346
341
347
342
-- | Creates a path that points to the parent directory of the specified path.
348
343
-- | This function always unsandboxes the path.
349
- parentDir :: forall a b s . Path a Dir s -> Path a Dir Unsandboxed
344
+ parentDir :: forall a s . Path a Dir s -> Path a Dir Unsandboxed
350
345
parentDir = ParentIn <<< unsandbox
351
346
352
347
unsafeCoerceType :: forall a b b' s . Path a b s -> Path a b' s
0 commit comments