Closed jbgi closed 8 years ago
Nice work! Looks good.
On hackage they have lower2, lower3 as well, but don't know how useful it really is.
lower2/3 will need to be unsafe in Java (as in scala), for lack of the haskell "type families" feature. cf. https://github.com/scalaz/scalaz/blob/series/7.3.x/core/src/main/scala/scalaz/Leibniz.scala#L152
Do we still want to include them?
edit: even in Haskell it seams that the extensions that allow to write lower2/3 without coerce also allow to derive inconsistencies: http://okmij.org/ftp/Haskell/impredicativity-bites.html
in that case. No, leave lower2,lower3 out for now.
Also we need to decide over a "narrow" method name. @derive4j/hkt Please vote:
Of course, eventually, the implementation of the narrow (ofHkt
) methods will need to be generated by the processor. Only then the implementation will be completely safe.
i'll vote for 1
I have to admit to have some nostalgic feelings concerning narrow
: Once upon a time, when punch cards were still a thing, there was an ancient object request broker protocol called CORBA... There you have it, I feel really, really old now :-/
But I don't have a strong opinion, and ofHTK
seems to be more specific.
WIP, need more work (javadoc, lift2, lift3, ...). for initial review by @gneuvill and @clinuxrulz.
This will allow to implement #17 as well as to use Leibniz for GADT in, eg., derive4j.