Equations
- Chapter2.fib 0 = 1
- Chapter2.fib 1 = 1
- Chapter2.fib n.succ.succ = Chapter2.fib (n + 1) + Chapter2.fib n
Instances For
Equations
- Chapter2.fibFast n = (Chapter2.fibFast.loop n).2
Instances For
Equations
- Chapter2.fibFast.loop 0 = (0, 1)
- Chapter2.fibFast.loop n.succ = ((Chapter2.fibFast.loop n).2, (Chapter2.fibFast.loop n).1 + (Chapter2.fibFast.loop n).2)
Instances For
Equations
- Chapter2.append' [] x✝ = pure x✝
- Chapter2.append' (x_2 :: xs) x✝ = do Cslib.Algorithms.Lean.TimeM.tick 1 let __do_lift ← Chapter2.append' xs x✝ pure (x_2 :: __do_lift)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Chapter2.concat₁'' [] = pure []
- Chapter2.concat₁'' (xs :: xss) = do let res ← Chapter2.concat₁'' xss Cslib.Algorithms.Lean.TimeM.tick xs.length pure (xs ++ res)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
def
Chapter2.concat₂''
{a : Type u_1}
:
List (List a) → Cslib.Algorithms.Lean.TimeM ℕ (List a) → Cslib.Algorithms.Lean.TimeM ℕ (List a)
Equations
- Chapter2.concat₂'' [] x✝ = x✝
- Chapter2.concat₂'' (xs :: xss) x✝ = do let res ← x✝ Chapter2.concat₂'' xss do Cslib.Algorithms.Lean.TimeM.tick res.length pure (res ++ xs)
Instances For
Equations
Instances For
Equations
- Chapter2.build.insert p x xs = x :: Chapter1.dropWhile (p x) xs
Instances For
Equations
- Chapter2.iterate 0 x✝¹ x✝ = [x✝]
- Chapter2.iterate n.succ x✝¹ x✝ = x✝ :: Chapter2.iterate n x✝¹ (x✝¹ x✝)
Instances For
Equations
Instances For
Equations
- Chapter2.init₀ [] = panicWithPosWithDecl "Fad.Chapter2" "Chapter2.init₀" 176 13 "no elements"
- Chapter2.init₀ [head] = []
- Chapter2.init₀ (x_1 :: xs) = x_1 :: Chapter2.init₀ xs
Instances For
Equations
- Chapter2.init₂ [] = none
- Chapter2.init₂ [head] = some []
- Chapter2.init₂ (x_1 :: xs) = do let ys ← Chapter2.init₂ xs pure (x_1 :: ys)
Instances For
Equations
- Chapter2.prune p xs = List.foldr (Chapter2.prune.cut p) [] xs
Instances For
Equations
- Chapter2.prune.cut p x xs = Chapter1.until' (Chapter2.prune.done p) Chapter2.init₀ (x :: xs)