From dcd751f4b917e0cee25a8320ef9392fb9947d9c5 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 6 Dec 2018 13:08:56 -0500 Subject: [PATCH] Define Path as an ordinary datatype. Co-Authored-By: Rick Winfrey --- src/Data/Abstract/ScopeGraph.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Data/Abstract/ScopeGraph.hs b/src/Data/Abstract/ScopeGraph.hs index ed0f9bb3a..3a0e6753c 100644 --- a/src/Data/Abstract/ScopeGraph.hs +++ b/src/Data/Abstract/ScopeGraph.hs @@ -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