22 lines
432 B
Plaintext
22 lines
432 B
Plaintext
|
|
namespace List =
|
|
|
|
function map1(f : 'a => 'b, xs : list('a)) =
|
|
switch(xs)
|
|
[] => []
|
|
x :: xs => f(x) :: map1(f, xs)
|
|
|
|
function map2(f : 'a => 'b, xs : list('a)) =
|
|
switch(xs)
|
|
[] => []
|
|
x :: xs => f(x) :: map2(f, xs)
|
|
|
|
contract Deadcode =
|
|
|
|
entrypoint inc1(xs : list(int)) : list(int) =
|
|
List.map1((x) => x + 1, xs)
|
|
|
|
entrypoint inc2(xs : list(int)) : list(int) =
|
|
List.map1((x) => x + 1, xs)
|
|
|