foo (bar (baz (qux (quux (do a <- b; return a)))))
Using function composition:
(foo . bar . baz . qux . quux) (do a <- b; return a)
(foo . bar . baz . qux . quux) do
a <- b
return a
Here's why I like the proposed extension, especially in a world without $. It is because it enables intuitive multiline Haskell code with significant white space rather than parens.
foo (bar baz) (qux quux) (do
a <- b
return a) -- ugh this close paren
foo (bar baz) (qux quux) do
a <- b
return a
-- much nicer, "do" feels like the comparable Ruby keyword
The usage of $ to accomplish this is a hack that Haskellers have gotten very accustomed to. It frequently trips up the uninitiated. It requires a hack in the compiler when used with ST blocks.
On Tuesday, September 8, 2015, Alexey Vagarenko <
vagarenko@gmail.com> wrote:
Consider this.
If we didn't have $ operator in the first place, we'd use parentheses everywhere:
foo (bar (baz (qux (quux (do a <- b; return a)))))
under your proposal it turns to:
foo (bar (baz (qux (quux do a <- b; return a))))
another example:
foo (bar baz) (qux quux) (do a <- b; return a)
turns to :
foo (bar baz) (qux quux) do a <- b; return a
with lambdas:
foo (bar baz) (qux quux) (\x -> x)
to:
foo (bar baz) (qux quux) \x -> x
Can't you see your proposal makes things less consistent, not more?
-1.
--
-- Dan Burton