Link Search Menu Expand Document

Option overview

Utility functions to accommodate fp-ts/Option.

Added in v0.1.0


Table of contents


utils

unsafeUnwrap

Unwrap the value from within an Option, throwing if None.

Signature

export declare const unsafeUnwrap: <A>(x: Option<A>) => A
unsafeUnwrap :: Option a -> a

Example

import { unsafeUnwrap } from 'fp-ts-std/Option'
import * as O from 'fp-ts/Option'

assert.deepStrictEqual(unsafeUnwrap(O.some(5)), 5)

Added in v0.1.0