-- I guess in Haskell should already exist a way to do it,
-- but I don't know it

-- | Preserves an argument and returns it, tupled with function's result
--
-- > preservingArg id x == (x, x)
preservingArg :: (a -> b) -> a -> (a, b)
preservingArg f a = (a, f a)
preservingArg :: (a -> b) -> a -> (a, b)
preservingArg f a = (a, f a)
preservingArg f a = (a, f a)