[Haskell-cafe] Language complexity & beginners (Was: New type of ($) operator in GHC 8.0 is problematic)

Joachim Durchholz jo at durchholz.org
Mon Feb 8 17:15:14 UTC 2016


Am 08.02.2016 um 17:56 schrieb Michael Orlitzky:
> On 02/08/2016 11:45 AM, Joachim Durchholz wrote:
>> Am 08.02.2016 um 17:32 schrieb Michael Orlitzky:
>>> The suggestion in the PDF is basically to drop the "f x" syntax and
>>> always use "f $ x" which has a lot of merit if you rename "$" to
>>> something less ugly and more obvious.
>>
>> I'm wondering what the merit would be.
>
> By making "f $ x" or more generally "f $" syntax, we avoid the very
> issue that sparked this thread (that's what wren suggested...).

Wouldn't the type of function application be independent of its syntax?

 > We also
> no longer need the voodoo hacks for things like runST.

I can't comment on runST (my Haskell knowledge is really basic). But if 
there's a problem because juxtaposition has no representation as an 
operator symbol or function name, it should be easier to fix the 
syntactic problem than to rewrite the type system.
Of course, if the type system got warts because of the existence of 
juxtaposition, then that should be fixed.

 > It's less
> confusing for the parser and for students (explicit is better than
> implicit), etc.

Sure, but you don't make that an absolute.
Otherwise you'd have to remove operator precedence, too. And the end 
result would look like Lisp.

juxtaposition is so entrenched in almost all branches of math that using 
that implicitness to reduce syntactic overhead is a net win.


More information about the Haskell-Cafe mailing list