parrows / parrows Goto Github PK
View Code? Open in Web Editor NEWUsing Arrows to model parallel processes/computations.
License: Other
Using Arrows to model parallel processes/computations.
License: Other
The following would have been possible as well, but is stuff for the next paper.
class (Category p) => Parallelizable p where
lift :: (a -> b) -> p a b
firstP :: p a b -> p (a, c) (b, c)
leftP :: p a b -> p (Either a d) (Either b d)
loopP :: p (a, c) (b, c) -> p a b
instance (Category p, Choice p, Costrong p, Strong p) => Parallelizable p where
lift f = dimap id f id
firstP = first'
leftP = left'
loopP = unfirst
instance (ArrowChoice a, ArrowLoop a) => Parallelizable a where
lift = arr
firstP = first
leftP = left
loopP = loop
We already have the conf parameter. We can exploit the type parameter to handle stuff like defining where to spawn processes. This is already present in a way, but could be used even more.
A potential distributed implementation of our interface could probably bastardize the conf parameter to host information about what nodes are available, what state we are in etc.. This info could fit into a monadic type quite well (or a state-arrow for that matter) and would not break with our "monads-are-not-required" approach. We use Arrows/Profunctors to model the processes and use Monads to manage the application state instead of requiring them to model parallelism. Via the conf parameter we can make parEvalN work inside our current harness, while still being able to model a "global state". The default configuration () could be lost in such a backend, however.
remove duplicated code, unnecessary stuff after paper is done.
A Basic implementation like this would be better:
data BasicFuture a = BF a
instance (NFData a) => NFData (BasicFuture a) where
rnf (BF a) = rnf a
instance (NFData a) => Future BasicFuture a where
put = arr BF
get = arr $ (BF a) -> a
It looks like we could implement Eden's instance as
instance (Trans b, ArrowChoice arr) => ArrowParallel arr a b Conf where
parEvalN _ fs = evalN fs >>> arr (spawnF (repeat id))
This has, however, to be checked performance wise.
Some Relwork for the final version of the paper:
https://blog.jle.im/entry/a-dead-end-arrowized-dataflow-parallelism-interface-attempt.html
texlive-base texlive-binaries texlive-fonts-extra texlive-fonts-recommended texlive-generic-recommended texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-luatex texlive-math-extra texlive-pictures texlive-science
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.