Comments (7)
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.
Not enough bang for the buck, will not be implemented
from purescript-bonsai.
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.
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.
Oops, I made a monad instance. This lets us define empty and pure ... kill emptyCommand and pureCommand?
from purescript-bonsai.
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.
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)
- unitTask helper
- onSubmit: inputs with checked method are always on
- Export MarkupF constructors HOT 1
- onWithOptions should have the options first
- update functions should have the Msg first
- VirtualDom Properties that should be Attributes
- DOM appendChild actually calls append
- Additional render function that produces an Array of VNodes
- event handlers should be Foreign -> F (Cmd msg)
- Investigate degrading performance HOT 1
- Client Routing - setting the Location fragment
- Local/SessionStorage for Bonsai.DOM HOT 2
- Bonsai.DOM should use F
- Make jsdom events (click, input, ...) work
- The Great Package Split of 2018
- Kill plainResult
- Event handlers on external elements HOT 1
- Track subproject issues for 1.0
- Bonsai Debugger
- Export delayUntilRendered from Bonsai
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from purescript-bonsai.