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

Michael Orlitzky michael at orlitzky.com
Mon Feb 8 17:59:29 UTC 2016


On 02/08/2016 12:15 PM, Joachim Durchholz wrote:
> 
> 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.

I don't think anyone was seriously suggesting getting rid of "f x" for
function application. Rustom's post is interesting because it suggests
that if you're going to have only one of "f x" or "f $ x", then it
should be the latter. It's a fun thought experiment.

Since we're stuck with "f x", the question is: do we want *both* as
syntax? If most uses of "$" are for,

  putStrLn $ "Hello" ++ " world!"

to avoid,

  putStrLn ("Hello" ++ " world!")

then I think it's silly to worry about the type of "$". Most people
don't have to know, care, or use it -- the second example is much
clearer. And if instead you're doing some kind of fmap (((f $) $) $)
gymnastics, then you probably don't mind the type of "$".



More information about the Haskell-Cafe mailing list