I have the following code
fastShuffle :: [a] -> IO [a]
fastShuffle a = <some code>
prop_fastShuffle_correct :: [Int] -> Property
prop_fastShuffle_correct s =
monadicIO ( do
sh <- run (fastShuffle s)
return ( True ==> ( insertionSort sh == insertionSort s &&
if length s > 10
then s /= sh
else True ) ) )
And .. it is working. I can't understand how what looks to be a pure function (prop_fastShuffle_correct) can call a non pure function that has side effects (fastShuffle).
Hope that someone can explain.
Thanks!