optimize-monad-trans - Toy example — How can GHC optimize monad transformers?

  •        127

This is a toy problem to investigate how the Glasgow Haskell Compiler can optimize a monad transformer stack. Discussion on reddit.

https://github.com/HeinrichApfelmus/optimize-monad-trans

Tags
Implementation
License
Platform

   




Related Projects

learn-fp - learn-by-doing course/tutorial for functional programming on scala

  •    Scala

This course/tutorial was created with purpose to better understand functional programming idioms using Scala language. It covers type classes, monoids, functors, applicatives, monads, traversable/foldable, monad transformers, free monad. Material is structured as set of stub/unimplemented functions/classes and tests for them. Your objective is to make all unit tests green. It is learn-by-doing course. NICTA course was a great and interesting challenge for me to do in Haskell. I think Scala community will benefit from the similar course.

eff - Eff monad for cats - http://atnos-org.github.io/eff

  •    Scala

Extensible effects are an alternative to monad transformers for computing with effects in a functional way. This library is based on the "free-er" monad and extensible effects described in Oleg Kiselyov in Freer monads, more extensible effects. You can also check out this presentation at flatMap Oslo 2016 (slides).

articles - Miscellaneous articles. The readme is the table of contents.

  •    Haskell

This repository is filled with articles I have written and needed online for various reasons. Below is a short summary of the articles available publically; the repository may contain files not mentioned below, in which case they're probably unfinished or otherwise not worth reading at this point. Applicative-Monad proposal (AMP) is the original text of the 2013 Applicative-Monad proposal, which was the starting point for Applicative becoming a superclass of Monad in GHC 7.10.

cyclops-react - An advanced, but easy to use, platform for writing functional applications in Java 8

  •    Java

Powerful Streams and functional data types for building modern Java 8 applications. We extend JDK interfaces where possible for maximum integration.ReactiveSeq extends JDK Stream and offers multiple modes of execution - synchonous, asynchronous, asynchronous with backpressure, parallel and more.

arrow - Functional companion to Kotlin's Standard Library

  •    Kotlin

Λrrow is a library for Typed Functional Programming in Kotlin. Arrow aims to provide a lingua franca of interfaces and abstractions across Kotlin libraries. For this, it includes the most popular data types, type classes and abstractions such as Option, Try, Either, IO, Functor, Applicative, Monad to empower users to write pure FP apps and libraries built atop higher order abstractions.


webpack-closure-compiler - Google Closure Compiler plugin for Webpack

  •    Javascript

Closure Compiler is the most advanced JavaScript optimization tool. It generates smallest bundle and emits efficient JavaScript code by doing whole program analysis and optimization, removing closures and inlining function calls, as well as tree-shaking for AMD, CommonJS and ES2015 modules. While there's JavaScript version of Closure Compiler, the original compiler is written in Java and thus Java version is more complete and performs better in terms of JavaScript code optimizations and compilation speed. If you want to use Java-based compiler, make sure you have installed Java SDK.

Eta - A powerful language for building scalable systems on the JVM

  •    Haskell

Eta is a pure, lazy, strongly typed functional programming language on the JVM. It is a dialect of Haskell on the JVM. It is pure by default which means that calling a function with the same arguments will yield the same results every time. It is lazy by default which means that data stays in unevaluated state until a function needs to peek inside.

MonadEx - Upgrade your pipelines with monads.

  •    Elixir

MonadEx introduces monads into Elixir. Monads encapsulate state and control the flow of code. A monad's bind operation is similar, but more powerful, than Elixir's built-in pipelines. Monads may be combined to make even more useful constructs. For example, you may want to use a state monad in combination with a result monad. The state monad can track a shared environment and the result monad can keep track of the success or failure state.

snap-core - Core type definitions (Snap monad, HTTP types, etc) and utilities for web handlers.

  •    Haskell

Core type definitions (Snap monad, HTTP types, etc) and utilities for web handlers.

monads - Simple Ruby implementations of some common monads.

  •    Ruby

