funkia / purescript-hareactive Goto Github PK
View Code? Open in Web Editor NEWPureScript bindings for the FRP library Hareactive
License: MIT License
PureScript bindings for the FRP library Hareactive
License: MIT License
Hello @paldepind
I think will be better to have another package for DOM-related constructions.
We should use FRP without DOM-related things.
That just my thoughts
It would be nice to have couple simple examples:
Thx.
@erisco asked on the PureScript Slack wether or not runStreamAff
runs Aff
s in parallel or sequentially. This made me realize that there is no way to control that currently. @limemloh and I have discussed it and this is what I propose.
We will have two ways of running Aff
s from streams. One, runStreamAff
which runs effects in parallel and an alternative runStreamAffPar
which takes an integer n
specifying that only n
threads may run in parallel. Then runStreamAff
is essentially the same as runStreamAffPar Infinity
and runStreamAffPar 1
runs the Aff
s completely sequentially.
These are the types:
runStreamAff :: forall a. Stream (Aff a) -> Now (Stream (Future (Either Error a)))
runStreamAffPar :: forall a. Int -> Stream (Aff a) -> Now (Future (Either Error a))
Unlike the current runStreamAff
these delivers their result as Future
s. To flatten and order these we will add the following functions:
joinFutures :: forall a. Stream (Future a) -> Stream a
joinFuturesLatest :: forall a. Stream (Future a) -> Stream a
joinFuturesOrdered :: forall a. Stream (Future a) -> Stream a
The first simply delivers the result as they come back, the second discards old results (what you want for the zip code example) and the last one delivers results in the same order that they came in, delaying results if some preceding Aff
s are slow.
Does this handle all the different orderings that one may want? What do you think @erisco?
Hello!
Currently, I have this thing in my code:
flattenArrayStream :: forall a. Stream (Array a) -> Now (Stream a)
flattenArrayStream input = do
ss <- liftEffect sinkStream'
liftEffect $ subscribe (foldMap (\x -> pushSink x ss.sink)) input
pure ss.stream
Perhaps a new combinator that does something like this the "proper" way (perhaps without using Effect?) would be useful?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.