UP | HOME

FRP

There is what is wrong with it as a supposedly coherent set of concepts.

They assume time as being something real (actual, existent, of its own). And this leads to a mess - the modelers introduce a whole bunch of unnatural, unnecessary, redundant abstractions, instead to just having a few right ones.

The main problem is in trying to get a function from time to a value: Time -> a, which means assuming something that isn’t there.

The main difficulty is that they are trying to superimpose a ruler to whatever isn’t there yet.

It takes time and very careful, precise wording to explain (without usual narcissistic verbiage so prevailed within Haskell community).

What exactly is wrong.

When we view a function as a set of ordered pairs and the whole functional space as a result of a Cartesian Product of Domain and Codomain we have a fundamental problem - the function is not total, it is not an one-to-one relation, so it is not a function at all.

One cannot use a ruler before one gets an “object”.

The function of a -> (Time, a) is just a log. it tags an event with a time-tag. This also means that the event a is already observed (by those who tags it with a timestamp - who used the ruler) - it is already emerged from a source.

Again, Time -> a is just wrong.

Partial function

If partial function from an abstract Time is what they want, that would mean getting Nothing most of the time, which is what a busy-waiting is.

Nature does not use a busy-waiting because it is enery-inefficient, grossly inefficient. It uses tresholds and triggers (which is what a nervous system is - a signal-propagation network).

Maybe monad comes to the mind, which propagates Nothing and distributes f over its Just x.

Number Line

A Number Line is an imaginary mental construction (a generalized abstraction of the mind of an external observer) which is used to visualize (and imagine) the generalized abstract concept of a Number.

Originally it was just a primitive ruler - a stick with equally-spaced notches or marks, which is, it turns out, a common but decissive pattern of the mind. An external observer is required to use a ruler, and without such an observer the whole notion does not exits anywhere outside his head.

This is how we (intelligent observers) measure lengths, including lengths of time, which itself is an non-existent, abstract notion derived by an external observer. You will be unable to find any time anywhere outside your head.

Again, that is it - just equally-spaced marks superimposed onto observed phenomena by an external (relative to the phenomena) observer.

This concrete (or abstract) ruler is superimposed against (onto) something, and the number of notches are counted (summed up or added together).

Math

In abstract mathematics the notion of counting is exactly this - superimpose an imaginary Number Line and associate each “whatever” with a Number.

We can think of it as a Set of ordered pairs (and a Cartesian Product) and, yes, length is the same process as count (how many)

count xs = fst . last $ zip [1 ..] xs
  where
    zip (n : ns) (x : xs) = (n, x) : zip ns xs
    zip _ _               = []

Time

Time is modeled as discrete (ticks) or continuous (a Real line).

Continuous time is mathematically more convenient and derivatives and differential calculus arise from this notion.

No matter how one model it - as discrete or continuous - it does not make it more real.

The assumed implication that continuois time can vary is just a play of conditioned (by shared culture) mind - pure imagination, however sophisticated.

Change in Time

Once you have superimposed time you have a change over time, or \[\frac{dy}{dt}\]

FRP

We associate a continuous time-line with a discrete event “flow” (stream).

So we get a “log” (ledger) - such event occurred at such timestamp.

And that is it.

The better name for “Behavior” is “Signal”.

Semantically it is a relation over continuous (Real) time.

The relation is many-to-one which means that many timestamps result in the same a.

Monoids

Obviously, a time-line, just as a number-line, have associative “addition” or “concatenation”.

Associativity of concatenation and distribution of operations (maps) over concatenation are Universal patterns on linear sequences.

RNA and DNA are such sequences and enzymes “distribute” over them.

The universal Algebraic notions (structures) are, yes, generalized abstractions of… guess whom?

So, all the familiar /abstract algebraic structures (with corresponding “laws”) are there.

Length

Length is counting of “ticks”

length xs = sum [1 | _ <- xs]
  where
    sum = foldr (+) 0

and, by the way

count x = length . filter (== x)

Blocking (waiting for an event to occur) is inevitable

Busy-waiting is energy-inefficient, unless it is “sleeping”.

Triggering (with an interruption) is only natural

Arrival of a necessary condition (in a locality). A required molecular structure within a reach (same locality). A threshold (temperature, energy, etc).

Already observed

A time marker (tag) implies that a value (event) has already been observed by someone who superimposed a ruler and put a tag.

The “entering into a system” (crossing a cell-membrane) event.

A sequence of tagging (modifications)

Author: <schiptsov@gmail.com>

Email: lngnmn2@yahoo.com

Created: 2023-08-08 Tue 18:37

Emacs 29.1.50 (Org mode 9.7-pre)