Random overview

Utilities to accommodate fp-ts/Random.

Added in v0.12.0


Table of contents


3 Functions

randomExtract

Like fp-ts/Array::randomElem, but returns the remainder of the array as well.

Signature

export declare const randomExtract: <A>(xs: NonEmptyArray<A>) => IO<[A, A[]]>
randomExtract :: NonEmptyArray a -> IO [a, (Array a)]

Example

import { randomExtract } from 'fp-ts-std/Random'

assert.deepStrictEqual(randomExtract(['x'])(), ['x', []])

Added in v0.12.0