def run

bend-kit-redis@0.3.0.0 · redis.bend:610

import bend-kit-redis@0.3.0.0/redis.bend as Redis
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

610def run(fuel: Nat, r: Bytes.Bytes & St) -> Bytes.Bytes & Step:
611  match fuel:
612    case 0n:
613      (b, st) = r
614      (b, Bad{})
615    case 1n+f:
616      (b, st) = r
617      match st:
618        case SOk{v, +i}:
619          (b, Reply{v, i})
620        case SMore{}:
621          (b, More{})
622        case SBad{}:
623          (b, Bad{})
624        case SHead{+i, stack}:
625          run(f, head(i, stack, byte(b, i)))
626        case SDone{v, +i, stack}:
627          run(f, (b, done(stack, v, i)))

Uses (9)

Used by (1)