What happened to NullableRaise? Does it really hav...
# arrow
d
What happened to NullableRaise? Does it really have to be replaced with the much less understandable SingletonRaiseNothing?...? Is there somewhere in the docs that explains SingletonRaise? It seems like there's some issues on it, but I'm coming in the middle of the disscussion so I don't really understand what's going on there. There's also no KDocs on it.
y
You can just replace it with
SingletonRaise<*>
, since it's unlikely you're calling
raise(null)
instead of just
raise()
. The plan is that when context params are out,
SingletonRaise
will disappear, and instead you'll just use
Raise<Unit>
.
Basically,
SingletonRaise
is a
Raise<Unit>
under the hood, but it optionally appears as a way to
raise(null)
or
raise(None)
or anything like that. That's mainly because we wanted to preserve the shape of some APIs. It is practically a unified API for
NullableRaise
,
OptionRaise
, etc.
d
So why
Singleton
?
y
Because it raises the same thing every time,
Unit
. Basically,
UnitRaise
didn't sound good. Edit: oops turns out I called it that? I think again
UnitRaise
didn't sound correct, and the commonality between
NullableRaise
et al was that they all raise singletons
d
In my mind Singleton is a unique instance of something, not necessarily Unit... and here it seems to be only Unit 🤷🏼‍♂️... I guess naming is hard, but it might at least deserve a KDoc to document what it is...
That's the first place I looked before asking here... in the KDocs.
y
Yeah that's fair. I'll contribute a KDoc when I can!
👍🏼 1