Polysemy: Tactics binding deprecated workaround
In a previous log, we ended with a solution for Resource which wasn't Error resistant. The solution is to use the soo-deperecated withLowerToIO. Let's… ...more
In a previous log, we ended with a solution for Resource which wasn't Error resistant. The solution is to use the soo-deperecated withLowerToIO. Let's… ...more
In a previous log, we introduced bindS providing a way to bind higher-order effects. Tactics also provide *T equivalent, starting with our example: da… ...more
In a previous log, we introduced liftS and runS which helps running higher-order effects in the interpretation Monad. However, you sometime have effec… ...more
Polysemy comes with many effects, today we'll have a look at Async which is the effect for and over async package. It enables running and driving asyn… ...more
In a previous log, we introduced Higher-order effects definition and interpretation through tactics. Some elements from tactics are already deprecated… ...more
In a previous log, we introduced Higher-order effects definition and interpretation through tactics. We'll see in another log an alternative way to de… ...more
One thing that sets polysemy apart is that it allows defining Higher-order effects. As higher-order functions, higher-order effects are effects define… ...more
Whenever you might have varying strategies to fetch some data, you might want to use Input: data Input i m a where Input :: Input i m i it comes wi… ...more
While you could perfectly stay in pure computation, using already defined Monad (such as IO) is a widespread usage. That's what Embed has been designe… ...more
In the previous post we have introduced an effect which mimics ElasticSearch indexing: newtype Id = Id {getId :: Int} deriving stock (Eq, Ord, Show)… ...more
From time to time, you already have a some effects and interpreters setup, but you want to add some actions without changing the behavior. It's one of… ...more
At some point you'll have a lot of effects, which is not an issue, however you might duplicated types (usually, I would advise to use newtype, but you… ...more
In a previous log we have seen a way to cache computation and a way to inject effects. Let see what it take to build a caching effect: data Cache k v … ...more
As seen previously we can have interpreters which relies on other interpreters. While you could simply add the required effects to the list, you may w… ...more
In my last log we defined the Trace effect: {-# LANGUAGE TemplateHaskell #-} module EffectDefinitionIntro ( Trace (..), trace, ) where impor… ...more
In the first log we explained that in the expression: displayFile :: FilePath -> Sem '[Trace, Embed IO] Int displayFile path = do trace $ &qu… ...more
Previous log introduced EffectRow. It could be tempting to create a type and apply it everywhere in the codebase as follows: type AppEffects = '[T… ...more
As seen in the previous log we ended up with: import Polysemy import Polysemy.Trace displayFile :: FilePath -> Sem '[Trace, Embed IO] Int disp… ...more
As seen in the previous log we have an expression as follows: import Polysemy import Polysemy.Trace displayFile :: FilePath -> Sem '[Trace, Em… ...more
I used to teach functional programming using Haskell in an engineering. I was starting my course by defining functional programming being defined by t… ...more
There is a famous code kata used during Global Days of Code Retreat called Conway's Game Of Life. It has four rules: Any live cell with fewer than tw… ...more
I learned a lot during my Hacktoberfest participation, especially how I like my contributions to be handled. Here are some guidelines: Write clear is… ...more
Few weeks ago, I had a meetup with Woody Zuill, the inventor of Software Teaming, with the Software Crafters Lyon. I have encountered the same topic a… ...more
Following my Hacktoberfest participation, I had the chance to have a variety contribution of experiences. Pendings PRs I'm always a bit sad whenever m… ...more
A while ago, I have the chance to kick-start a new project, our product owner just finished presenting his that one of my colleague started to decide … ...more
This year I decided to contribute a lot to Hacktoberfest for three main reasons: I wanted to give back to the community I wanted to change my contrib… ...more
When it comes to programming languages, there is a famous quote: "A language that doesn't affect the way you think about programming, is not wor… ...more
In my last session of the GDCR, during the Red phase I ended up with this test: spec :: Spec spec = describe "SpaceX" $ do describe &q… ...more
Last week I was watching Mauro Servienti - All Our Aggregates Are Wrong. At some point he stated that users tend to think in terms of data. I had a fe… ...more
As every year, the Global day of code retreat is a good excuse to work and rework the same kata a full day. This year I have attended to the one organ… ...more
As every year, the Global day of code retreat is a good excuse to work and rework the same kata a full day. This year I have attended to the one organ… ...more
I am to start a short web log (aka blog/microblog) in order to share some insight I get in my day-to-day work/practice. I'll mainly talk about about: … ...more