mirror of
https://github.com/github/semantic.git
synced 2024-12-15 01:51:39 +03:00
Define Path as an ordinary datatype.
Co-Authored-By: Rick Winfrey <rick.winfrey@gmail.com>
This commit is contained in:
parent
79e235ce34
commit
dcd751f4b9
@ -66,12 +66,12 @@ newtype ScopeGraph scope = ScopeGraph { unScopeGraph :: Map scope (Scope scope)
|
|||||||
instance Ord scope => Lower (ScopeGraph scope) where
|
instance Ord scope => Lower (ScopeGraph scope) where
|
||||||
lowerBound = ScopeGraph mempty
|
lowerBound = ScopeGraph mempty
|
||||||
|
|
||||||
data Path scope where
|
data Path scope
|
||||||
|
= Hole
|
||||||
-- | Construct a direct path to a declaration.
|
-- | Construct a direct path to a declaration.
|
||||||
Hole :: Path scope
|
| DPath Declaration Position
|
||||||
DPath :: Declaration -> Position -> Path scope
|
|
||||||
-- | Construct an edge from a scope to another declaration path.
|
-- | Construct an edge from a scope to another declaration path.
|
||||||
EPath :: EdgeLabel -> scope -> Path scope -> Path scope
|
| EPath EdgeLabel scope (Path scope)
|
||||||
|
|
||||||
instance AbstractHole (Path scope) where
|
instance AbstractHole (Path scope) where
|
||||||
hole = Hole
|
hole = Hole
|
||||||
|
Loading…
Reference in New Issue
Block a user