wende / efx Goto Github PK
View Code? Open in Web Editor NEWFirst-class effects for Elixir
First-class effects for Elixir
As it's currently implemented it doesn't seem to be an Algebraic Effects system, it seems more to be an Implicit Witness system (not that mine went much further at all since I hadn't performed CPS yet and thus why it was never published to hex.pm).
Something as simple as making a memoizer via effects does not seem possible (nor anything even remotely more complex) with this library as it stands.
Like given something like this:
def print_succ(x) do
IO.puts("input change #{x}")
Memo.cut()
IO.puts("Succ of #{x} is #{x+1}")
end
Then running this within the memoizer effect:
print_succ(0)
print_succ(0)
print_succ(0)
print_succ(1)
print_succ(1)
Should print:
input change 0
Succ of 0 is 1
Succ of 0 is 1
Succ of 0 is 1
input change 1
Succ of 1 is 2
Succ of 1 is 2
As long as this specific example can be created generically then 90% of algebraic effects will be implementable (the remaining parts relying on things like returnable continuations, which although can be done is not used by this example, this example only rely's on cloneable continuations, which is easier to implement then returnable continuations and is the form that most algebraic effect systems do as it is the minimal viable setup for an algebraic effects system).
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.