[Haskell-cafe] Usage of . and $

Dougal Stanton ithika at gmail.com
Wed Mar 7 11:58:05 EST 2007

Quoth Steve Schafer, nevermore,
> Parentheses require you to maintain a mental general-purpose push-down
> stack as you read the code. $, on the other hand, while it also requires
> you to maintain a sort of stack, it's a "monotonic" stack: you may need
> to push an arbitrary number of items, but you don't pop anything until
> you reach the end of the code. So the mental model required to read code
> containing $'s is simpler than that required for parentheses.

Which is the longer way of saying you don't need to count to make sure
you closed all the brackets you opened! ;-)

Dougal Stanton

More information about the Haskell-Cafe mailing list