scalie/test/Test/QuickCheck/Roundtrip.hs

7 lines
233 B
Haskell

{-# LANGUAGE Safe #-}
module Test.QuickCheck.Roundtrip (roundtrips) where
import Data.Eq ((==), Eq)
import Data.Bool (Bool)
roundtrips :: Eq t1 => (t2 -> t1) -> (t1 -> t2) -> t1 -> Bool
roundtrips back forth x = x == back (forth x)