Coder Social home page Coder Social logo

streams's Introduction

Erlang: the power of functional programming

Functional programming in Erlang, including streams, lazy evaluation and dependent types.

Code for the presentation at Erlang/Elixir Factory, Buenos Aires, 2017 and CODE BEAM SF 2018. Slides in EFBA.pdf and CBSF.pdf.

Notes on different approaches

lazy.erl Definitive version of lazy examples in which references stored in a named ETS table. References are allocated sequentially, with value at key 0 being the current index used.

lazy0.erl Version in which the id of a table is passed explicitly into all functions that might use it.

lazy2.erl Incomplete experiment in which use a hashed version of an expression as its address in an ETS table. Unsuccessful: hasing appears to be too eager to work.

lazy3.erl Definitive version of lazy examples which doesn't use ETS tables or other side-effecting constructs. References are stored in a map, and allocated sequentially, with value at key 0 being the current index used. The map is threaded through the computation.

memo.erl Two experiments in memoisation: using ETS and in the data.

rps.erl Rock-Paper-Scissors, a basic implementation in Erlang.

maze.erl List of routes through a maze: a good candidate for making lazy: want to try it?

stream.erl Demand-driven evaluation for streams: first iteration with no attempt to optimise.

streams's People

Contributors

simonjohnthompson avatar

Stargazers

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

Watchers

 avatar  avatar

Forkers

yury-pachin

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.