on master help sign in
Fix PerformEvent instance for FrontendConfigsT
commit71013ad2a0e7d1c9eb1f91fdf3ec0899baa6308e authorKen Micklas <kmicklas@gmail.com> dateThu 2 May 2019, 09:41 (7 years ago) parent9acd90a
1 file changed+7−1
lib/executable-config/frontend/src/Obelisk/ExecutableConfig/Frontend.hs+7−1
lib/executable-config/frontend/src/Obelisk/ExecutableConfig/Frontend.hs+7−1
@@ -68,7 +68,6 @@ newtype FrontendConfigsT m a = FrontendConfigsT { unFrontendConfigsT :: ReaderT
6868 , MonadSample t
6969 , MonadTrans
7070 , NotReady t
71− , PerformEvent t
7271 , PostBuild t
7372 , TriggerEvent t
7473 , HasDocument
@@ -77,6 +76,13 @@ newtype FrontendConfigsT m a = FrontendConfigsT { unFrontendConfigsT :: ReaderT
7776 , HasJS js
7877 )
7978
79+instance PerformEvent t m => PerformEvent t (FrontendConfigsT m) where
80+ type Performable (FrontendConfigsT m) = FrontendConfigsT (Performable m)
81+ performEvent e = FrontendConfigsT $ ReaderT $ \configs ->
82+ performEvent $ runFrontendConfigsT configs <$> e
83+ performEvent_ e = FrontendConfigsT $ ReaderT $ \configs ->
84+ performEvent_ $ runFrontendConfigsT configs <$> e
85+
8086instance Adjustable t m => Adjustable t (FrontendConfigsT m) where
8187 runWithReplace a e = FrontendConfigsT $ runWithReplace (unFrontendConfigsT a) (unFrontendConfigsT <$> e)
8288 traverseDMapWithKeyWithAdjust f m e = FrontendConfigsT $ traverseDMapWithKeyWithAdjust (\k v -> unFrontendConfigsT $ f k v) m e