Rearranging effect order #91
Answered
by
arybczak
chris-martin
asked this question in
Q&A
-
Is it possible to define the following function? swap :: Eff (e1 ': e2 ': es) a -> Eff (e2 ': e1 ': es) a I had hoped I might be able to write: swap = inject But the error I get is:
... which is disappointing, because clearly any |
Beta Was this translation helpful? Give feedback.
Answered by
arybczak
Aug 22, 2022
Replies: 1 comment 6 replies
-
Currently This isn't particularly satisfying and I'm pretty sure through a clever trick |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
chris-martin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently
inject
only works if you deal with monomorphic stacks (as then GHC just solves the constraint) or if you pass theSubset
evidence around.This isn't particularly satisfying and I'm pretty sure through a clever trick
Subset
can be modified to auto resolve with stacks that share an opaque tail, I just didn't look at this in depth yet.