summaryrefslogtreecommitdiffstats
path: root/Scala/funsets/src/main
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-04-10 00:08:19 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2016-11-10 18:03:23 +0100
commite2c8e84d0243f6b672f21c8b6281cbef61b8b760 (patch)
tree6fb0b528435c7b399e65cfbfb651be7fc5baac10 /Scala/funsets/src/main
parentc5f1113df8159078ac3bfb6fbe8426db72248512 (diff)
downloadcoursera-e2c8e84d0243f6b672f21c8b6281cbef61b8b760.zip
coursera-e2c8e84d0243f6b672f21c8b6281cbef61b8b760.tar.gz
Scala : week2: implement filter
Diffstat (limited to 'Scala/funsets/src/main')
-rw-r--r--Scala/funsets/src/main/scala/funsets/FunSets.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/Scala/funsets/src/main/scala/funsets/FunSets.scala b/Scala/funsets/src/main/scala/funsets/FunSets.scala
index 1fd2d31..8b7778d 100644
--- a/Scala/funsets/src/main/scala/funsets/FunSets.scala
+++ b/Scala/funsets/src/main/scala/funsets/FunSets.scala
@@ -43,7 +43,7 @@ object FunSets {
/**
* Returns the subset of `s` for which `p` holds.
*/
- def filter(s: Set, p: Int => Boolean): Set = ???
+ def filter(s: Set, p: Int => Boolean): Set = (x => s(x) & p(x))
/**
* The bounds for `forall` and `exists` are +/- 1000.