[Haskell-beginners] the ($) function (was desugaring an example
john.hartnup at gmail.com
Mon Feb 23 14:21:06 EST 2009
I had exactly the same confusion - not explaining ($) in RWH was major
dropped ball IMO.
> bogusTransfer qty fromBal toBal = do
> fromQty <- atomically $ readTVar fromBal
... is equivalent to:
bogusTransfer qty fromBal toBal = do
fromQty <- atomically ( readTVar fromBal
... so using ($) prevents accumulating a great big set of parentheses
to close at the end of a long block.
"There is no way to peace; peace is the way"
More information about the Beginners