Library HoTT.Types.Option
Option types
Definition functor_option {A B} (f : A → B) (x : option A) : option B :=
match x with
| None ⇒ None
| Some a ⇒ Some (f a)
end.
match x with
| None ⇒ None
| Some a ⇒ Some (f a)
end.
The Some constructor is injective.