This library provides simple Ruby implementations of some common monads. The most important method of each implementation is #and_then (a.k.a. bind or >>=), which is used to connect together a sequence of operations involving the value(s) inside the monad. Each monad also has a .from_value class method (a.k.a. return or unit) for constructing an instance of that monad from an arbitrary value.

language-ext - C# functional language extensions - a base class library for functional programming

  •    CSharp

This library uses and abuses the features of C# 6+ to provide a functional 'Base class library', that, if you squint, can look like extensions to the language itself.language-ext is an MIT-licensed open source project. Its ongoing development is made possible thanks to the support by these awesome backers. If you'd like to join them, check out the language-ext Patreon campaign. Or if you'd just like to help support the coffee fund, that is very welcome too!.

eff - A functional programming language based on algebraic effects and their handlers.

  •    OCaml

Eff is a functional programming language based on algebraic effects and their handlers. Algebraic effects are a way of adding computational effects to a pure functional setting. In a technical sense they are subsumed by the monadic approach to computational effects, but they offer new ways of programming that are not easily achieved with monads. In particular, algebraic effects are combined seamlessly, whereas monad transformers are needed in the monadic style.

FSharpPlus - Extensions for F#

  •    F#

A complete and extensible base library for F#. In the Sample folder you can find scripts showing how to use F#+ in your code.

hamsters - A mini Scala utility library

  •    Scala

A mini Scala utility library. Compatible with functional programming beginners. For the JVM and Scala.js.

continuation - A compiler for JavaScript asynchronous Continuation-Passing Style transformation

  •    Javascript

Continuation.js is a compiler for Continuation-Passing Style transformation, which simplifies asynchronous JavaScript programming. It translates slightly flavored JavaScript syntax into standard JavaScript, so it can be also called a "translator". Continuation.js introduces a virtual function cont, which allow you to write continuation-passing style code (or asynchronous callback style code) far easier. cont is not a actual function, but a mark with the same syntax to function calls in JavaScript. By using Continuation.js you can write asynchronous control flows like flat threaded code, and it compiles it into continuation-passing style code. The code above is flatted by using the virtual function cont. Control flow must "wait" for the return of asynchronous function call fs.readFile. Parameters in the argument list of cont will be set after it returns. "Return" here is a little confusing because in an asynchronous function "return" means callback function called, not "return" in the literal sense. An asynchronous function usually returns immediately (by encountering return statement or the end of the function scope) while the callback function could be called later. You can be understood as all the statements after cont until the end of the function are the callback function of the asynchronous function call. The code feels like threaded code, but it is still asynchronous while executing.

transient - A full stack, reactive architecture for general purpose programming

  •    Haskell

It's a bit mind bending in that it's like using a higher-level list monad, but it's very, very cool. For beginning Haskellers, what would be really useful is a visualisation of what happens when you do various distributed/parallel stuff. It's almost shocking how effortlessly you can run computations across threads/nodes. The cool part is the composability in the distributed setting. You can make higher-order monadic functions that allow you to compose & reuse a long chain of distributed transactions via wormhole and teleport. Another benefit is that the transaction becomes first class and you can see exactly what's going on in one place instead of distributing the logic across actors making the code equivalent to event callbacks, as you've stated.

SCALAZ - An extension to the core Scala library for functional programming

  •    Scala

An extension to the core Scala library for functional programming. It provides purely functional data structures to complement those from the Scala standard library. It defines a set of foundational type classes (e.g. Functor, Monad) and corresponding instances for a large number of data structures.

OK - Elegant error/exception handling in Elixir, with result monads.

  •    Elixir

Elegant error/exception handling in Elixir, with result monads. The OK module works with result tuples by treating them as a result monad.

purescript-aff - An asynchronous effect monad for PureScript

  •    PureScript

An asynchronous effect monad and threading model for PureScript. This looks like ordinary, synchronous, imperative code, but actually operates asynchronously without any callbacks. Error handling is baked in so you only deal with it when you want to.





We have large collection of open source products. Follow the tags from Tag Cloud >>


Open source products are scattered around the web. Please provide information about the open source projects you own / you use. Add Projects.