def array

ezx@1.11.0.0 · src/ws/workspace.bend:441

import ezx@1.11.0.0/src/ws/workspace.bend as Workspace
import Base
import emerging-eztoml@0.9.0.0/main.bend as E

441# the array a table's key holds, an absent key holding none, or nothing when
442# the key holds something else
443def array(rows: List<&2, E.Val>, +key: String) -> Maybe<&2, List<&2, String>>:
444  match rows:
445    case []:
446      Some{[]}
447    case E.VPair{+name, val} <> tl:
448      array.at(String.eq(name, key), val, array(tl, key))
449    case _hd <> tl:
450      array(tl, key)

Uses (6)

Used by (1)