Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Maybe.fromNullable 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.fromNullable` which works similarly to `Option.apply`. If it is passed `null` it returns `Empty` but otherwise just wraps a value in `Just`. The name `fromNullable` was chosen to be explicit about the fact that it accepts a null input. It was determined that `Maybe.apply` would be a bad choice because it might be expected to be the same as Maybe's `point` (which it is not). (cherry picked from commit 883ade8)
- Loading branch information