In this question, the author has written an implementation of de Morgan's laws in Haskell. I understand the implementations of notAandnotB
, and notAornotB
, but I'm struggling to understand the implementation of notAorB
which is:
notAorB :: (Either a b -> c) -> (a -> c, b -> c)
notAorB f = (f . Left, f . Right)
Could someone explain how the (f . Left, f . Right)
part works? I've seen the .
operator used before, but with three arguments, not two.
Thank you in advance.