Git Product home page Git Product logo

elm-architecture-haskell's Introduction

elm-architecture-haskell

Elm is a pure functional language for the front-end. It enforces an architecture that allows programs to stay pure in an event-based setting.

It turns out that this architecture is a great idea for Haskell too. It provides a performant and easy to understand framework to organise state in long-lived or complex Haskell applications.

The Elm Architecture replaces the threading of a state monad or a stack of monad transformers through the program with single pure update function. Its event-based approach also provides a simple way to handle concurrency making things even more fun.

This is an implementation of the Elm Architecture in Haskell.

This implementation runs commands in parallel just like in Elm.

Internally commands run in separate threads. If any of the threads errors, the error will be re-thrown in the main thread.

Example Program

Checkout the example at src/WebCrawler.hs. You can compile and run this with stack build and stack run.

The example illustrates how the Elm Architecture can help with the organisation of state updates in a multi-threaded application.

elm-architecture-haskell's People

Contributors

lazamar avatar

Watchers

 avatar

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.