On Thu, Jun 19, 2014 at 09:15:47AM -0400, Etienne via Digitalmars-d wrote: > On 2014-06-19 7:31 AM, Nick Treleaven wrote: > >Perhaps Maybe could implement opCast!bool, then we could do: > > > >if (auto v = ...) > > That would be amazing, but maybe is used in haskell for a different > purpose, so failsafe could be a more appropriate name I think: [...]
I've been thinking about the name. I realize that it's not a true monad in the Haskell sense, even though the implementation *was* inspired by deadalnix's mentioning of the Maybe monad, so we really should call it something else. "failsafe" sounds a bit too generic. What about "safeDeref" or just "deref"? OTOH, I wonder how easy it would be to refine the current implementation to become a true monad? T -- What is Matter, what is Mind? Never Mind, it doesn't Matter.