Forall and Exists in Scala
def forall(s: Set, p: Int => Boolean): Boolean = { def iter(a: Int): Boolean = { if (contains(s, a) && !p(a)) false // If the predicate »
def forall(s: Set, p: Int => Boolean): Boolean = { def iter(a: Int): Boolean = { if (contains(s, a) && !p(a)) false // If the predicate »
Material: https://class.coursera.org/progfun-005/ A type is basically an alias. It allows for neater code, and simplified readability. Since we can have function types, »