Code Monkey home page Code Monkey logo

Comments (6)

wende avatar wende commented on May 19, 2024 1

After most of Elmchemy's features stabilize and prove themselves in a longer run I will start thinking about redoing Elm runtime in BEAM, so that there are effect modules, and generally pattern for generating side-effects. I just feel like receive is a very controversial feature to put into the project, and I believe it's sacrificing what's the best in Elm
I'm sure we'll find another way to achieve that

from elchemy.

OvermindDL1 avatar OvermindDL1 commented on May 19, 2024

You could always support an after block by mandating it as part of the msg type like:

type Msg
  = Msg String
  | After Int
case receive of
  Msg a -> 1
  After 10 ->

Via the specially named message After or so?

And it is not technically impure, purity in Erlang is per process, and given the same inputs to the same process at the same time in its life cycle it will always generate the same work. ^.^

from elchemy.

wende avatar wende commented on May 19, 2024

Wow. This is a very smart and hacky idea. But I definitely like that!

from elchemy.

OvermindDL1 avatar OvermindDL1 commented on May 19, 2024

Wow. This is a very smart and hacky idea. But I definitely like that!

The Elm syntax does not leave a lot of options open... ^.^;

from elchemy.

wende avatar wende commented on May 19, 2024

Because of the decisions on how to handle side effects and inherent impurity of receive construct, it won't ever be introduced to Elmchemy, and be possible to use only through special Elmchemy constructs for process message boxes

from elchemy.

OvermindDL1 avatar OvermindDL1 commented on May 19, 2024

Maybe instead you could emulate it like a 'subscription', when a message is received that matches a pattern then send it on? Unsure of how to 'start' a receive though, hmm... Would be much easier if an Elm 'program' was exactly a GenServer on the Elixir side...

from elchemy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.