Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/careful/mod.ts

Safe containerization of values for TypeScript
Latest
import * as careful from "https://deno.land/x/careful@v0.1.0/mod.ts";

Classes

Container is a base class for all entities that have a value and a trackId.

The IO class represents a lazy computation that may produce a value of type A. It is essentially a wrapper around a function of type () => A, which is called the "effect".

The Left class represents the left side of Either class which by convention is a "failure".

None is a type that represents no value. It is similar to the Nothing type in Haskell.

OptionAbstract is a type that represents either a value or no value. It is similar to the Maybe type in Haskell.

The Right class represents the right side of Either class which by convention is a "success".

Some is a type that represents a value. It is similar to the Just type in Haskell.

Variables

None - Creates a new None instance.

This pipe function that takes a value and a list of functions and returns the result of applying the value to the functions in order.

Some - Creates a new Some instance.

Functions

This curry function takes in a function fn and returns a curried version of it. When the curried function is called with arguments, it checks if the number of arguments is greater than or equal to the number of arguments the original function fn takes.

Type Aliases

The Either class represents a value of one of two possible types (a disjoint union). An Either is either a Left or a Right.

Option is a type that represents either a value or no value. It is similar to the Maybe type in Haskell.