1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

🔥 the Carrier instance.

This commit is contained in:
Rob Rix 2019-10-10 15:54:54 -04:00
parent 81d1a1117e
commit 742db3d17e
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -62,9 +62,6 @@ newtype ControlIOC m a = ControlIOC { runControlIO :: m a }
instance MonadUnliftIO m => MonadUnliftIO (ControlIOC m) where
withRunInIO inner = ControlIOC $ withRunInIO $ \ go -> inner (go . runControlIO)
instance Carrier sig m => Carrier sig (ControlIOC m) where
eff op = ControlIOC (eff (handleCoercible op))
instance MonadUnliftIO m => MonadException (ControlIOC m) where
controlIO f = withRunInIO (\ runInIO -> f (RunIO (fmap pure . runInIO)) >>= runInIO)