In GHCi, the kind of FUN is displayed like this:
λ> :k FUN
FUN :: forall (n :: Multiplicity) -> * -> * -> *
At first, I thought this was a roundabout way of saying
FUN :: Multiplicity -> * -> * -> *
but it turns out Template Haskell has a separate constructor for this form: ForallVisT. I can't find any documentation on it, and I have no idea how to even begin experimenting with it in a meaningful way.
What does this syntax mean? How does forall a -> b differ from a "normal" forall a. a -> b?
forall a -> _is used when the result type depends on an explicit argument.It is odd that
FUN's type hasforall (m :: Multiplicity) ->and notMultiplicity ->as the following arguments (two implicitRuntimeReps and twoTYPEs) do not depend on it, but such is the weirdness that surrounds GHC primitives.