Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
-- Property is trivially convertible to Property
instance Testable Property where
property = id
-- Result is convertible to Property by creating
-- a generator that always return this same result
instance Testable Result where
property r = Property (Gen (const r))
-- Bool can be converted to Result
-- Result can be converted to a Property
-- By composition we get that Bool is convertible to Property
instance Testable Bool where
property = property . toResult where
toResult b = if b then Success
else Failure { seed = 0, counterExample = []}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment