mirror of
https://github.com/xmonad/xmonad.git
synced 2025-08-01 20:51:55 -07:00
Fix -Wnoncanonical-monad-instances, -Wnoncanonical-monoid-instances
This commit is contained in:
@@ -156,18 +156,13 @@ newtype ScreenDetail = SD { screenRect :: Rectangle }
|
|||||||
-- instantiated on 'XConf' and 'XState' automatically.
|
-- instantiated on 'XConf' and 'XState' automatically.
|
||||||
--
|
--
|
||||||
newtype X a = X (ReaderT XConf (StateT XState IO) a)
|
newtype X a = X (ReaderT XConf (StateT XState IO) a)
|
||||||
deriving (Functor, Monad, MonadFail, MonadIO, MonadState XState, MonadReader XConf)
|
deriving (Functor, Applicative, Monad, MonadFail, MonadIO, MonadState XState, MonadReader XConf)
|
||||||
|
|
||||||
instance Applicative X where
|
|
||||||
pure = return
|
|
||||||
(<*>) = ap
|
|
||||||
|
|
||||||
instance Semigroup a => Semigroup (X a) where
|
instance Semigroup a => Semigroup (X a) where
|
||||||
(<>) = liftM2 (<>)
|
(<>) = liftM2 (<>)
|
||||||
|
|
||||||
instance (Monoid a) => Monoid (X a) where
|
instance (Monoid a) => Monoid (X a) where
|
||||||
mempty = return mempty
|
mempty = pure mempty
|
||||||
mappend = liftM2 mappend
|
|
||||||
|
|
||||||
instance Default a => Default (X a) where
|
instance Default a => Default (X a) where
|
||||||
def = return def
|
def = return def
|
||||||
@@ -183,8 +178,7 @@ instance Semigroup a => Semigroup (Query a) where
|
|||||||
(<>) = liftM2 (<>)
|
(<>) = liftM2 (<>)
|
||||||
|
|
||||||
instance Monoid a => Monoid (Query a) where
|
instance Monoid a => Monoid (Query a) where
|
||||||
mempty = return mempty
|
mempty = pure mempty
|
||||||
mappend = liftM2 mappend
|
|
||||||
|
|
||||||
instance Default a => Default (Query a) where
|
instance Default a => Default (Query a) where
|
||||||
def = return def
|
def = return def
|
||||||
|
Reference in New Issue
Block a user