module Identity where import Test.QuickCheck import Test.QuickCheck.Checkers newtype Identity a = Identity a deriving (Eq, Ord, Show) instance Functor Identity where fmap f (Identity x) = Identity $ f x instance Applicative Identity where pure = Identity (Identity f) <*> x = fmap f x instance Monad Identity where return = pure (Identity x) >>= f = f x instance Arbitrary a => Arbitrary (Identity a) where arbitrary = fmap Identity $ arbitrary instance Eq a => EqProp (Identity a) where (=-=) = eq