def nth_none

bend-collections-laws-math@1.0.0.0 · proofs/lib/list.bend:127

import bend-collections-laws-math@1.0.0.0/proofs/lib/list.bend as List
import Base
import bend-collections-laws-math@1.0.0.0/proofs/lib/logic.bend as L
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as SC

127def nth_none(-A: Data, +xs: List<&2, A>, +i: Nat, +h: {Nat.is_le(SC.length(A, xs), i) == True{} : Bool}) -> {SC.nth(A, xs, i) == None{} : Maybe<&2, A>}:
128  match xs i:
129    case Nil{} _:
130      {==}
131    case Con{x, t} 0n:
132      Empty.absurd({Some{x} == None{} : Maybe<&2, A>}, L.false_true(h))
133    case Con{x, +t} 1n+p:
134      nth_none(A, t, p, h)

Uses (9)

Used by (0)

No other definition uses this definition.