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
Given an implicit ConversionFactor[P, Q, A, B] and a ConversionFactor[P, Q, B, C], create a ConversionFactor[P, Q, A, C].
Where there are multiple units for a single dimension, conversion factors need to be defined between each pair individually. This means that there's a matrix of implicit conversion factors that need to be written. E.g. for degree, arcsecond and arcminute, conversion factors need to be written for arcsecond - arcminute, arcminute - degree and arcsecond - degree.
It should technically be possible to implicitly derive the arcsecond - degree conversion using the previous two. This would remove a lot of boilerplate when adding new units.
The following implicit fails to resolve:
implicitdeffailedAttemptAtChaining[P, Q, A, B](implicitab: ConversionFactor[P, Q, A, B], bc: ConversionFactor[P, Q, B, C]):ConversionFactor[P, Q, A, C] =???
This is probably because the compiler cannot resolve B, as it only knows A and C.
The text was updated successfully, but these errors were encountered:
Given an implicit
ConversionFactor[P, Q, A, B]
and aConversionFactor[P, Q, B, C]
, create aConversionFactor[P, Q, A, C]
.Where there are multiple units for a single dimension, conversion factors need to be defined between each pair individually. This means that there's a matrix of implicit conversion factors that need to be written. E.g. for
degree
,arcsecond
andarcminute
, conversion factors need to be written forarcsecond
-arcminute
,arcminute
-degree
andarcsecond
-degree
.It should technically be possible to implicitly derive the
arcsecond
-degree
conversion using the previous two. This would remove a lot of boilerplate when adding new units.The following implicit fails to resolve:
This is probably because the compiler cannot resolve
B
, as it only knowsA
andC
.The text was updated successfully, but these errors were encountered: