-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add support for type classes that abstract over type constructors of 2 type params #6
Comments
I have a variant on this. were the first type parameter is important, but the rest are just plumbing. For example:
The typeclass type here is The code to generate in the companion looks something like this (abridged):
|
And another variant:
Here, only T1 ever appears on the left, so essentially the same code generation strategy could be used as currently, except that T2 needs to be carried around. |
+1 I'd love to have this ability! |
We do sort of have curried type lists, or at least a way to make the plumbing depend on the one which matters. Since #21 is now fixed this should be viable in practice. trait Fold2[T] {
type A1
type A2
def fold[X](t: T)(
f1: A1 => X,
f2: A2 => X): X
} |
@mpilquist I'm going to take a stab at this tomorrow since I want to tidy up the |
@yilinwei That would be awesome :) |
A day or two late, but as promised #59. wrt to the |
Does this mean this ticket can be closed? Does simulacrum now support this as well?
|
FYI: if this is fixed the Readme also needs to be updated at the very bottom |
Not yet - I wanted to think a little about the type traversal before continuing - at the moment tit does |
E.g., bifunctors, profunctors, arrows
The text was updated successfully, but these errors were encountered: