Documentation

Std.Data.List.Init.Attach

def List.pmap {α : Type u_1} {β : Type u_2} {p : αProp} (f : (a : α) → p aβ) (l : List α) :
(∀ (a : α), a lp a)List β

Partial map. If f : Π a, p a → β is a partial function defined on a : α satisfying p, then pmap f l h is essentially the same as map f l but is defined only when all members of l satisfy p, using the proof to apply f.

Equations
Instances For
    @[implemented_by _private.Std.Data.List.Init.Attach.0.List.attachImpl]
    def List.attach {α : Type u_1} (l : List α) :
    List { x : α // x l }

    "Attach" the proof that the elements of l are in l to produce a new list with the same elements but in the type {x // x ∈ l}.

    Equations
    Instances For