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

A typical Haskell project will have thousands upon thousands of uses of Maybe, and only a handful of calls to the unsafe "unjust". Sure, sometime the maybe wrapper is wrong and you have to force it but it is exceedingly rare and in the vast majority of cases you have maybe you need to actually handle the nothing case. The compiler makes sure you do. It also makes sure you remember not to give nothing to a function that doesn't expect it. It also reminds you to think really hard if you unsafe fromJust.

Without it you can easily hand null to anyone who doesn't expect it, and forget to think about null when receiving it.



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

Search: