MCPcopy Index your code
hub / github.com/Effect-TS/effect / unsafeHead

Function unsafeHead

packages/effect/src/List.ts:940–945  ·  view source on GitHub ↗
(self: List<A>)

Source from the content-addressed store, hash-verified

938 * @category unsafe
939 */
940export const unsafeHead = <A>(self: List<A>): A => {
941 if (isNil(self)) {
942 throw new Error(getExpectedListToBeNonEmptyErrorMessage)
943 }
944 return self.head
945}
946
947/**
948 * Unsafely returns the last element of the specified `List`.

Callers 2

partialFillFunction · 0.70
List.tsFile · 0.70

Calls 1

isNilFunction · 0.85

Tested by

no test coverage detected