Giter Club home page Giter Club logo

efx's Introduction

Wende's GitHub stats

efx's People

Contributors

wende avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

efx's Issues

Algebraic Effects?

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).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.