The heirs to the throne are warm blooded, more user friendly and smarter.
When you begin to learn a functional language such as Haskell however there are some oddities that you need to get used to.
With one exception, procedural code is frowned upon. Haskell will execute code when it chooses.
That means code describes a series of transformations, declaring variables and recording state becomes redundant.
Functional programs are more or less stateless.
Cue hifalutin philosophising - but apart from all that the implementation of flow and transformations in code is elegant.
Let's say we want to find value at risk (VaR) for a certain price history.
These are the steps:
Take a chunk of prices (the lookback could be 5 years for example)
Sample by a set horizon period (for example monthly)
Pick xth percentile largest loss (for example 95th)
The code could take many forms.
An attempt might look like
a = chunk(prices);
b = sample(a);
c = returns(b)
d = order(c)
result = pick(d)
Naturally reading inside out.
However, the transformational flow approach looks like
or if you prefer to read right to left
prices is not fixed, but updates in real time. I.e. it is itself a flow, you could imagine that the program now updates VaR in near real time.
Maybe you want to incorporate data from several sources also? (aka signals)
Take a look at Elm for a very nice implementation.
Some day all code will be as easy to read as this. Perhaps even Excel spreadsheet functions will jump on the band wagon at some stage.