Use of forall as a sigil

Bryan Richter b at chreekat.net
Thu Dec 3 19:24:27 UTC 2020


Hm, yes, I might share Eric's intuition.


I think I'm starting to get it, though. It originally sounded to me like
"forall a ->" was being introduced as a new syntax for function arguments.
In fact, it is a new syntax for quantification -- one that happens to
borrow the syntax for function application. And well it might, because the
sort of quantification it introduces is one that requires passing the name
of a type to the function!


Den tors 3 dec. 2020 18:39Eric Seidel <eric at seidel.io> skrev:

> I think the confusion for me is that I've trained myself to think of
> `forall` as explicitly introducing an implicit argument, and `->`
> as introducing an explicit argument. So the syntax `forall a ->`
> looks to me like a contradiction.
>
> On Thu, Dec 3, 2020, at 10:56, Richard Eisenberg wrote:
> >
> >
> > > On Dec 3, 2020, at 10:23 AM, Bryan Richter <b at chreekat.net> wrote:
> > >
> > > Consider `forall a -> a -> a`. There's still an implicit universal
> quantification that is assumed, right?
> >
> > No, there isn't, and I think this is the central point of confusion. A
> > function of type `forall a -> a -> a` does work for all types `a`. So I
> > think the keyword is appropriate. The only difference is that we must
> > state what `a` is explicitly. I thus respectfully disagree
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20201203/d550d378/attachment.html>


More information about the ghc-devs mailing list