Channels

#linking-together

Title

# linking-together

a

Alex McLean

11/09/2023, 11:45 AMI enjoyed this talk by Conal Elliott on Functional Reactive Programming (FRP)
and also enjoying some previous discussion about Conal's version of FRP here
• https://linen.futureofcoding.org/t/49387/does-anyone-know-the-current-state-of-the-art-in-functional-

Some surprising things:
• Conal comes out really strongly against most FRP implementations as missing the point of FRP
• He came up with FRP before he new about fmap (functor map), applicative, monad etc?? Woah
• From **@Ivan Reese**: "he wants everything to be exactly precise real numbers, rather than approximations using rational numbers". I'm really scratching my head over this.. I guess the way I see it rational numbers *are* precise, and fit every use case I have very well. I can't think of a reason why you'd need to use an irrational number for e.g. an animation frame.

I should ask him, but I think on the implementation side, Tidal (and Strudel) do largely meet his criteria for FRP. They use rationals to represent time though (which I think is a step up from the doubles in Fran), and behaviours (which I call patterns) aren't functions of time, but something more general - functions of timespans. This allows them to a) be queried without any possibility of missing values between samples b) return discrete events as well as continuously varying values.

I found the twitter thread with **@Ivan Reese** https://twitter.com/spiralganglion/status/1141913756923912192

Hmm **@Ivan Reese** you seem to consider floating point and integral time, but not rational time. You do suggest "Represent time discretely—using ints—but with dynamic granularity." though which I guess is how rational numbers work? Storing a number as two integers, numerator and denominator.
I've not hit any real problems with rational time, apart from the cost of converting from floating point to rationals, which can usually be minimised/avoided.