import Test.QuickCheck
import Data.List

myEncode :: Eq a => [a] -> [(Int, a)]
myEncode xs = [(length x, head x) | x <- group xs]

testMyEncode :: [Char] -> Bool
testMyEncode x =
	(myEncode x == (map (\xs -> (length xs, head xs)) . group $ x)) &&
	((length . myEncode $ x) == (length . group $ x))

main = quickCheck testMyEncode
