@calamitizer/just-maybe

A rigorous but lightweight implementation of the Maybe monad.

Usage no npm install needed!

<script type="module">
  import calamitizerJustMaybe from 'https://cdn.skypack.dev/@calamitizer/just-maybe';
</script>

README

just-maybe

A lightweight implementation of the Maybe (Optional) monad, with rigorous TypeScript definitions provided.

Written as an exercise to learn best practices for maintaining JS/TS compatibility when publishing NPM modules.

Installation

npm i @calamitizer/just-maybe
# or
yarn add @calamitizer/just-maybe

Usage

import Maybe from '@calamitizer/just-maybe';

Maybe.just('An example string').ifPresent(console.log);


To-Do

  • Documentation, maybe
  • Unit testing (Ava is already set up)