Hyperlinkv0.8.0-beta.28

Function

Function.SKconsteffect/Function.ts:1379
<A, B>(_: A, b: B): B

Returns the second argument and discards the first. The SK combinator is a fundamental combinator in the lambda calculus and the SKI combinator calculus.

When to use

Use to discard the first argument and return the second argument.

Example (Discarding the first argument)

import { Function } from "effect"
import * as assert from "node:assert"

assert.deepStrictEqual(Function.SK(0, "hello"), "hello")
combinators
export const SK = <A, B>(_: A, b: B): B => b