You're basically asking for a convenient API to access the constructor unification stuff (which brings in the SI-2712 semantics). I think your hack is probably best.
-
-
-
I just want to point out (to my defense) that it was not me who gave
@propensive that idea; he probably came up with it by himself.
End of conversation
New conversation -
-
-
Can you share your hack for this?
-
Happy to, but I only have Internet on my phone at the moment. I'll push later and let you know. Will you be at SbtB this week?
- Show replies
New conversation -
-
-
If you’re after the instantiation of `clazz` `List`’s type params given the fully applied type `tp`, use `tp.baseType(clazz).typeArgs`. They will line up with `clazz.typeParams`. No inference/type checking required
-
Sounds like a nicer solution, and I feel a bit dumb now, because that's exactly what I did to get GADTs working in Magnolia about two weeks ago...
End of conversation
New conversation -
-
-
Not via the public API.
-
What's the private API method?
- Show replies
New conversation -
-
-
Nor sure, but if your list is fixed length, a HList such as found in Shapeless might help. Again, not sure if that would work for your use case (or answers the question).
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Definitely interested in the answer to this. Ping me if you get a promising lead.
-
Check out Adriaan's answer, though I haven't applied it to my code yet. I'm not sure it works as universally as I need for this particular use case. My first solution of typechecking a dummy method still works, but feels a bit hacky...
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.