sodiumfrp / purescript-sodium Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Should we organize the modules differently? Maybe re-export everything in a top-level SodiumFRP
?
Personally I don't mind the current setup, but it does lead to multiple imports that could be avoided...
Tbh I'm not entirely sure how Github permissions work... I thought everyone in the SodiumFRP organization was automatically added?
But anyway - now that I realized it, @clinuxrulz, welcome :)
Should follow just like the Cell tests, but we need to define an Eq that works through Aff, since the only way of getting a value out of Stream is via listen
Stream
(Cell, Constructor, etc.?)
I'm wondering if it would feel a little better to have the sodium objects come first, and have data / callbacks last.
See for example hold, accum, and snapshot.
Note that the current approach of placing the sodium objects last, more closely follows the Haskell implementation.... and either approach can be made to work by using flip
or whatever... but if we follow the idea of "most to least general" I'm not sure if the current approach is the best fit...
thoughts?
Currently, functions like snapshot allow passing in any type of Cell
(i.e. CellLoop
, CellSink
, ...)
However, they must all be the same type right now. Need to change the signatures so that each kind gets its own type variable (e.g. SodiumCell celA
, SodiumCell celB
)
This isn't a showstopper since one can always use toCell
to convert it
I'd recommend removing the Monad instance for Cell and just go up to Applicative instead.
If a newbie come along and used the monadic interface heavily (E.g. do-notation), then he/she could run into performance problems as almost all their sodium objects would be connected with switchC
, and each time the cell changes within a switchC
there is a rank re-sort happening.
execute :: Stream (Effect a) -> Stream a
This one is important for a FRP library in a pure functional programming language. You will not see this one in other languages like Typescript or Java, because we can just do side effects in map
. It can be implemented via Typescript's Stream map under the hood.
It is one of the functions listed in the denotational semantics, promise I did not just make it up. ๐
Started but needs continuation and more thought... might be that the entire API needs to be run via Effects since really there is mutation happening on the JS side, even if just local state within the classes
Most functions don't really care whether they are getting a Stream, StreamSink, or StreamLoop (for example)... so it should accept any of them
Probably it can be made as simply as accepting SodiumStream/SodiumCell instead of specific Stream/Cell
Some functions do care about this distinction, of course - for example Functor and Send implementations
Primitive Functions
Constructors
Typeclases
Categories
Transactions should be their own wrapper, around Effect.
Tentative: newtype InTransaction t = InT (Effect t)
Functions
Constructors
Typeclases
Categories
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.