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

How are side effects managed #9

Open
iqualfragile opened this issue Feb 13, 2017 · 4 comments
Open

How are side effects managed #9

iqualfragile opened this issue Feb 13, 2017 · 4 comments

Comments

@iqualfragile
Copy link

this is more of a question then an issue, but what is the story for side effects, is there one?
like when you want to send a message through a websocket, or retrieve some resource via http

@cramertj
Copy link
Owner

Right now, there's no built-in system for IO. The WIP http branch defines a 'JsIo' type that allows you to send HTTP requests and handle the result in a callback. I'd prefer promises, but I haven't yet worked out exactly how I'd like those to look. If you have ideas, please share!

@jimmycuadra
Copy link

The JsIo API has been published since the last comment here, but I'm wondering about other types of interoperation with JavaScript code. For example, getting the current time, or calling a JavaScript function being included in the global context. That type of interoperation is one of the more unpleasant parts of Elm, so I'm hoping something easier will be available in Domafic. :}

@iqualfragile
Copy link
Author

while the way side effects are handled in elm seems a bit weird from a non-fp point of view, having managed side effects is extremly important to the elm architecture and makes it what it is.

@cramertj
Copy link
Owner

cramertj commented Jul 5, 2017

@jimmycuadra Just to give some context-- I'm trying to come up with a way to allow for both calling/receiving messages from JavaScript that prevents unnecessary allocations, but that also correctly handles Domafic code that calls Javascript that calls back to Domafic code. I've got a few things in mind, and I've written a few prototypes, but I don't have anything to show just yet. I'll update this issue when I have a more concrete idea for how this could look.

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