effect-io-ai

Package: effect
Module: Chunk

Chunk.head

Returns the first element of this chunk safely if it exists.

Example (Getting the first element)

import { Chunk } from "effect"

console.log(Chunk.head(Chunk.empty())) // { _tag: "None" }
console.log(Chunk.head(Chunk.make(1, 2, 3))) // { _tag: "Some", value: 1 }

Signature

declare const head: <A>(self: Chunk<A>) => Option<A>

Source

Since v2.0.0