Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object SetPackage {
- val (MIN_RANGE, MAX_RANGE) = (-1000, 1000)
- type Set[A] = A => Boolean
- def contains[A](s: Set[A], x: Int): Boolean
- def union[A](s1: Set[A], s2: Set[A]): Set[A]
- def intersection[A](s1: Set[A], s2: Set[A]): Set[A]
- def forall[A](s: Set[A], p: A => Boolean): Boolean
- def exists[A](s: Set[A], p: A => Boolean): Boolean
- def partition[A](s: Set[A], p: A => Boolean): (Set[A], Set[B])
- def take[A](s: Set[A], n: Int): Set[A]
- def takeWhile[A](s: Set[A], p: A => Boolean): Set[A]
- def drop[A](s: Set[A], n: Int): Set[A]
- def dropWhile[A](s: Set[A], p: A => Boolean): Set[A]
- def filter[A](s: Set[A], p: Int => Boolean): Set[A]
- def map[A, B](s: Set[A], f: A => B): Set[B]
- def flatten[A](s: Set[Set[A]]): Set[A]
- def apply[A, B](f: Set[A => B], s: Set[A]): Set[B]
- def bind[A, B](s: Set[A], f: A => Set[B]): Set[B]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement