ptal / expected

What did you expect?
113 stars 18 forks source link

[Monads] Change Valued to PossiblyValued #11

Open viboes opened 10 years ago

viboes commented 10 years ago

value doesn't express correctly the fact that the value is optional. optional_value?

viboes commented 10 years ago

Optional proposal talks about a NullableProxy. I don't like the name as the single required operations are check if there is a value and dereference the value. There is no reset operation.

I think that the name must contain Value and the fact that the value can be there or not, Maybe/Optional/Possibly.

I suggest to define a concept PossiblyValued and rename the traits to possibly_valued_traits.

ptal commented 10 years ago

Agreed. Did you consider MaybeValued or MaybeUnexpected? As Maybe is the usual name we give to this monad.

viboes commented 10 years ago

I started with OptionallyValued, and considered MaybeValued. I avoided Maybe and Optional as we have classes that have the same name. I just looked for a synonym.

viboes commented 10 years ago

I suggest to change the title of this issue to Change Valued to PossiblyValued and make it an enhancement.