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/sync_either.ts";

This file contains the SyncEither algebraic data type. SyncEither is an lazy function that takes no inputs and returns an Either. The intuition of a SyncEither is an IO call that can fail.

§Variables

ApplicableSyncEither
BimappableSyncEither
bind
bindTo
FailableSyncEither
FlatmappableSyncEither
FoldableSyncEither
MappableSyncEither
tap
WrappableSyncEither

§Functions

alt

Provide an alternative SyncEither if the current one fails.

apply

Apply a function wrapped in a SyncEither to a value wrapped in a SyncEither.

fail

Create a SyncEither that always fails with the given error.

flatmap

Chain SyncEither computations together.

fold

Fold over a SyncEither to produce a single value.

fromEither

Convert an Either to a SyncEither.

fromSync

Convert a Sync to a SyncEither, treating any failure as a Right.

getCombinableSyncEither

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

getFlatmappableSyncRight

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

getInitializableSyncEither

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

left

Create a SyncEither that always fails with the given error.

map

Apply a function to the Right value of a SyncEither.

mapSecond

Apply a function to the Left value of a SyncEither.

recover

Recover from a Left value by applying a function to it.

right

Create a SyncEither that always succeeds with the given value.

tryCatch

Wrap a function that can throw in a try/catch block, returning a SyncEither.

wrap

Wrap a value in a SyncEither as a Right.

§Interfaces

KindSyncEither

Specifies SyncEither 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.

KindSyncRight

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

§Type Aliases

SyncEither

The SyncEither type represents a lazy computation that returns an Either.