CLOVIS
11/04/2021, 10:36 AMraulraja
11/04/2021, 10:57 AMwith
or run
at some point to materialize their scope. They replace implicit summoning by making the contextual function only resolvable when they are scoped in the intersection of all declared context types.
context(A, B)
fun foo(): Unit {}
a.run { b.run { foo() }} //ok
foo() //not ok, kotlin won't summon providers for A and B, wants you to be explicit
For the missing part we are working in the Arrow Context plugin with Arrow Meta https://github.com/arrow-kt/arrow-meta/blob/8c727799308956d28f38c4e3706bc2ce5c4a52[…]plugin/src/test/kotlin/arrow/meta/plugins/proofs/ContextTest.kt which will also work for materializing contexts from multiple receiversCLOVIS
11/04/2021, 3:27 PM