Is there a tutorial / documentation on how to star...
# arrow
c
Is there a tutorial / documentation on how to start a project with Arrow and context receivers? I'm tempted to use them for Advent of Code
s
Hey @CLOVIS, I was also considering using it for Advent 😄 The documentation around this is still being worked on, but it doesn't really change a lot compared to what you already know with
Either
. I.e.
Copy code
fun example(): Either<String, Int>

translates to

context(EffectScope<String>)
fun example2(): Int
c
Oh, I meant, the Gradle setup to get it working 😅
I've been following your tweets and announcements here, it sounds really promising
s
c
The example you just gave is using
EffectScope
and not
Raise
, is there any difference apart from the naming?
Wait, you mean stable Arrow already works well with context receivers? mind blown
s
Yes, stable Arrow already works with context receivers 😄 Right, the example I gave is
EffectScope
which is in the latest stable.
Raise
is the new name we agreed upon in this channel for 2.x.x and relates to my question of the migration you replied on 😉 I'm working on trying to backport it in a source-compatible way. The biggest difference between
EffectScope
and
Raise
is that
Raise
works through
inline
and thus relies on extension functions. Hence the need to add some additional imports. Thanks through
inline
there will be no more need for
EagerEffectScope
nor for
either.eager { }
vs
either { }
c
Are your AOC solutions public? Very curious about this.
s
AOC?
c
Advent of code, sorry.
c
Mine are public: https://gitlab.com/clovis-ai/advent-of-code-2022 I will be using Core and Optics with context receivers, however so far the standard library has been enough to solve the first four days.