Why would one prefer the first over the second?
# announcements
k
Why would one prefer the first over the second?
j
The first one returns a function which doesn’t take any parameters and returns “Either<..>“. So in the client code you could call something like “result.invoke()“. The second one returns “Either<…> directly, not a function.
k
Why would someone want to call client.invoke() ?
j
Just a dummy example. Imagine you don’t want to return a weather which is right not, but a function which always returns the “current/up-to-date” weather. What you can do is return a function and whenever you call “result.invoke()” it’ll tell you the current whether.
s
-> lazy evaluation or repeated evaluation