|
|
|
|
|
by dahart
3173 days ago
|
|
All inputs are serializable, including functions and types. We can already transmit language features without imports. If you compile your inputs into your program, what you're left with is a fancy constant. You might as well let the compiler take the final step of running the program for you and printing the output. If you think Dhall is great and more people should use it as their I/O library, that's awesome, maybe show some of the cool things it does. Motivating it's usage by trying to make I/O a functional vs imperative issue just seems really contrived, and mostly wrong and prone to argument. I/O isn't a functional issue, and it is one of the main reasons to write a program: to do some work parameterized over different inputs. |
|
However, Dhall does have the ability to normalize under lambda when possible so it will actually do this for you if it can! For example, if you try to interpret this program, which is a function:
The interpreter will simplify that down to: ... although it can't do anything else until somebody else comes along later and calls the function on a specific input