Type safe Option and Result type
Inspired by Rust
NOTE: Works with TypeScript 2.1+ and JavaScript. strictNullChecks
option / flag is strongly recommended.
Documentation
Install
yarn add tsp-monads
Basic Usage
; // The return value of the function is an option; // Pattern match to retrieve the value; console.logmessage; // 'Result: 0.6666666666666666'
console.loggetIndex, 'b'; // Ok(1)console.loggetIndex, 'z'; // Err('Value not found')...