Is it possible to Implement monad memo as an effect? more generally can we branch on existing effects? #212
Unanswered
eldritch-cookie
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Where is this implemented? I see |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
monad-memo is a library to memoize computations in monad transformers stacks,
The interesting thing is that each instance depends on the underlying transformer, so an effect that correctly implements monad memo would need to be "aware" of all other effects,
So i wanted to make something more simple first can we get an effect e that returns an integer saying how many effects there are?
this seems easy given that in a internal module there is a sizeEnv function.
if so can we store a value in each effect layer?
i am fairly certain i could hack something with typeclasses but then we would fall in the N^2 instances problem wouldn't we? also i am fairly certain that such a solution would have to deal with defunctionalization symbols due to needing to apply a type family to a list of effects.
Beta Was this translation helpful? Give feedback.
All reactions