module Foo.Bar where import Control.Monad.State import Test.QuickCheck countAtEven [] = return () countAtEven (x:xs) = do when (even 2) $ modify (\s -> s + 1) countAtOdd xs countAtOdd [] = return () countAtOdd (x:xs) = do when (odd 2) $ modify (\s -> s + 1) countAtEven xs count l = runState (countAtOdd l) 0 rotate n l = take (length l) . drop n . cycle $ l t = quickCheck (\l -> (count l) == (count $ rotate 2 (l :: [Int])))