Questions tagged [effect-systems]
9 questions
15
votes
1 answer
How do I compose 'freer' effects in haskell?
I'm attempting to rewrite a simple interpreter from a transformers-based monad stack to effects based on freer, but I'm running up against a difficulty communicating my intent to GHC's type system.
I am only using the State and Fresh effects at…

jjl
- 173
- 6
15
votes
2 answers
What is a type and effect system?
The Wikipedia article on Effect system is currently just a short stub and I've been wondering for a while as to what is an effect system.
Are there any languages that have an effect system in addition to a type system?
What would a possible…

Mark Cidade
- 98,437
- 31
- 224
- 236
4
votes
1 answer
Encode effect in terms of another with freer extensible effects
I have been playing around with “freer monads” and extensible effects, implemented in the freer-effects package, and I’ve run into a problem that seems feasible but I’m having trouble solving.
I’ve written a type that represents simple interactions…

Alexis King
- 43,109
- 15
- 131
- 205
3
votes
1 answer
MonadPlus instance for Control.Eff when Exc is member
In monad transformers, we have
instance (Monad m, Monoid e) => MonadPlus (ExceptT e m)
In extensible effects, there is no such thing as
instance (Monoid e) => MonadPlus (Eff (Exc e :> r))
I've tried implementing it, in vain. Here is what I have so…

koral
- 442
- 3
- 11
2
votes
0 answers
Interpret a `Sem (x ': r) a` into a `Sem (y ': r) b`?
I'm trying to put together the machinery to write something like secret-sharing (e.g.) using algebraic effects. More specifically I'd like to be able to write the protocol in terms of the actions of each individual party, and then handle that…

ShapeOfMatter
- 991
- 6
- 25
1
vote
1 answer
Kotlin Arrow EffectScope.shift() implementation throws exception?
When looking at arrows documentation about functional error handling one of the reason listed to avoid throwing exceptions is performance cost (referencing The hidden performance costs of instantiating Throwables)
So it is suggested to model…

rascio
- 8,968
- 19
- 68
- 108
1
vote
1 answer
How to modify the type of a Reader effect in Haskell Polysemy?
The Reader effect provides a local method which modifies the value to be read within a local scope:
local :: Member (Reader i) r => (i -> i) -> Sem r a -> Sem r a
The function passed to local must not change the type of the data. I would like to be…

runasi
- 13
- 2
1
vote
3 answers
Methods for side-effects in purely functional programming languages
At the moment I'm aware of the following methods to integrate side-effects into purely functional programming languages:
effect systems
continuations
unique types
monads
Monads are often cited to be the most effective and most general way to do…
user141335
0
votes
2 answers
Using pooledMapConcurrentlyN in polysemy
I'm currently playing around with Polysemy, rewriting a small toy project of mine to get used to it. I'm stumbling upon a piece of code that uses pooledMapConcurrentlyN, so basically a parallel version of traverse with bounded concurrency.
I can…

l7r7
- 1,134
- 1
- 7
- 23