query
On this page

const

lib.trivial.const

Docs pulled from | This Revision | about 2 hours ago


The constant function

Ignores the second argument. If called with only one argument, constructs a function that always returns a static value.

Inputs

x

Value to return

y

Value to ignore

Type

const :: a -> b -> a

Examples

lib.trivial.const usage example

let f = const 5; in f 10
=> 5

Noogle detected

Aliases

Implementation

The following is the current implementation of this function.

const =
    x:
    y: x;