Skip to content

Instantly share code, notes, and snippets.

@Lysxia
Created May 8, 2024 14:31
Show Gist options
  • Save Lysxia/9a1c67ee3f94d0336cbf0f2ea3c0cfe1 to your computer and use it in GitHub Desktop.
Save Lysxia/9a1c67ee3f94d0336cbf0f2ea3c0cfe1 to your computer and use it in GitHub Desktop.
From Coq Require Import List.
Fixpoint map_In {A B : Type} (xs : list A) : (forall x, In x xs -> B) -> list B :=
match xs return (forall x, In x xs -> B) -> list B with
| nil => fun _ => nil
| cons x xs' => fun f => cons (f x (or_introl eq_refl)) (map_In xs' (fun x' In_x'_xs' => f x' (or_intror In_x'_xs')))
end.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment