Giter VIP home page Giter VIP logo

Comments (7)

grmble avatar grmble commented on August 12, 2024

Implementing the Applicative instance has the same problem the monad has: it would be necessary to collect all the results before combining. This would completely change the semantics .. e.g for an animation it would loose all the delays (and thus, all intermediate steps).

Monoid should be possible though

from purescript-bonsai.

grmble avatar grmble commented on August 12, 2024

Not enough bang for the buck, will not be implemented

from purescript-bonsai.

grmble avatar grmble commented on August 12, 2024

Things change, the bang/buck ratio just increased.

The update function returns a (Tuple (Cmd eff msg) model) now - if Cmd was a monoid, the result tuples would be Applicatives.

Only problem: circular dependencies - to define the monoid instance, you need Cmd and emitMessage in one place. A lot of stuff would have to move to VirtualDom.purs

from purescript-bonsai.

grmble avatar grmble commented on August 12, 2024

Still won't implement the Monad/Applicative instances though.

An emittingTask can call it's emitter multiple times. It would be possible to wait for the values with an AVar, and somehow signal the end when the emittingTask ends, but why? Pure commands are an array, just compose that. And the task commands are Aff actions - they are fully composable as well.

from purescript-bonsai.

grmble avatar grmble commented on August 12, 2024

Oops, I made a monad instance. This lets us define empty and pure ... kill emptyCommand and pureCommand?

from purescript-bonsai.

grmble avatar grmble commented on August 12, 2024

Having worked with the new combinators: this is awesome.

I want a parallel apply, and alt should choose the first message that arrives on either stream of messages.

Not sure yet whether bind and apply should permute or zip. I suspect zipping would be more useful, but I'll have to think about it some more.

from purescript-bonsai.

grmble avatar grmble commented on August 12, 2024

This is in https://github.com/grmble/purescript-bonsai-types now.

bind/apply have permute semantics, like array and other collections. append has string ordering, alt forwards any message that comes in.

Still missing: parallel apply, racing operator. Worth the effort? Dunno.

grmble/purescript-bonsai-types#1

from purescript-bonsai.

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.