@@ -276,18 +276,14 @@ pathName :: forall b s. AnyPath b s -> Either (Maybe (Name Dir)) (Name File)
276276pathName = bimap dirName fileName
277277
278278-- | 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
280280appendPath _ Root = unsafeCrashWith " Imposible as Root can't be Path Rel"
281281appendPath Current Current = Current
282282appendPath Root Current = Root
283- -- TODO this shold be correct?
284- -- appendPath (ParentIn p) c@Current = ParentIn (p </> c)
285283appendPath (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)
289285appendPath 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
291287
292288infixl 6 appendPath as </>
293289
@@ -306,8 +302,7 @@ infixl 6 setExtension as <.>
306302-- | its previous sandbox.
307303parentAppend
308304 :: forall a b s s'
309- . SplitDirOrFile b
310- => Path a Dir s
305+ . Path a Dir s
311306 -> Path Rel b s'
312307 -> Path a b Unsandboxed
313308parentAppend d p = parentDir d </> unsandbox p
@@ -346,7 +341,7 @@ unsandbox (In p n) = In (unsandbox p) n
346341
347342-- | Creates a path that points to the parent directory of the specified path.
348343-- | 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
350345parentDir = ParentIn <<< unsandbox
351346
352347unsafeCoerceType :: forall a b b' s . Path a b s -> Path a b' s
0 commit comments