effectful
avail
Our great sponsors
effectful | avail | |
---|---|---|
21 | 2 | |
319 | 36 | |
6.0% | - | |
8.0 | 0.0 | |
9 days ago | about 2 years ago | |
Haskell | Haskell | |
BSD 3-clause "New" or "Revised" License | BSD 3-clause "New" or "Revised" License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
effectful
-
Haskell in Production: Standard Chartered
Also a much simpler alternative in my opinion to monad transformers is effectful:
https://github.com/haskell-effectful/effectful
Here's a talk on it:
-
The "Services" design pattern
effectful got rid of all issues I listed (I expanded a little on it here).
-
effectful and polysemy users: How do you test? Any of "same as mtl", "novel ways enabled by effects", or "same but more efficiently because..."? Please share experiences
There is also a long document on Issues with the Transformer/mtl library.
-
Haskell ecosystem questions.
cats-effects -> https://github.com/haskell-effectful/effectful
-
Real world applications with tagless-final, ReaderT, and three-layers
API for basic usage is very similar, but things quickly go south once you want to use higher order effects (i.e. effects that make use of the m type parameter). A lot of things then become very hard to write due to complex types or outright impossible (this issue is a good example - a reasonable thing to do that is very straightforward to write with effectful, apparently impossible to do with polysemy).
FWIW effectful is an improvement in both departments (disclaimer: I'm the author).
-
How to Lose Functional Programming at Work
> Lets say you have a huge overly-convoluted Haskell program. Somewhere deep down a call hierachy of pure functions you need to print something to the console. That is not easy to refactor.
> Or vice-versa you have a huge convoluted program where everything happens inside an IO monad because at some point something is written to the console. Now you realize you dont need to write to the console.
These problems are essentially completely resolved these days by a modern effect system like effectful. Basically, they allow you to do arbitrary effects deep down a call stack with minimal plumbing (you still have adjust the types, as you should: that's the point of effect tracking!) and also to remove effects, so you can easily convert between pure code and "effectful code that just so happens to do no effects".
-
Effectful | Paweł Szulc | Lambda Days 2022
See also https://github.com/haskell-effectful/effectful/issues/99.
-
Monad transformer libraries
FYI, transformers and mtl have several subtle traps. You can read about them here.
- Comparing ZIO to Haskell effects libraries like Polysemy?
avail
-
Effect is a phantom (or, the redundant constraint pattern)
I see, this is indeed a valid point and can be used to rewrite the example in the blog post. After all, the blog post is just a simple proof of concept, and in the availability library I am working on, you can also have similar flexibility, i.e. either the concrete type with a phantom Eff constraint,
Yes, this is what I did in the WIP availability library, except that I used the reflection trick instead of ImplicitParams. Conceptually they are the same.
What are some alternatives?
godot-haskell - Haskell bindings for GdNative
cleff - Fast and concise extensible effects
unliftio - The MonadUnliftIO typeclass for unlifting monads to IO
ghc-proposals - Proposed compiler and language changes for GHC and GHC/Haskell
hpqtypes-effectful - Effectful bindings for hpqtypes
PolysemyCleanArchitecture - Showcasing how the Polysemy library can be used to implement a REST application conforming to the guidelines of the Clean Architecture model.
pg_timetable - pg_timetable: Advanced scheduling for PostgreSQL
Functional PHP - Primitives for functional programming in PHP
hackage-server - Hackage-Server: A Haskell Package Repository
snap-core - Core type definitions (Snap monad, HTTP types, etc) and utilities for web handlers.
effect-zoo - Effect Zoo for Scala
monad-alter - A typeclass for abstracting the backend