(defconst nums [4 i32] [4 8 15 16]) ;; `some` unwraps Some and early-returns None from *this* function. (defn doubled-first [s [i32]] (Option i32) (Some (* 2 (some (index-of-i32 s 15))))) (defn main [] (match (doubled-first (slice nums 0 4)) (Some i) (do (print-i64 (i64 i)) (newline)) ; 4 None (print-line "not found")) (match (index-of-i32 (slice nums 0 4) 99) (Some i) (do (print-i64 (i64 i)) (newline)) None (print-line "not found")))