-
Notifications
You must be signed in to change notification settings - Fork 4
Change the AST representation of CTree
to use "Trees that grow"
#96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
20f577c
to
8c2caac
Compare
CTree
to use "Trees that grow"
b681669
to
9b3a530
Compare
ad847e1
to
4a858b9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
type instance CTreeExt OrReferenced = OrRef (CTree OrReferenced) | ||
|
||
-- | Indicates that an item may be referenced rather than defined. | ||
data OrRef a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this type parameter still needed?
data OrRef a | |
data OrRef |
deriving (Show) | ||
|
||
deriving instance Eq (OrRef (CTree OrRef)) => Eq NameResolutionFailure | ||
deriving instance Eq (CTree.Node OrReferenced) => Eq NameResolutionFailure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constraint should not be necessary. It is fully saturated and Eq
for Node
is not an orphan instance
deriving instance Eq (CTree.Node OrReferenced) => Eq NameResolutionFailure | |
deriving instance Eq NameResolutionFailure |
|
||
data OrReferenced | ||
|
||
type instance CTreeExt OrReferenced = OrRef (CTree OrReferenced) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comment below
type instance CTreeExt OrReferenced = OrRef (CTree OrReferenced) | |
type instance CTreeExt OrReferenced = OrRef |
This PR changes the representation of the
CTree
AST to trees that grow. This is a step towards having a single AST representation across the entire repo.I got rid of the fixpoint decorations by adding a
CTreeE
constructor to theCTree
datatype, which can be used to store each of the different references by choosing the right index type. This approach of with the index can also be later used to add additional fields to the terms (e.g. for storing custom generators or comments for each term).