Hi - I'm trying to create a diagram summarising th...
# arrow
d
Hi - I'm trying to create a diagram summarising the main ways to use
Raise
, including its interactions with
Either
and
Effect
. This is what I have so far. • Are there any errors (no pun intended)? • What's missing?
🦜 1
🎉 6
arrow intensifies 4
a
this is amazing! if you're up for it, we would love to have it in the docs 🙂
1
a few comments: • almost nobody uses
Effect
anymore, so I would suggest to remove it • the case of
fold
is actually closer to
either
than going to the happy path. With that I mean that all the rest of operations "stay" in the
Raise
context but
fold
is used to "escape" it by stating how to deal with each case • I'd be awesome if you could also add
RaiseAccumulate
to the mix, and operations like
zipOrAccumulate
or
mapOrAccumulate
to go there
d
Thanks! Yeah, I initially excluded the collection operations from the diagram, but would love to include, especially if removing
Effect
! Worth experimenting with representation of
fold
- it's a balancing act of accuracy vs clarity 😄 @Alejandro Serrano.Mena Happy to add you as a collaborator, so you can update / use in docs. It's currently in Lucid - DM me with your email and I'll try to set up the sharing.
Just realised
fold
is in
Fold.kt
not
Raise.kt
! But still in
raise
package. Hmmm... 🤔
a
at some point the
Raise
file became too long and it was divided into several ones 😕
1
s
Yes, it's simply organisational. We re-use the same technique as KotlinX Coroutines, where code is split into separate files but it's compiled as a single (JVM) file.
😱 1
e
@Alejandro Serrano.Mena, Could you please clarify what you meant by "almost nobody uses
Effect
anymore"? I have several projects where
Effect
is the core utility concept. What is your vision of modeling effects in code? I assume that it can be using direct
suspend
functions with the
Raise
context?
a
that's the actual definition of `Effect`:
Raise<E>.() -> A
so moving to functions directly using the Raise context provides nicer syntax than using Effect, IMO
🙏 1
1