kevinmost
07/05/2017, 6:47 PMreturn Unit.INSTANCE;
nayanjyoti
07/05/2017, 6:49 PMkevinmost
07/05/2017, 6:50 PMUnit
Unit
class and try to understand how they can construct one to return, and hopefully then they will see that all you can do with Unit is reference Unit.INSTANCE
nayanjyoti
07/05/2017, 6:51 PMkarelpeeters
07/05/2017, 6:56 PMkevinmost
07/05/2017, 6:59 PMFunctionN<Params..., ReturnType>
, you would need a generic, which void
is not. Maybe Void
could be used there but when you use Void
you still have to return null;
in Java, which I don't think is really any better than return Unit.INSTANCE;
karelpeeters
07/05/2017, 7:03 PMFunctionVoid
or something.kevinmost
07/05/2017, 7:21 PMIntArray
though, where they wouldn't work generically alongside other `Function`s with the same set of arguments. I don't think the loss of that flexibility is worth not having to explicitly returnkarelpeeters
07/05/2017, 7:23 PMnayanjyoti
07/05/2017, 7:35 PM