Saved Bookmarks
| 1. |
Explain What Is The Difference Between $ (dollar Sign) And . (dot) ? |
|
Answer» In Haskell, $ sign operator is used to avoid parenthesis, anything that appears after it will TAKE PRECEDENCE over anything that COMES before. For example, (putStrLn .SHOW) (1+1) can be replaced by putStrLn . show $ 1+1. While,. (dot) primary FUNCTION is to chain function and not to avoid parenthesis. In Haskell, $ sign operator is used to avoid parenthesis, anything that appears after it will take precedence over anything that comes before. For example, (putStrLn .show) (1+1) can be replaced by putStrLn . show $ 1+1. While,. (dot) primary function is to chain function and not to avoid parenthesis. |
|