RevRev.curry 434 Bytes
Newer Older
Michael Hanus 's avatar
Michael Hanus committed
1
import Test.Prop
2 3 4 5 6 7 8

revrev :: [a] -> [a]
revrev xs = reverse (reverse xs)

-- Test: is double reverse equivalent to the identity?
-- This is not the case if both are applied to the context
--     head (... (1:failed))
9 10 11 12 13

-- Equivalence falsified by 13th test:
revrevid = revrev <=> id

-- Equivalence falsified by 3rd test:
14
revrevid'TERMINATE = revrev <=> id
15 16 17

-- Ground equivalence not falsified:
revrevid'GROUND xs = revrev xs <~> id xs