From 27777de6f100ab09b8df2f50323b0b22fb2f4afc 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 --- XMonad/Core.hs | 4 ++++ 1 file changed, 4 insertions(+) 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