aboutsummaryrefslogtreecommitdiff
path: root/Haskell-book/18/Instance/src/Nope.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Haskell-book/18/Instance/src/Nope.hs')
-rw-r--r--Haskell-book/18/Instance/src/Nope.hs23
1 files changed, 23 insertions, 0 deletions
diff --git a/Haskell-book/18/Instance/src/Nope.hs b/Haskell-book/18/Instance/src/Nope.hs
new file mode 100644
index 0000000..9a7fea1
--- /dev/null
+++ b/Haskell-book/18/Instance/src/Nope.hs
@@ -0,0 +1,23 @@
+module Nope where
+
+import Test.QuickCheck
+import Test.QuickCheck.Checkers
+
+data Nope a = NopeDotJpg deriving (Show, Eq)
+
+instance Functor Nope where
+ fmap _ _ = NopeDotJpg
+
+instance Applicative Nope where
+ pure _ = NopeDotJpg
+ _ <*> _ = NopeDotJpg
+
+instance Monad Nope where
+ return _ = NopeDotJpg
+ _ >>= _ = NopeDotJpg
+
+instance Arbitrary (Nope a) where
+ arbitrary = return NopeDotJpg
+
+instance EqProp (Nope a) where
+ (=-=) = eq