[Development] QtCS 2017 QtCore sessions

Allan Sandfeld Jensen kde at carewolf.com
Mon Dec 4 15:20:02 CET 2017


On Montag, 4. Dezember 2017 15:00:53 CET Marc Mutz wrote:
> 
> Ah, well, yes. Nothing truly originates in C++, true. But, IIRC, the
> Haskell name is maybe. So why is it QOptional and not QMaybe? Because
> the C++ interface is used as the basis, not something from Haskell.
> 

I believe the name "optional" comes from Haskell and Java where it appeared 
first. The standard library only imports things that are already industry 
standard, and once there were several implementations of optional out there, 
they started to pull one in. They just didn't manage to write it without using 
C++17'isms.

The other name that sometimes gets used instead of Optional is Nullable (from 
SQL and C#), but that is a little different. I don't think "maybe" ever gets 
used much for this kind of type.

Anyway. I do believe we should try to be compatible with std. I just don't see 
the point in throwing our hands in the air and refusing to improve our base 
classes while waiting for something we might be able to use 9 years from now.

Btw. One of the issues with std::expected and std::outcome is that many are 
pushing  for them to become C++ versions of Haskell monads, which complicates 
things.

Best regard
'Allan



More information about the Development mailing list