mv lab 07 to 06

This commit is contained in:
SowinskiBraeden committed 2026-03-12 11:55:15 -07:00
1 parent efad305d7b
commit b5b591de77
6 files changed
+136

No files matched your search

+18
View File
@@ -0,0 +1,18 @@
let return x = [x]
let ( >>= ) l f = List.concat_map f l
let gaurd cond l =
if cond then l else []
let multiply_to n =
List.init n ((+) 1) >>= fun x ->
List.init n ((+) 1) >>= fun y ->
gaurd (x * y = n) [(x, y)]
let ( let* ) = ( >>= )
let multiply_to' n =
let* x = List.init n ((+) 1) in
let* y = List.init n ((+) 1) in
if x * y = n then [(x, y)] else []