Hacker News new | ask | show | jobs
by dismalaf 304 days ago
In Haskell there's also dot (edit - my bad, not dot, pipe) syntax which allows composing functions left to right. I believe Nim also has it. Just as a few more examples.
2 comments

f . g is still doing g first, then f, right? Haskell has pipelines in the Flow library.

https://hackage-content.haskell.org/package/flow-2.0.0.9/doc...

No need to import a third party library: you can use `Data.Function ((&))` for this:

    arg
     & f1
     & f2
     & f3
Ooops my bad. Been too long.
I don’t think that’s correct. The dot operator is composition with the same semantics as when using normal math notation.

   (f . g) x
is equivalent to

   f (g x)