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

x/monads/docs/interfaces/option.md

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

@hqoss/monadsGlobalsOption

Interface: Option ‹T

Type parameters

T

Hierarchy

Index

Properties

Methods

Properties

type

type: symbol

Defined in lib/option/option.ts:12

Methods

and

andU›(optb: Option‹U›): Option‹U›

Defined in lib/option/option.ts:19

Type parameters:

U

Parameters:

Name Type
optb Option‹U›

Returns: Option‹U›


andThen

andThenU›(fn: function): Option‹U›

Defined in lib/option/option.ts:17

Type parameters:

U

Parameters:

fn: function

▸ (val: T): Option‹U›

Parameters:

Name Type
val T

Returns: Option‹U›


isNone

isNone(): boolean

Defined in lib/option/option.ts:14

Returns: boolean


isSome

isSome(): boolean

Defined in lib/option/option.ts:13

Returns: boolean


map

mapU›(fn: function): Option‹U›

Defined in lib/option/option.ts:16

Type parameters:

U

Parameters:

fn: function

▸ (val: T): U

Parameters:

Name Type
val T

Returns: Option‹U›


match

matchU›(fn: Match‹T, U›): U

Defined in lib/option/option.ts:15

Type parameters:

U

Parameters:

Name Type
fn Match‹T, U›

Returns: U


or

orU›(optb: Option‹U›): Option‹T | U›

Defined in lib/option/option.ts:18

Type parameters:

U

Parameters:

Name Type
optb Option‹U›

Returns: Option‹T | U›


unwrap

unwrap(): T | never

Defined in lib/option/option.ts:21

Returns: T | never


unwrapOr

unwrapOr(def: T): T

Defined in lib/option/option.ts:20

Parameters:

Name Type
def T

Returns: T