News for hackers. Stuff that matters.
Re:Application-as-a-Function Thinking by mpweiher on Sunday October 16, 2022 @02:48PM (#33226113)
That's exactly my point.

Sure, it is possible to model these things as functions, for example by "passing" the entire world as a "parameter". However, it is an extremely contrived modelling, basically you're hammering the square problem domain into the round function hole with the biggest hammer you can find until it "fits".

It is also possible to model these things as Turing machines, or NAND gates...

Re:Application-as-a-Function Thinking by WJW on Monday October 17, 2022 @04:41AM (#33231110)
The "app-as-function" has some very concrete applications though, even outside languages like Haskell. The [rack-test](https://github.com/rack/rack-test) gem (and similar languages) work exactly like this: they run the "app" part without the "web server" part to enable much easier testing. Rack middlewares similarly treat the enclosed app as just a function taking some specified input and returning some output value.