It seems to me that you could make a lot of progress towards observables by extending Platform.Sub, for example by adding Sub.filter, Sub.timestamped and Sub.foldp...which would let you take a low-level subscription like Mouse.moves and do some fancy observable-like transformations on it. Add in some functions like Sub.map2 or Sub.merge2 and you could probably cover quite a bit. I suspect these are the sorts of things that might get added to the language later to enable some specialized/advanced use cases, once their absence has 'trained' the community to get used to using explicit state for as much as possible.
On Friday, 10 March 2017 05:16:18 UTC-5, Răzvan Cosmin Rădulescu wrote: > > Well they are not "needed" the way that C is not "needed" over assembler > for example. > > Reactive observables are what high level programming is to low level > programming. That's how I see it at least. They shine only when you need to > deal with time, if you only need to work on current state/values then > they're not that useful. But since Elm tires to be a frontend > framework/language for me at least having reactive objets subs very natural. > > You mean to give your actual practical examples in Elm? I'm afraid I'm to > new to the language to be able to do that, I'll have to think about it for > a while. That's why I'm giving examples in JS where we have lots of them > and cycles.js for example is very similar to the Elm architecture except > it's entirely based on reactive objects. > > In any case, I'll try to think of how one might create such things in Elm > and see if I can come up with practical examples > > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
