I have seen people do the same with their C code:
code it up in C, expose it using the ffi and use quickcheck to exercise it. It's not only Haskell that can be used this way. OCaml + ctypes is also an option.
Or of course, you can skip haskell and just use the python port <a href="https://pypi.python.org/pypi/pytest-quickcheck" rel="nofollow">https://pypi.python.org/pypi/pytest-quickcheck</a>
Neat, but there's a subtelty: at the end of the article, we only proved that square is error-free[0] when given an Int as input (because the haskell version of square is Int -> IO Int). But Python being loosely typed, I could call square on a float, and in this case nothing can be said of the python function.<p>Also, you have to make sure haskell's Ints and Python's Int are the same on your platform (one could be 32 bits and the other 64 bits).<p>[0] we did not prove anything, but just ran a bunch of tests, but you get the point.
You might also want to have a look at hypothesis:<p><a href="https://github.com/DRMacIver/hypothesis" rel="nofollow">https://github.com/DRMacIver/hypothesis</a><p><a href="http://hypothesis.readthedocs.org/en/master/" rel="nofollow">http://hypothesis.readthedocs.org/en/master/</a><p>It's a QuickCheck inspired python testing library with some interesting new ideas.
Neat trick using the FFI for this. Also, quickCheck like libraries are available in other languages e.g JUnit-QuickCheck for Java - <a href="https://blog.sourceclear.com/property-based-testing-for-java/" rel="nofollow">https://blog.sourceclear.com/property-based-testing-for-java...</a>