Overriding handler / interpose
ing: how to fordward actions?
#87
-
For this effect: data E :: Effect where
Op :: E m ()
Op2 :: Eff (E ': es) a -> E m () when runE = interpret $ \_ -> \case
...
Op2 action -> interpose $ \env act -> liftIO (print "augmented) >> send act
... To be precise, in this case, I want to send a signal when any If above is not possible, I am fine with this (if it will work): runE = <real handling here>
runIfInsideOp2 = interpose $ \_ act ->
if insideOp2
then liftIO (putStrLn "signal") >> send act
else send act
finalIO = runEff . <other handlers> . runE . runIfInsideOp2 However, for above, I am getting this error:
Edit: Thanks a lot for this library. It is great! :-D |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 12 replies
-
Thanks 🙂 I'm not sure what you're trying to do and the code doesn't really tell me this (the snippets are not valid code that can generate relevant compile errors). Can you elaborate and provide better code samples? |
Beta Was this translation helpful? Give feedback.
Thanks 🙂
I'm not sure what you're trying to do and the code doesn't really tell me this (the snippets are not valid code that can generate relevant compile errors). Can you elaborate and provide better code samples?