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
ken
01/08/2020, 8:08 AM
Why would someone want to call client.invoke() ?
j
Jiri Malina
01/08/2020, 8:39 AM
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.