Skip to content

Helpers for ensuring that values are wrapped in a certain type #133

@ghost

Description

The counterparts of fns like from-maybe, take a value and ensure that they are wrapped in the correct type.

An example of how it'd behave for Maybe:

(require '[cats.monad.maybe :as maybe])

(maybe/to-maybe (maybe/just 42))
;; => #<Just 42>

(maybe/to-maybe 3)
;; => #<Just 3>

(maybe/to-maybe nil)
;; => #<Nothing>

(maybe/to-maybe (maybe/nothing))
;; => #<Nothing>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions