(* Generated by coq-of-rust *)
Require Import CoqOfRust.CoqOfRust.

(*
fn main() {
    "12".parse::<i32>();
    "true".parse::<bool>();
    "unparsable".parse::<u32>();
}
*)
Definition main (ε : list Value.t) (τ : list Ty.t) (α : list Value.t) : M :=
  match ε, τ, α with
  | [], [], [] =>
    ltac:(M.monadic
      (M.read (|
        let~ _ :=
          M.alloc (|
            M.call_closure (|
              M.get_associated_function (| Ty.path "str", "parse", [ Ty.path "i32" ] |),
              [ M.read (| Value.String "12" |) ]
            |)
          |) in
        let~ _ :=
          M.alloc (|
            M.call_closure (|
              M.get_associated_function (| Ty.path "str", "parse", [ Ty.path "bool" ] |),
              [ M.read (| Value.String "true" |) ]
            |)
          |) in
        let~ _ :=
          M.alloc (|
            M.call_closure (|
              M.get_associated_function (| Ty.path "str", "parse", [ Ty.path "u32" ] |),
              [ M.read (| Value.String "unparsable" |) ]
            |)
          |) in
        M.alloc (| Value.Tuple [] |)
      |)))
  | _, _, _ => M.impossible "wrong number of arguments"
  end.

Axiom Function_main : M.IsFunction "parsing_a_string::main" main.
