y) → p (b, a) (y, x) swapping = dimap swap swap assoc :: Profunctor p => p ((a, b), c) ((x, y), z) → → p (a, (b, c)) (x, (y, z)) assoc = dimap (\(a, (b, c)) → ((a, b), c)) (\((a, b), c) → (a, (b, c))) -- Try composing these: swapping ◦ swapping :: Profunctor p => p (a, b) (x, y) → p (a, b) (x, y) assoc ◦ swapping :: Profunctor p => p (a, (b, c)) (x, (y, z)) → p (b, (c, a)) (y, (z, x))