Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any reason why System.Reactive.Unit wasn't called System.Reactive.Void?

Mainly, I'm curious.

We have an object called Unit in our codebase - which represents a component for a bridge or a road. In our case, it can be ambiguous to see ReactiveUI Commands with Unit as one of the Generics in a declaration.

Even in this old documentation (Google doesn't point me in the direction of the current documentation - where ever that is), it says:

"Represents void."

So now I'm wondering, is there any meaning behind the term Unit. How come they didn't just call it System.Reactive.Void?

like image 243
Mitkins Avatar asked Jan 23 '19 22:01

Mitkins


1 Answers

To quote Wikipedia (which also gives examples of other languages using the same name)

a unit type is a type that allows only one value (and thus can hold no information).

In this case the value is Unit.Default.

like image 96
Alexey Romanov Avatar answered Nov 09 '22 13:11

Alexey Romanov