From bf1034609caf8b353fe0d05a3773e24de0cb33ec Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Mon, 4 Feb 2008 20:23:48 +0100 Subject: Core.hs: add an Applicative instance for X darcs-hash:20080204192348-bd4d7-6a4edc163de3ea931a60050e4ad107390afc972e.gz --- XMonad/Core.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'XMonad/Core.hs') diff --git a/XMonad/Core.hs b/XMonad/Core.hs index d7ea521..ea84bd6 100644 --- a/XMonad/Core.hs +++ b/XMonad/Core.hs @@ -121,6 +121,10 @@ newtype X a = X (ReaderT XConf (StateT XState IO) a) deriving (Functor, Monad, MonadIO, MonadState XState, MonadReader XConf) #endif +instance Applicative X where + pure = return + (<*>) = ap + instance (Monoid a) => Monoid (X a) where mempty = return mempty mappend = liftM2 mappend -- cgit v1.2.3