SodiumFRP / sodium

Sodium - Functional Reactive Programming (FRP) Library for multiple languages
http://sodium.nz/
Other
851 stars 140 forks source link

Add mapTo convenience method to event #81

Closed notlion closed 8 years ago

notlion commented 8 years ago

This is a simple implementation of the mapTo function discussed in #80. I began to write the pre-cxx11 version, but then noticed that there are some functions (like merge right below) that don't have alternate versions. Also I noticed that v2 seems to be c++11 only. My opinion is that FRP would be pretty hard to use without lambdas, so moving to c++11 only makes some sense. That said, with a little guidance I can produce a backward compatible version if you feel it's necessary.

Do you think this makes sense for behaviors as well? I'm trying to imagine a situation where I'd want to map a behavior to a constant.

the-real-blackh commented 8 years ago

The pre-C++11 support is a bit broken and I am going to drop it, because it's quite hard to maintain. I need to spend a whole lot of time tidying everything up!