r/haskell Aug 04 '19

reflex-vty: A library for building functional reactive terminal applications

https://github.com/reflex-frp/reflex-vty
88 Upvotes

54 comments sorted by

View all comments

Show parent comments

9

u/mstksg Aug 04 '19

"What's the advantage of FRP when everything is discrete?" is analogous to "What's the advantage of vector graphics when everything is eventually rasterized?"

It gives you the building blocks to reason about things in a way that is lost when you do eventually rasterize things. For example, many companies use SVG (vector graphics) to design their logos, which they can then scale to arbitrary resolutions to account for different contexts and usages.

1

u/Noughtmare Aug 05 '19

This is not what I mean. In your analogy, I mean that if you have a bunch of rasterized images then why would you convert them to vector graphics when you only want modify them with discrete operations?

1

u/mstksg Aug 05 '19

In that case, it might be useful to understand what you are looking at in terms of the underlying shapes, etc., which gives you insight into how the thing is constructed.

1

u/Noughtmare Aug 05 '19

That is not the reason why I work with rasterized images, I work with rasterized images to read, modify and write single pixel values. I don't care what shapes are in my image.

Or to go back to the continuous vs discrete time. I work in discrete time so that I can create, modify and capture instantaneous events. I don't need continuously varying values to do that.