CLOVIS
07/08/2021, 4:48 PMraulraja
07/08/2021, 6:20 PMcontext(Monoid<T>) // T is used
fun <T> List<T>.sum(): T = ...
This does not actually take care of pairing Monoid<T> with say the Int monoid instance implicitly, you are still responsible AFAIK to construct that manually so you can invoke this function in the right scope.CLOVIS
07/08/2021, 6:48 PMwith()
part is still mandatory
I guess it will become much easier (and idiomatic) for Arrow Meta to provide the implicit implementation when this is in the language, because then Meta-compiled frameworks will look from the outside as normal idiomatic Kotlinraulraja
07/09/2021, 1:23 PM@Given
or @Instance
but in other places it can be @Config
, @Codec
or whatever injectable domain you are dealing with.