I tried this:
type TestT = Either Int Float testM :: (a -> a) -> TestT -> TestT testM f (Left x) = Left (f x) testM f (Right x) = Right (f x)