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

I think the obvious implementation is `maybe (Left False) (maybe (Left True) Right)`

If we have a value then we clearly have both layers. If we don't have a value then we need to distinguish Nothing from Just Nothing by way of the book.



Oh, I see; we're thinking of `Maybe a` as `a + ()`, and then identifying `(a + ()) + ()` with `a + (() + ())` and then `() + ()` with `Bool`. Thanks!


Right, exactly!




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

Search: