mirror of
https://github.com/github/semantic.git
synced 2024-12-14 08:25:32 +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
|
||||
lowerBound = ScopeGraph mempty
|
||||
|
||||
data Path scope where
|
||||
data Path scope
|
||||
= Hole
|
||||
-- | Construct a direct path to a declaration.
|
||||
Hole :: Path scope
|
||||
DPath :: Declaration -> Position -> Path scope
|
||||
| DPath Declaration Position
|
||||
-- | 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
|
||||
hole = Hole
|
||||
|
Loading…
Reference in New Issue
Block a user