Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {-# LANGUAGE ScopedTypeVariables #-}
- import Control.Monad (void)
- f1 :: forall m. MsgsRead m => m ()
- f1 = void (readMsgPayloads :: m [FooMsgPayload])
- f2 :: MsgsWrite m => m ()
- f2 = writeMsgs [initMsg ZzzMsgA]
- f3 :: forall m. (MsgsRead m, MsgsWrite m) => m ()
- f3 = do
- void (readMsgPayloads :: m [BarMsgPayload])
- writeMsgs [initMsg ZzzMsgC]
- main :: IO ()
- main = runAppEnv $ f1 >> f2 >> f3 -- pretend this is doing something useful
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement