Skip to content

Commit

Permalink
Merge pull request #23 from slamdata/fix-shadow
Browse files Browse the repository at this point in the history
Fix shadowed name warnings
  • Loading branch information
garyb committed Dec 21, 2016
2 parents 7462437 + be3b57c commit adf6119
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Data/Path/Pathy.purs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ peel
peel Current = Nothing
peel Root = Nothing
peel p@(ParentIn _) = case canonicalize' p of
Tuple true p -> peel p
Tuple true p' -> peel p'
_ -> Nothing
peel (DirIn p d) = Just $ Tuple (unsafeCoerceType p) (Left d)
peel (FileIn p f) = Just $ Tuple (unsafeCoerceType p) (Right f)
Expand Down Expand Up @@ -445,11 +445,11 @@ relativeTo p1 p2 = relativeTo' (canonicalize p1) (canonicalize p2)
relativeTo' :: forall b'. Path a b' s -> Path a Dir s' -> Maybe (Path Rel b' s')
relativeTo' Root Root = Just Current
relativeTo' Current Current = Just Current
relativeTo' p1 p2
| identicalPath p1 p2 = Just Current
| otherwise = case peel p1 of
Just (Tuple p1' e) ->
flip (</>) (either (DirIn Current) (FileIn Current) e) <$> relativeTo' p1' p2
relativeTo' cp1 cp2
| identicalPath cp1 cp2 = Just Current
| otherwise = case peel cp1 of
Just (Tuple cp1' e) ->
flip (</>) (either (DirIn Current) (FileIn Current) e) <$> relativeTo' cp1' cp2
Nothing -> Nothing

-- | Attempts to sandbox a path relative to some directory. If successful, the sandboxed
Expand Down

0 comments on commit adf6119

Please sign in to comment.