(** THIS FILE WAS AUTOMATICALLY GENERATED BY AENEAS *)
(** [polonius_list] *)
Require Import Primitives.
Import Primitives.
Require Import Coq.ZArith.ZArith.
Require Import List.
Import ListNotations.
Local Open Scope Primitives_scope.
Module PoloniusList.

(** [polonius_list::List]
    Source: 'tests/src/polonius_list.rs', lines 5:0-8:1
    Visibility: public *)
Inductive List_t (T : Type) :=
| List_Cons : T -> List_t T -> List_t T
| List_Nil : List_t T
.

Arguments List_Cons { _ }.
Arguments List_Nil { _ }.

(** [polonius_list::get_list_at_x]:
    Source: 'tests/src/polonius_list.rs', lines 15:0-29:1
    Visibility: public *)
Fixpoint get_list_at_x
  (ls : List_t u32) (x : u32) :
  result ((List_t u32) * (List_t u32 -> List_t u32))
  :=
  match ls with
  | List_Cons hd tl =>
    if hd s= x
    then Ok (ls, fun (ls1 : List_t u32) => ls1)
    else (
      p <- get_list_at_x tl x;
      let (l, get_list_at_x_back) := p in
      let back :=
        fun (l1 : List_t u32) =>
          let tl1 := get_list_at_x_back l1 in List_Cons hd tl1
      in
      Ok (l, back))
  | List_Nil => Ok (List_Nil, fun (ls1 : List_t u32) => ls1)
  end
.

End PoloniusList.
