Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/monads/docs/globals.md

👻 Option, Result, and Either types for TypeScript; Inspired by Rust
Go to Latest
File

@hqoss/monadsGlobals

@hqoss/monads

Index

Interfaces

Variables

Functions

Object literals

Variables

Const None

None: OptNone‹any› = none_constructor()

Defined in lib/option/option.ts:44

Functions

Err

ErrT, E›(err: E): ResErr‹T, E›

Defined in lib/result/result.ts:93

Type parameters:

T

E

Parameters:

Name Type
err E

Returns: ResErr‹T, E›


Left

LeftL, R›(val: L): ResLeft‹L, R›

Defined in lib/either/either.ts:54

Type parameters:

L

R

Parameters:

Name Type
val L

Returns: ResLeft‹L, R›


Ok

OkT, E›(val: T): ResOk‹T, E›

Defined in lib/result/result.ts:51

Type parameters:

T

E

Parameters:

Name Type
val T

Returns: ResOk‹T, E›


RightL, R›(val: R): ResRight‹L, R›

Defined in lib/either/either.ts:111

Type parameters:

L

R

Parameters:

Name Type
val R

Returns: ResRight‹L, R›


Some

SomeT›(val?: T | undefined): Option‹T›

Defined in lib/option/option.ts:38

Type parameters:

T

Parameters:

Name Type
val? T | undefined

Returns: Option‹T›


isErr

isErrT, E›(val: Result‹T, E›): val is ResErr

Defined in lib/result/result.ts:139

Type parameters:

T

E

Parameters:

Name Type
val Result‹T, E›

Returns: val is ResErr


isLeft

isLeftL, R›(val: Either‹L, R›): val is ResLeft

Defined in lib/either/either.ts:168

Type parameters:

L

R

Parameters:

Name Type
val Either‹L, R›

Returns: val is ResLeft


isNone

isNoneT›(val: Option‹T›): val is OptNone

Defined in lib/option/option.ts:132

Type parameters:

T

Parameters:

Name Type
val Option‹T›

Returns: val is OptNone


isOk

isOkT, E›(val: Result‹T, E›): val is ResOk

Defined in lib/result/result.ts:135

Type parameters:

T

E

Parameters:

Name Type
val Result‹T, E›

Returns: val is ResOk


isRight

isRightL, R›(val: Either‹L, R›): val is ResRight

Defined in lib/either/either.ts:172

Type parameters:

L

R

Parameters:

Name Type
val Either‹L, R›

Returns: val is ResRight


isSome

isSomeT›(val: Option‹T›): val is OptSome

Defined in lib/option/option.ts:128

Type parameters:

T

Parameters:

Name Type
val Option‹T›

Returns: val is OptSome


none_constructor

none_constructorT›(): OptNone‹T›

Defined in lib/option/option.ts:85

Type parameters:

T

Returns: OptNone‹T›


some_constructor

some_constructorT›(val: T): OptSome‹T›

Defined in lib/option/option.ts:46

Type parameters:

T

Parameters:

Name Type
val T

Returns: OptSome‹T›

Object literals

Const EitherType

EitherType: object

Defined in lib/either/either.ts:3

Left

Left: symbol = Symbol(“:left”)

Defined in lib/either/either.ts:4

Right

Right: symbol = Symbol(“:right”)

Defined in lib/either/either.ts:5


Const OptionType

OptionType: object

Defined in lib/option/option.ts:1

None

None: symbol = Symbol(“:none”)

Defined in lib/option/option.ts:3

Some

Some: symbol = Symbol(“:some”)

Defined in lib/option/option.ts:2


Const ResultType

ResultType: object

Defined in lib/result/result.ts:3

Err

Err: symbol = Symbol(“:err”)

Defined in lib/result/result.ts:5

Ok

Ok: symbol = Symbol(“:ok”)

Defined in lib/result/result.ts:4