Packages

đŸ›’ A small library of helper functions, that works as a companion of gleam_stdlib

Current section

Files

Jump to
gxyz src gxyz_ffi.mjs
Raw

src/gxyz_ffi.mjs

import { Error, Ok } from "../prelude.mjs";
const err = new Error(undefined);
export function element(index, tuple) {
const val = tuple[index - 1];
if (val === undefined) {
return err;
} else {
return new Ok(val);
}
}