import { List, pipe } from "effect";
// prints:
// {
// _id: 'List',
// _tag: 'Cons',
// values: [
// [ 1, undefined ],
// [ 2, undefined ],
// [ 3, undefined ],
// [ 4, undefined ],
// [ 5, undefined ]
// ]
// }
const test: List.List<[number, number]> = pipe(
List.fromIterable([1, 2, 3, 4, 5]),
List.map((x, index) => [x, index])
);
console.log(test.toJSON());
import { List, pipe } from "effect";
// prints:
// {
// _id: 'List',
// _tag: 'Cons',
// values: [
// [ 1, undefined ],
// [ 2, undefined ],
// [ 3, undefined ],
// [ 4, undefined ],
// [ 5, undefined ]
// ]
// }
const test: List.List<[number, number]> = pipe(
List.fromIterable([1, 2, 3, 4, 5]),
List.map((x, index) => [x, index])
);
console.log(test.toJSON());