X.Core: Simplify DerivingVia instances

Fixes: cd86480ff7ff30eb7685b6281ce3e891497d2661

Co-authored-by: L. S. Leary <LSLeary@users.noreply.github.com>
This commit is contained in:
Tony Zorman 2022-11-19 11:21:50 +01:00
parent 6e35910b62
commit be8fd7fdc9

View File

@ -167,7 +167,7 @@ newtype ScreenDetail = SD { screenRect :: Rectangle }
-- --
newtype X a = X (ReaderT XConf (StateT XState IO) a) newtype X a = X (ReaderT XConf (StateT XState IO) a)
deriving (Functor, Applicative, Monad, MonadFail, MonadIO, MonadState XState, MonadReader XConf) deriving (Functor, Applicative, Monad, MonadFail, MonadIO, MonadState XState, MonadReader XConf)
deriving (Semigroup, Monoid) via Ap (ReaderT XConf (StateT XState IO)) a deriving (Semigroup, Monoid) via Ap X a
instance Default a => Default (X a) where instance Default a => Default (X a) where
def = return def def = return def
@ -175,7 +175,7 @@ instance Default a => Default (X a) where
type ManageHook = Query (Endo WindowSet) type ManageHook = Query (Endo WindowSet)
newtype Query a = Query (ReaderT Window X a) newtype Query a = Query (ReaderT Window X a)
deriving (Functor, Applicative, Monad, MonadReader Window, MonadIO) deriving (Functor, Applicative, Monad, MonadReader Window, MonadIO)
deriving (Semigroup, Monoid) via Ap (ReaderT Window X) a deriving (Semigroup, Monoid) via Ap Query a
runQuery :: Query a -> Window -> X a runQuery :: Query a -> Window -> X a
runQuery (Query m) = runReaderT m runQuery (Query m) = runReaderT m