const
lib.const
Docs pulled from | This Revision | about 1 hour 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
Implementation
The following is the current implementation of this function.
const =
x:
y: x;