LoopPerfect / neither

Either and Maybe monads for better error-handling in C++ ↔️
MIT License
249 stars 18 forks source link

add a static object none for maybe<void>() #4

Closed nikhedonia closed 5 years ago

nikhedonia commented 7 years ago

current api requires you to write:

Maybe<int> maybeMeaningOfLife(int x) {
  if(x<0) return maybe();  // none; would be better
  return maybe(42);
}
rvarago commented 5 years ago

I've opened an PR for it: https://github.com/LoopPerfect/neither/pull/20