The Maybe Monad
Overview
The maybe type represents the possibility of some value or nothing. It is often used instead of throwing an error or returning `NULL`. The advantage of using a maybe type over `NULL` is that it is both composable and requires the developer to explicitly acknowledge the potential absence of a value, helping to avoid the existence of unexpected behaviour.
Features
maybe_map3Evaluate a ternary function on three maybe valuesand_then2Evaluate a binary maybe returning function on two maybe valuesand_then3Evaluate a ternary maybe returning function on three maybe values
Bug fixes
- Fixed invisible return of maybe value to print correctly
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 30 (1 internal)
- Examples that run
- 100%29 run in a plain check
- Exported functions with examples
- 97%
- Documented parameters
- 98%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 12
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Forks over time
Releases over time
Issues over time
9 development-tooling and community-health practices detected across 5 families in the upstream repository
Checks run against github.com/armcn/maybe on 2026-10-25.
The R CMD check workflow runs on Linux
GitHub Pages site last deployed 2023-08-07 · The repository has a site deploy workflow
Show all practicesHide 1 practice
Dependencies
Installing maybe adds 1 package (1 with compiled code, 275 KB of source tarballs). Heaviest: magrittr 275 KB.
Code & Tests
People & History
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- 1.1.0Latest
- RR 4.3.0 released · 2023-04-21
- 1.0.0
- RR 4.2.0 released · 2022-04-22
- 0.2.1
- 0.2.02022-02-11 · diff ↗ ·
removed 2 exports
flatten_maybe, map_maybeadded 4 exports
maybe_contains, maybe_equal, maybe_flatten, maybe_map - 0.1.02022-01-27
- RR 4.1.0 released · 2021-05-18
Package metadata
- First published
- 2022-01-27
- Total releases
- 5 / 4 yrs
- License
- MIT + file LICENSE OSI
- Download size
- 459 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("maybe")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.