Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If it had been done at the very beginning, I think it would have been wonderful...but given that legal, idiomatic nil is already out in the wild I think it's too late. Such a shame - in the example of error handling, returning an Option doesn't appreciably increase verbosity:

    _, err := potentiallyErroringOperation()

    // with idiomatic nil
    if err != nil {...}

    // with monadic Option
    if err.isDefined() {....}
EDIT: fix typo


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: