Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as mod from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/these.ts";

This file contains the These algebraic data type. These is a sort of combination of Either and Pair. It can represent a complete failure or a partial failure.

§Variables

BimappableThese
FoldableThese
MappableThese
TraversableThese

§Functions

both

Create a These that represents a partial success with both values.

fail

Create a These that always fails with the given error.

fold

Fold over a These to produce a single value.

getCombinableThese

Create a Combinable instance for These given Combinable instances for the Left and Right types.

getFlatmappableRight

Create a Flatmappable instance for These with a fixed left type.

getInitializableThese

Create an Initializable instance for These given Initializable instances for the Left and Right types.

getShowableThese

Create a Showable instance for These given Showable instances for the Left and Right types.

isBoth

Check if a These is a Both (partial success).

isLeft

Check if a These is a Left (complete failure).

isRight

Check if a These is a Right (complete success).

left

Create a These that represents a complete failure.

map

Apply a function to the Right value of a These.

mapSecond

Apply a function to the Left value of a These.

match

Pattern match on a These to extract values.

right

Create a These that represents a complete success.

traverse

Traverse over a These using the supplied Applicable.

wrap

Wrap a value in a These as a Right.

§Interfaces

KindRightThese

Specifies These with a fixed left type as a Higher Kinded Type.

KindThese

Specifies These as a Higher Kinded Type, with covariant parameter A corresponding to the 0th index of any substitutions and covariant parameter B corresponding to the 1st index of any substitutions.

§Type Aliases

Both

The Both type represents a partial success with both left and right values.

Left

The Left type represents a complete failure with only a left value.

Right

The Right type represents a complete success with only a right value.

These

The These type represents either a complete failure (Left), complete success (Right), or partial success (Both).