I've got this type alias: I know that StateT has the kind * -> (* -> *) -> * -> * so it should get three parameters. But in the above e ...
I've got this type alias: I know that StateT has the kind * -> (* -> *) -> * -> * so it should get three parameters. But in the above e ...
I'm learning Monad Transformers, and one of the exercises asks to implement the Monad instance for StateT. I want to test that my implementation admit ...
There's an asynchronous client that returns Futures of Lists. To iterate over results I need to use nested map and flatMap. Is there a way to create a ...
I know you can lift functions to monads with liftM, but I it doesn't seem to work with binary functions. I tried to lift (+) but it didn't work ...
I've been dissecting this one-liner solution for aoc day 14 and came across an elegant impure recursive solution: def s(x,y): if y>h: return T ...
Can one reasonably implement MonadError threw a newtype wrapping ExceptT? So far I have: I know catchError = const will compile, but that's not wha ...
I have the following little working program: Now I would like to access the value of the State Monad in the subfunction doFoo of my function checkF ...
C++23 adds some "monadic-style" functionality regarding optionals, as methods of optional<T>: optional<T>::and_then() (and ignoring quali ...
I have a custom type type GI a = StateT GenState IO a where GenState is a state I keep for Generating Random Trees of some kind. When generating m ...
The haskell transformers library provides MonadIO class and liftIO to lift IO operations in a monad transformer stack. It seems to me that the same co ...
I wanna get used to working monad transformers so I thought I'd write a simple interpreter using ExceptT and State, where my state is Map Ident Int, I ...
I don't see it here by the definition of EitherT, nor here by the definition of Applicative. Shouldn't it be defined within the type module or within ...
I am trying to read the Configuration file sections using StateT monad. But having some trouble. Can anyone please tell me how to do this? ...
I've written the following monad transformers (which I believe are equivalent to each other), namely: The purpose of these is that I basically want ...
I have experimented a little with the polysemy library and enjoyed working with the KVStore k v, which is simple abstraction of a Key-Value-Store. Now ...
As an exercise I've been reimplementing some common monads and their corresponding transformers; here are some of the types I've defined: As I get ...
I am trying to write a custom Akka SnapshotStore plugin. I am at the point where I want to implement this method: def loadAsync(persistenceId: Strin ...
There have been a couple of questions (e.g. this and this) asking whether every monad in Haskell (other than IO) has a corresponding monad transformer ...
I am trying to write some Scala code to have custom behaviour in an mtl style. For example, in order to expose the "write to DB" functionality abstrac ...
I managed to get compiling code for the monad transformer MaybeT. (I was following the haskell wikibook) However, I dont seem to manage to make my co ...