AV
Size: a a a
AV
IC
AV
AV
DB
AV
оГ
оГ
DB
оГ
AV
AV
DB
let getOperands (expr:string) =
let parsed = expr.Split(' ') |> Array.map parseOperand
let hasErrors = parsed |> Array.mapi (fun i y -> match y with | Ok _ -> None |Error e -> e) |> Array.choose id
if hasErrors |> Array.isEmpty then
parsed |> Array.map (fun x -> match x with | Ok v -> v) |> Result.Ok
else
Array.head hasErrors |> Result.Error
DB
AV
I
DB
DB