i) => board[i] - > Belt.Option.isSome; // (array('a), int, 'a) => array('a) let update = (board, pos, turn) => board -> Belt.Array.mapWithIndex((i, x) => i == pos ? turn : x); // (array('a), 'a) => bool let isWon = (board, turn) = > { won -> Belt.Array.map(row = > { let (c1, c2, c3) = row; [ | c1, c2, c3 |]-> Belt.Array.every(c = > board[c] == turn); }) -> Belt.Array.some(Fun.id); };