You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It should be noted that the type of the variable v in case 3 is impeccable (Int(3)), the only problem happens on calling s3 without specifying the correct type parameter Witness._3 (or something equal). The type Int(3) is automatically erased and become Int, for which there is no Witness that can be summoned.
The problem becomes particularly bad when s3 is not just a function with 1 parameter, but part of a type class that has to be recursively called to church-encode an HList-like object. In this case the type class is impossible to be used without declaring their type parameters, which is as bad as writing a chain of type class instances manually.
Can it be solved or we have to wait for the dotty version?
The text was updated successfully, but these errors were encountered:
This is technically a compiler compatibility issue, so I'm not sure how much work can be done without touching the compiler.
Here is a simple example in scalatest:
It should be noted that the type of the variable v in case 3 is impeccable (
Int(3)
), the only problem happens on calling s3 without specifying the correct type parameterWitness._3
(or something equal). The typeInt(3)
is automatically erased and become Int, for which there is no Witness that can be summoned.The problem becomes particularly bad when s3 is not just a function with 1 parameter, but part of a type class that has to be recursively called to church-encode an HList-like object. In this case the type class is impossible to be used without declaring their type parameters, which is as bad as writing a chain of type class instances manually.
Can it be solved or we have to wait for the dotty version?
The text was updated successfully, but these errors were encountered: