2

Although I often read that it is advisable to chain functions in the following manner:

f1 . f2 . f3 . f4 $ value

I find that I like the following chaining method better:

f1 $ f2 $ f3 $ f4 value

Other than the visual difference, is there a functional or performance difference between the two?

  • https://stackoverflow.com/questions/940382/haskell-difference-between-dot-and-dollar-sign – Jameson Nov 01 '15 at 07:26
  • I've closed this as a duplicate, although I'll (like last time this happened) point out that the top answer to the duplicate doesn't contain the reasoning that convinces *me* (see the answers by sclv and Antal Spector-Zabusky for that). – Ørjan Johansen Nov 01 '15 at 07:37
  • @ØrjanJohansen None of the answers in the "duplicate" say anything about functional or performance differences, which is what I'd like to know. They only talk about the difference in intention and in type. I can I can infer that the two are functionally and performance-wise equivalent. –  Nov 01 '15 at 07:44
  • Oh right. With GHC inlining, they should normally be compiled to the same thing. – Ørjan Johansen Nov 01 '15 at 09:03

0 Answers0