Advertisement
Guest User

Untitled

a guest
Jul 26th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {-# LANGUAGE ScopedTypeVariables #-}
  2.  
  3. import Control.Monad (void)
  4.  
  5. f1 :: forall m. MsgsRead m => m ()
  6. f1 = void (readMsgPayloads :: m [FooMsgPayload])
  7.  
  8. f2 :: MsgsWrite m => m ()
  9. f2 = writeMsgs [initMsg ZzzMsgA]
  10.  
  11. f3 :: forall m. (MsgsRead m, MsgsWrite m) => m ()
  12. f3 = do
  13.     void (readMsgPayloads :: m [BarMsgPayload])
  14.     writeMsgs [initMsg ZzzMsgC]
  15.  
  16. main :: IO ()
  17. main = runAppEnv $ f1 >> f2 >> f3  -- pretend this is doing something useful
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement