summaryrefslogtreecommitdiff
path: root/Haskell-book/18/Instance/src/Nope.hs
blob: 9a7fea1793dcf840ea5445739dc790ca413096f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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