add instance MonadMask (EventM n)

This commit is contained in:
Fraser Tweedale 2020-02-06 10:59:56 +10:00
parent 8bfff26b39
commit dde8ccf5df
2 changed files with 6 additions and 1 deletions

View File

@ -118,6 +118,7 @@ library
data-clist >= 0.1,
directory >= 1.2.5.0,
dlist,
exceptions >= 0.10.0,
filepath,
containers >= 0.5.7,
microlens >= 0.3.0.0,

View File

@ -88,6 +88,7 @@ import Data.Monoid (Monoid(..))
import Lens.Micro (_1, _2, to, (^.), (&), (.~), Lens')
import Lens.Micro.Type (Getting)
import Control.Monad.Catch (MonadThrow, MonadCatch, MonadMask)
import Control.Monad.Trans.State.Lazy
import Control.Monad.Trans.Reader
import Graphics.Vty (Attr)
@ -128,7 +129,10 @@ handleEventLensed v target handleEvent ev = do
newtype EventM n a =
EventM { runEventM :: ReaderT (EventRO n) (StateT (EventState n) IO) a
}
deriving (Functor, Applicative, Monad, MonadIO)
deriving
( Functor, Applicative, Monad, MonadIO
, MonadThrow, MonadCatch, MonadMask
)
-- | Widget size policies. These policies communicate how a widget uses
-- space when being rendered. These policies influence rendering order