Open Seasawher opened 3 weeks ago
def NonemptyList (α : Type) := { xs : List α // xs.length > 0} def head {α : Type} (xs : NonemptyList α) : α := match xs with -- パターンマッチが省略できる(Lean が賢いから) | ⟨x :: _xs, _⟩ => x