-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binding for co-log #10
Comments
Hi, I would like to work on this issue, but I am stuck on choosing the right Monad After some trying around I came up with this: data Log :: (Type -> Type) -> Type -> Effect
type instance DispatchOf (Log m msg) = 'Static
data instance StaticRep (Log m msg) = Log (LogAction m msg)
runLog :: LogAction (Eff es) msg -> Eff (Log (Eff es) msg ': es) a -> Eff es a
runLog = evalStaticRep . Log
logMsg :: Log (Eff es) msg :> es => msg -> Eff es ()
logMsg msg = do
Log (LogAction action) <- getStaticRep
action msg However this does not work because the logMsg :: (Log (Eff logEffects) msg :> allEffects, Subset logEffects allEffects) => msg -> Eff allEffects () Another way i can think of is just fixing the Monad to data Log :: Type -> Effect
data instance StaticRep (Log msg) = Log (LogAction IO msg) I think, if the Basically my question is: what is the best way to move forward? |
Looks like this will be solved soon: haskell-effectful/effectful#52 I will use this new class as the |
I don't think it's going to work as you'd expect it to. I'm not familiar with Also the StaticRep instance should be a |
Thanks for the feedback. |
co-log
The text was updated successfully, but these errors were encountered: