Maybe
Maybe a is the FP solution to the problem of null values. It is essentially Either Unit a.
data Maybe a
= Nothing
| Just a
Maybe a is the same as Either unimportantType a
| Package | Type name | "Plain English" name |
|---|---|---|
| purescript-maybe | Maybe a | A full or empty box |
| Usage | Values' Representation |
|---|---|
| Indicates an optional value |
|
Used for error-handling when we don't care about the error (replaces null) |
|
API visualized:
