MVFM

redis/lindex

Get an element by its index (negative counts from the end)

const app = mvfm(prelude, redis);
const prog = app({}, ($) => {
  return $.begin(
    $.redis.rpush("tasks", "a", "b", "c"),
    $.redis.lindex("tasks", -1)
  );
});
await fold(
  defaults(app, { redis: memoryRedisInterpreter }),
  prog
);
Ctrl+Enter