Documentation

Mathlib.Init.Data.List.Instances

Decidable and Monad instances for List not (yet) in Batteries #

theorem List.bind_singleton {α : Type u} {β : Type v} (f : αList β) (x : α) :
[x].bind f = f x
@[simp]
theorem List.bind_singleton' {α : Type u} (l : List α) :
(l.bind fun (x : α) => [x]) = l
theorem List.map_eq_bind {α : Type u_1} {β : Type u_2} (f : αβ) (l : List α) :
List.map f l = l.bind fun (x : α) => [f x]
theorem List.bind_assoc {γ : Type w} {α : Type u_1} {β : Type u_2} (l : List α) (f : αList β) (g : βList γ) :
(l.bind f).bind g = l.bind fun (x : α) => (f x).bind g
Equations
@[simp]
theorem List.pure_def {α : Type u} (a : α) :
pure a = [a]
Equations