Hyperlinkv0.8.0-beta.28

Chunk

Chunk.headconsteffect/Chunk.ts:1406
<A>(self: Chunk<A>): Option<A>

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 }
elements
Source effect/Chunk.ts:14061 lines
export const head: <A>(self: Chunk<A>) => Option<A> = get(0)
Referenced by 8 symbols