Equations
- Chapter7.minimumBy cmp [] = none
- Chapter7.minimumBy cmp (x_1 :: xs) = some (List.foldr (fun (y r : α) => bif decide (cmp y r = Ordering.lt) then y else r) x_1 xs)
Instances For
Equations
- Chapter7.minWith₁ f xs = Chapter7.minimumBy (fun (x y : α) => compare (f x) (f y)) xs
Instances For
Equations
- Chapter7.instOrdFloat_fad = { compare := fun (x y : Float) => if x < y then Ordering.lt else if (x == y) = true then Ordering.eq else Ordering.gt }
Equations
- Chapter7.minsWith'.tuple f x = (f x, x)
Instances For
Equations
- Chapter7.cp xs ys = Chapter1.concatMap (fun (x : α) => List.map (fun (y : β) => (x, y)) ys) xs
Instances For
Equations
Equations
- Chapter7.S73.mktuples' [1] x✝ = [[x✝]]
- Chapter7.S73.mktuples' [] x✝ = panicWithPosWithDecl "Fad.«Chapter7-Ex»" "Chapter7.S73.mktuples'" 160 18 "mktuples: invalid empty list"
- Chapter7.S73.mktuples' (d :: ds) x✝ = List.flatMap (fun (c : ℕ) => List.map (fun (cs : List ℕ) => c :: cs) (Chapter7.mktuples₀ ds (x✝ - c * d))) (List.range (x✝ / d + 1))