nick8325 / quickcheck

Automatic testing of Haskell programs.
Other
713 stars 119 forks source link

Fun with lifted type #270

Closed BebeSparkelSparkel closed 4 years ago

BebeSparkelSparkel commented 4 years ago

Is is possible to used Fun with a lifted type like Proxy#?

Lysxia commented 4 years ago

A function Proxy# a -> r is the same as a value r, so you can generate an r directly.

BebeSparkelSparkel commented 4 years ago

I think I'm going to just stick with the traditional Data.Proxy.Proxy instead of Proxy#

Lysxia commented 4 years ago

A function myFunction :: (Proxy# a -> R) -> X that you want to test can be wrapped as a function R -> X:

myFunction' :: R -> X
myFunction' r = myFunction (\_ -> r)