Skip to content
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

Find a way to put instances into their own slice #43

Closed
phischu opened this issue Nov 4, 2014 · 6 comments
Closed

Find a way to put instances into their own slice #43

phischu opened this issue Nov 4, 2014 · 6 comments

Comments

@phischu
Copy link
Collaborator

phischu commented Nov 4, 2014

We put every instance into its own slice. The problem is that the instance depends on both the class it is of and the type it is for. When compiling we would have to import the instance in either one so that it is propagated. But this leads to cyclic imports. Maybe instances really need their own very special treatment.

@phischu
Copy link
Collaborator Author

phischu commented Nov 10, 2014

One idea is to add dependencies to all slices where a class or method is mentioned.

@phischu
Copy link
Collaborator Author

phischu commented Nov 18, 2014

Ok, so if we do the above we again get giant ugly balls of code because instances use declarations and declarations if they mention methods depend on all instances.
Looks really bad, seems like we need to resolve type class instances.

@phischu
Copy link
Collaborator Author

phischu commented Nov 19, 2014

We pair each instance either with the class or with the datatype if the class it builtin.

@phischu
Copy link
Collaborator Author

phischu commented Dec 17, 2014

This probably would solve #72 #63 #48

@phischu
Copy link
Collaborator Author

phischu commented Dec 17, 2014

Another approach is to use {-# SOURCE #-} imports to break the cycles.

@phischu
Copy link
Collaborator Author

phischu commented Dec 21, 2014

Done with fb94f99 and a series of fixes after that.

@phischu phischu closed this as completed Dec 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant