Giter VIP home page Giter VIP logo

extensible-effects's Introduction

extensible-effects is based on the work Extensible Effects: An Alternative to Monad Transformers. Please read the paper for details.

Build Status Join the chat at https://gitter.im/suhailshergill/extensible-effects Stories in Ready Stories in progress

Advantages

  • Effects can be added, removed, and interwoven without changes to code not dealing with those effects.

Disadvantages

For GHC version 7.8 and upwards

  • The extensibility comes at the cost of some ambiguity. Note, however, that the extensibility can be traded back, but that detracts from some of the advantages. For details see section 4.1 in the paper. This issue manifests itself in a few ways:
    • Common functions can't be grouped using typeclasses, e.g. the ask and getState functions can't be grouped with some

      class Get t a where
        ask :: Member (t a) r => Eff r a
      

      ask is inherently ambiguous, since the type signature only provides a constraint on t, and nothing more. To specify fully, a parameter involving the type t would need to be added, which would defeat the point of having the grouping in the first place.

    • Code requires greater number of type annotations. For details see #31.

  • Requires a Typeable instance on the return type. This is no longer a limitation on GHC versions 7.8 and above.
    • fixed by #38.

For GHC versions prior to 7.8

  • Neither Eff nor (:>) has a Typeable instance, and can thus often not be used as a return type (e.g. State type) for other Effs.
    • fixed by #38.

extensible-effects's People

Contributors

bfops avatar gitter-badger avatar ibotty avatar qnikst avatar spl avatar suhailshergill 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.