Skip to main content

All Questions

0 votes
1 answer
247 views

Functor laws checking with QuickCheck-classes library

I want to check functor laws for instance: instance Functor Stream where fmap f (x :> xs) = (f x) :> fmap f xs where Stream is data Stream a = a :> Stream a I use QuickCheck.Classes (...
Alimagadov K.'s user avatar
3 votes
0 answers
323 views

Is it possible to quickcheck functor properties of the function type?

I am trying to implement my own functor instances and quickcheck them, and have run into issues on typeclasses which are not instances of Eq, namely (->) and IO. My attempts result in a No instance ...
mherzl's user avatar
  • 6,240
1 vote
1 answer
444 views

QuickChecking simple Functors: Is defining an Arbitrary instance necessary ? Why ? How?

I'm doing exercise with Functors and QuickCheck. I have a super simple Functor, whose composition law I wish to quickCheck. The Functor is simply an Identity a. This is the code I have so far: ...
Stephane Rolland's user avatar
0 votes
1 answer
681 views

QuickCheck Tests for Custom Type

With the following Algebraic Data Type: data Cons a = Cons a (Cons a) | Empty deriving (Show, Eq) I wrote an instance of Arbitrary: My understanding is that it's necessary to create an instance of ...
Kevin Meredith's user avatar
9 votes
3 answers
410 views

What is the general case of QuickCheck's promote function?

What is the general term for a functor with a structure resembling QuickCheck's promote function, i.e., a function of the form: promote :: (a -> f b) -> f (a -> b) (this is the inverse of ...
Jonathan Cast's user avatar