scalaz/scalaz — pull request #794 by ceedubs (2014-08-15 14:25:26+00:00)
Title: Add Maybe.apply for null -> Empty

I consider it a major oversight that I failed to address Java interop
where `null` is a possibility in my original implementation of Maybe. This
commit adds `Maybe.apply` which works similarly to `Option.apply`. If it is
passed `null` it returns `Empty` but otherwise just wraps a value in
`Just`.

`Maybe.apply` seemed like a natural choice to mirror `Option.apply`, but
I'm open to other method name suggestions. Since Scalaz generally
assumes reasonable expectations like no nulls, I can see an argument for
a more explicit method name such as `Maybe.noNull` or something.

This is probably a candidate for backporting. @larsrh please let me know what to do on that front.