quickcheck-properties-0.1: QuickCheck properties for standard type classes.

Safe HaskellSafe
LanguageHaskell98

Test.QuickCheck.Property.Functor

Description

Functor laws

fmap id = id
fmap f . fmap g = fmap (f . g)

Synopsis

Documentation

prop_FunctorId :: Functor f => T (f a) -> f a -> Equal (f a) #

fmap id = id

prop_FunctorCompose #

Arguments

:: Functor f 
=> (a -> b)

f

-> (b -> c)

g

-> T (f a) 
-> f a 
-> Equal (f c) 

It's not possible to generate arbitrary functions. Therefore they are passed as arguments.