summaryrefslogtreecommitdiff
path: root/Reactor/Filtered.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Reactor/Filtered.hs')
-rw-r--r--Reactor/Filtered.hs14
1 files changed, 14 insertions, 0 deletions
diff --git a/Reactor/Filtered.hs b/Reactor/Filtered.hs
new file mode 100644
index 0000000..d106053
--- /dev/null
+++ b/Reactor/Filtered.hs
@@ -0,0 +1,14 @@
+module Reactor.Filtered where
+
+import Prelude hiding (filter)
+import qualified Prelude
+
+class Filtered f where
+ filter :: (a -> Bool) -> f a -> f a
+
+instance Filtered [] where
+ filter = Prelude.filter
+
+instance Filtered Maybe where
+ filter p m@(Just a) | p a = m
+ filter _ _ = Nothing