(module option (export some_i32 none_i32 is_some_i32 is_none_i32 unwrap_some_i32 unwrap_or_i32 some_or_err_i32 some_u32 none_u32 is_some_u32 is_none_u32 unwrap_some_u32 unwrap_or_u32 some_or_err_u32 some_i64 none_i64 is_some_i64 is_none_i64 unwrap_some_i64 unwrap_or_i64 some_or_err_i64 some_u64 none_u64 is_some_u64 is_none_u64 unwrap_some_u64 unwrap_or_u64 some_or_err_u64 some_f64 none_f64 is_some_f64 is_none_f64 unwrap_some_f64 unwrap_or_f64 some_or_err_f64 some_bool none_bool is_some_bool is_none_bool unwrap_some_bool unwrap_or_bool some_or_err_bool some_string none_string is_some_string is_none_string unwrap_some_string unwrap_or_string some_or_err_string))

(fn some_i32 ((value i32)) -> (option i32)
  (some i32 value))

(fn none_i32 () -> (option i32)
  (none i32))

(fn is_some_i32 ((value (option i32))) -> bool
  (is_some value))

(fn is_none_i32 ((value (option i32))) -> bool
  (is_none value))

(fn unwrap_some_i32 ((value (option i32))) -> i32
  (unwrap_some value))

(fn unwrap_or_i32 ((value (option i32)) (fallback i32)) -> i32
  (if (is_some value)
    (unwrap_some value)
    fallback))

(fn some_or_err_i32 ((value (option i32)) (err_code i32)) -> (result i32 i32)
  (if (is_some value)
    (ok i32 i32 (unwrap_some value))
    (err i32 i32 err_code)))

(fn some_u32 ((value u32)) -> (option u32)
  (some u32 value))

(fn none_u32 () -> (option u32)
  (none u32))

(fn is_some_u32 ((value (option u32))) -> bool
  (is_some value))

(fn is_none_u32 ((value (option u32))) -> bool
  (is_none value))

(fn unwrap_some_u32 ((value (option u32))) -> u32
  (unwrap_some value))

(fn unwrap_or_u32 ((value (option u32)) (fallback u32)) -> u32
  (if (is_some value)
    (unwrap_some value)
    fallback))

(fn some_or_err_u32 ((value (option u32)) (err_code i32)) -> (result u32 i32)
  (if (is_some value)
    (ok u32 i32 (unwrap_some value))
    (err u32 i32 err_code)))

(fn some_i64 ((value i64)) -> (option i64)
  (some i64 value))

(fn none_i64 () -> (option i64)
  (none i64))

(fn is_some_i64 ((value (option i64))) -> bool
  (is_some value))

(fn is_none_i64 ((value (option i64))) -> bool
  (is_none value))

(fn unwrap_some_i64 ((value (option i64))) -> i64
  (unwrap_some value))

(fn unwrap_or_i64 ((value (option i64)) (fallback i64)) -> i64
  (if (is_some value)
    (unwrap_some value)
    fallback))

(fn some_or_err_i64 ((value (option i64)) (err_code i32)) -> (result i64 i32)
  (if (is_some value)
    (ok i64 i32 (unwrap_some value))
    (err i64 i32 err_code)))

(fn some_u64 ((value u64)) -> (option u64)
  (some u64 value))

(fn none_u64 () -> (option u64)
  (none u64))

(fn is_some_u64 ((value (option u64))) -> bool
  (is_some value))

(fn is_none_u64 ((value (option u64))) -> bool
  (is_none value))

(fn unwrap_some_u64 ((value (option u64))) -> u64
  (unwrap_some value))

(fn unwrap_or_u64 ((value (option u64)) (fallback u64)) -> u64
  (if (is_some value)
    (unwrap_some value)
    fallback))

(fn some_or_err_u64 ((value (option u64)) (err_code i32)) -> (result u64 i32)
  (if (is_some value)
    (ok u64 i32 (unwrap_some value))
    (err u64 i32 err_code)))

(fn some_f64 ((value f64)) -> (option f64)
  (some f64 value))

(fn none_f64 () -> (option f64)
  (none f64))

(fn is_some_f64 ((value (option f64))) -> bool
  (is_some value))

(fn is_none_f64 ((value (option f64))) -> bool
  (is_none value))

(fn unwrap_some_f64 ((value (option f64))) -> f64
  (unwrap_some value))

(fn unwrap_or_f64 ((value (option f64)) (fallback f64)) -> f64
  (if (is_some value)
    (unwrap_some value)
    fallback))

(fn some_or_err_f64 ((value (option f64)) (err_code i32)) -> (result f64 i32)
  (if (is_some value)
    (ok f64 i32 (unwrap_some value))
    (err f64 i32 err_code)))

(fn some_bool ((value bool)) -> (option bool)
  (some bool value))

(fn none_bool () -> (option bool)
  (none bool))

(fn is_some_bool ((value (option bool))) -> bool
  (is_some value))

(fn is_none_bool ((value (option bool))) -> bool
  (is_none value))

(fn unwrap_some_bool ((value (option bool))) -> bool
  (unwrap_some value))

(fn unwrap_or_bool ((value (option bool)) (fallback bool)) -> bool
  (if (is_some value)
    (unwrap_some value)
    fallback))

(fn some_or_err_bool ((value (option bool)) (err_code i32)) -> (result bool i32)
  (if (is_some value)
    (ok bool i32 (unwrap_some value))
    (err bool i32 err_code)))

(fn some_string ((value string)) -> (option string)
  (some string value))

(fn none_string () -> (option string)
  (none string))

(fn is_some_string ((value (option string))) -> bool
  (is_some value))

(fn is_none_string ((value (option string))) -> bool
  (is_none value))

(fn unwrap_some_string ((value (option string))) -> string
  (unwrap_some value))

(fn unwrap_or_string ((value (option string)) (fallback string)) -> string
  (if (is_some value)
    (unwrap_some value)
    fallback))

(fn some_or_err_string ((value (option string)) (err_code i32)) -> (result string i32)
  (if (is_some value)
    (ok string i32 (unwrap_some value))
    (err string i32 err_code)))
