Can someone explain type unification in Haskell? For example: snd . snd :: (a1, (a2, c)) -> c
How do we get to, (a1, (a2, c)) -> c, from snd . snd?
Thanks in advance for the help.
Can someone explain type unification in Haskell? For example: snd . snd :: (a1, (a2, c)) -> c
How do we get to, (a1, (a2, c)) -> c, from snd . snd?
Thanks in advance for the help.
Start with
Applying
(.)tosnd, with the following pairingsyields
Now applying this to
sndagain with the following pairingsyields
This obscures where
y1comes from. But since~is symmetric, we can replacey2with(x1, y1)to yieldwhich is equivalent to
(a1, (a2, c)) -> cup to alpha renaming.