I've finished reading the Existential Types Wikibook, and it compares using forall with using lowercase letters for defining generic types. It then says that the true usefulness of forall is when you use it with a type class. That is, forall make your function work with lots of types that adhere to some type class.
Example:
data ShowBox = forall s. Show s => SB s
Well, I found a real worl usage:
spock :: forall conn sess st. SpockCfg conn sess st ->
SpockM conn sess st () -> IO Middleware
<Source>
and you can see here, in the source that it uses forall but with no type class constraint:
spock :: forall conn sess st. SpockCfg conn sess st ->
SpockM conn sess st () -> IO Wai.Middleware
spock spockCfg spockAppl =
do connectionPool <-
case poolOrConn of
PCNoDatabase ->
{- ... -}
I'm very new to Haskell and trying to understand forall.