-
Notifications
You must be signed in to change notification settings - Fork 41
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
instance args #3
Conversation
jmchapman
commented
Oct 22, 2020
•
edited
Loading
edited
- (first attempt at) converting instances args to constraints in type sigs
- not expanding instance usage in clause bodies
- type classes
- instances
- Dealing with typically derived stuff like Show
1513c9c
to
85541e7
Compare
This commit is just recording where we got to this morning on deteching a "class" pragma on a record. The tests currently fail as the RHSs of sumMon contain "M.f r" instead of "f".
…on the RHS This works for the example but is a hack. 1. Assume any record projection is a usage of an instance arg. 2. Strip the module prefix off the name. 3. Eat the first visible argument which is the record. All 3 should be done better.
37efb8f
to
20e2929
Compare
Try a combination of |
Thanks, I'll give that shot! |
class Monoid a where mempty :: a mappend :: a -> a -> a
Would it make sense to limit the scope of this PR and try to get it merged in its current stage (pending merge conflicts)? Just having the translation of class constraints and proper handling of calls to member functions lets you work with the Prelude type classes. |
Yes, good idea. Apologies for blocking this feature (and the prelude). I am planning to get back to agda2hs tomorrow. I added some support for compiling record declarations into type classes. I haven't dealt with compiling instances of those records to type class instances or picking up |
ba24d87
to
d7ff9bf
Compare
d7ff9bf
to
d58c6f9
Compare
I did a merge. The things I have done should probably be made more robust/flexible but perhaps it's already useful? |