Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lifted function semantics #6

Open
rikutiira opened this issue Jun 22, 2017 · 3 comments
Open

Lifted function semantics #6

rikutiira opened this issue Jun 22, 2017 · 3 comments

Comments

@rikutiira
Copy link
Member

rikutiira commented Jun 22, 2017

I'm still unsure if the lifted function semantics are good as they are now. As @polytypic mentioned in another issue, lifted functions have following functionality:

  • they give properties that skip identical values
  • they perform deep lifting of their arguments

My issue is mainly with the automatic skipping of identical values. That mostly works fine for properties but it does not work with streams at all. I understand that the Calmm way to do things is to use properties and avoid side-effects but sometimes streams are necessary. Karet.util even has a bus function for creating streams which you can push values to. I have ran into weird bugs with streams because I'm using karet.util functions and they skip identical values. The latest issue was with my cancel feature of Form: it's a stream which tells to cancel the current state of form, but only the first cancel worked because the stream is always emitting the same value.

I also ran into a weird bug with deep lifting of the arguments but I simply didn't remember that lift was doing that. As long as it's well documented, I feel that's a fine semantic.

But question is: does skipping identical values automatically cause more issues than it solves? At least I'm not personally fan of not being able to use karet.util for streams, even when karet.util has utilities for working with streams.

@polytypic
Copy link
Member

Hmm... I recall mentioning something like this previously (on Gitter?), but perhaps something like making it so that lifted functions would return a stream if any one of the source observables was a stream might lead to a reasonable API (otherwise all sources are either constants (result is a constant) or properties (result is a property)).

@rikutiira
Copy link
Member Author

Yeah I believe we were thinking about that kind of solution some months ago. I think we were discussing about the semantics when it would return a stream, but any of the sources being stream sounds reasonable.

@bpinto
Copy link

bpinto commented Jan 12, 2021

@rikutiira sorry to bump a very old issue but I am facing the same problem with requests not firing the second time, what have you done to work around this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants