We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d0e1e3 commit 98c5178Copy full SHA for 98c5178
src/Reject.hs
@@ -0,0 +1,6 @@
1
+module Reject (reject) where
2
+
3
+-- https://www.codewars.com/kata/52988f3f7edba9839c00037d/train/haskell
4
5
+reject :: (a -> Bool) -> [a] -> [a]
6
+reject predicate = filter (not . predicate)
test/RejectSpec.hs
@@ -0,0 +1,9 @@
+module RejectSpec (spec) where
+import Reject (reject)
+import Test.Hspec
+spec :: Spec
7
+spec = do
8
+ it "example test" $ do
9
+ reject even [1 .. 6] `shouldBe` [1, 3, 5]
0 commit comments