This repository has been archived on 2022-05-15. You can view files and clone it, but cannot push or open issues or pull requests.
Files
Kollokvium0307/Солкин Кирилл/README.md

19 lines
879 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Полезные комбинаторы
## Код из книги
#let mem x l = exists (fun y -> y = x) l;;
mem : a -> a list -> bool = <fun>
#let insert x l =
if mem x l then l else x::l;;
insert : a -> a list -> a list = <fun>
#let union l1 l2 = itlist insert l1 l2;;
union : a list -> a list -> a list = <fun>
#let setify l = union l [];;
setify : a list -> a list = <fun>
#let Union l = itlist union l [];;
Union : a list list -> a list = <fun>
#let intersect l1 l2 = filter (fun x -> mem x l2) l1;;
intersect : a list -> a list -> a list = <fun>
#let subtract l1 l2 = filter (fun x -> not mem x l2) l1;;
subtract : a list -> a list -> a list = <fun>
#let subset l1 l2 = forall (fun t -> mem t l2) l1;;
subset : a list -> a list -> bool = <fun>