const package:rio
const x is a unary function which evaluates to
x for
all inputs.
>>> const 42 "hello"
42
>>> map (const 42) [0..3]
[42,42,42,42]
O(n) Construct a vector with
n elements by repeatedly
applying the generator function to the already constructed part of the
vector.
constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in <a,b,c>
O(n) Construct a vector with
n elements from right to
left by repeatedly applying the generator function to the already
constructed part of the vector.
constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in <c,b,a>
O(n) Construct a vector with
n elements by repeatedly
applying the generator function to the already constructed part of the
vector.
constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in <a,b,c>
O(n) Construct a vector with
n elements from right to
left by repeatedly applying the generator function to the already
constructed part of the vector.
constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in <c,b,a>
O(n) Construct a vector with
n elements by repeatedly
applying the generator function to the already constructed part of the
vector.
constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in <a,b,c>
O(n) Construct a vector with
n elements from right to
left by repeatedly applying the generator function to the already
constructed part of the vector.
constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in <c,b,a>
O(n) Construct a vector with
n elements by repeatedly
applying the generator function to the already constructed part of the
vector.
constructN 3 f = let a = f <> ; b = f <a> ; c = f <a,b> in <a,b,c>
O(n) Construct a vector with
n elements from right to
left by repeatedly applying the generator function to the already
constructed part of the vector.
constructrN 3 f = let a = f <> ; b = f<a> ; c = f <b,a> in <c,b,a>
Obtaining the constructor from a given datum. For proper terms, this
is meant to be the top-level constructor. Primitive datatypes are here
viewed as potentially infinite sets of values (i.e., constructors).