Background: I don't understand ~ and am requesting a use case.
Given:
{-# LANGUAGE GADTs #-}
f :: a ~ b => a -> b -> b
f a b = a
g :: a -> a -> a
g a b = a
It seems to me that both functions are equal:
Prelude> :r
[1 of 1] Compiling Main ( TypeEq.hs, interpreted )
Ok, modules loaded: Main.
*Main> f 10 20
10
*Main> g 10 20
10
Under what circumstances would it be useful to use f
over g
?