Documentation
Mathlib
.
Init
.
Data
.
List
.
Instances
Search
Google site search
return to top
source
Imports
Init
Mathlib.Mathport.Rename
Imported by
List
.
bind_singleton
List
.
bind_singleton'
List
.
map_eq_bind
List
.
bind_assoc
List
.
instMonad
List
.
pure_def
List
.
instLawfulMonad
List
.
instAlternative
Decidable and Monad instances for
List
not (yet) in
Batteries
#
source
theorem
List
.
bind_singleton
{α :
Type
u}
{β :
Type
v}
(f :
α
→
List
β
)
(x :
α
)
:
[
x
]
.bind
f
=
f
x
source
@[simp]
theorem
List
.
bind_singleton'
{α :
Type
u}
(l :
List
α
)
:
(
l
.bind
fun (
x
:
α
) =>
[
x
]
)
=
l
source
theorem
List
.
map_eq_bind
{α :
Type
u_1}
{β :
Type
u_2}
(f :
α
→
β
)
(l :
List
α
)
:
List.map
f
l
=
l
.bind
fun (
x
:
α
) =>
[
f
x
]
source
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
source
instance
List
.
instMonad
:
Monad
List
Equations
List.instMonad
=
Monad.mk
source
@[simp]
theorem
List
.
pure_def
{α :
Type
u}
(a :
α
)
:
pure
a
=
[
a
]
source
instance
List
.
instLawfulMonad
:
LawfulMonad
List
Equations
List.instLawfulMonad
=
⋯
source
instance
List
.
instAlternative
:
Alternative
List
Equations
List.instAlternative
=
Alternative.mk
@
List.nil
fun {
α
:
Type
u} (
l
:
List
α
) (
l'
:
Unit
→
List
α
) =>
l
.append
(
l'
()
)