module Calamity.Client.Types
( Client(..)
, BotC
, SetupEff
, EHType
, EHType'
, EventHandlers(..)
, EventHandler(..) ) where
import Calamity.Metrics.Eff
import Calamity.Cache.Eff
import Calamity.Gateway.DispatchEvents
import Calamity.Gateway.Shard
import Calamity.HTTP.Internal.Types
import Calamity.LogEff
import Calamity.Types.Model.Channel
import Calamity.Types.Model.Guild
import Calamity.Types.Model.User
import Calamity.Types.Token
import Calamity.Types.UnixTimestamp
import Control.Concurrent.Async
import Control.Concurrent.MVar
import Control.Concurrent.STM.TQueue
import Control.Concurrent.STM.TVar
import Data.Default.Class
import Data.Dynamic
import Data.Time
import qualified Data.TypeRepMap as TM
import Data.TypeRepMap ( TypeRepMap, WrapTypeable(..) )
import GHC.Exts ( fromList )
import GHC.Generics
import qualified GHC.TypeLits as TL
import qualified Polysemy as P
import qualified Polysemy.Async as P
import qualified Polysemy.AtomicState as P
import qualified Polysemy.Reader as P
data Client = Client
{ Client -> TVar [(Shard, Async (Maybe ()))]
shards :: TVar [(Shard, Async (Maybe ()))]
, Client -> MVar Int
numShards :: MVar Int
, Client -> Token
token :: Token
, Client -> RateLimitState
rlState :: RateLimitState
, Client -> TQueue DispatchMessage
eventQueue :: TQueue DispatchMessage
}
deriving ( (forall x. Client -> Rep Client x)
-> (forall x. Rep Client x -> Client) -> Generic Client
forall x. Rep Client x -> Client
forall x. Client -> Rep Client x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Client x -> Client
$cfrom :: forall x. Client -> Rep Client x
Generic )
type BotC r =
( P.Members '[LogEff, MetricEff, CacheEff, P.Reader Client,
P.AtomicState EventHandlers, P.Embed IO, P.Final IO, P.Async] r
, Typeable r)
type SetupEff r = P.Sem (LogEff ': P.Reader Client ': P.AtomicState EventHandlers ': P.Async ': r) ()
type family EHType d m where
EHType "ready" m = ReadyData -> m ()
EHType "channelcreate" m = Channel -> m ()
EHType "channelupdate" m = Channel -> Channel -> m ()
EHType "channeldelete" m = Channel -> m ()
EHType "channelpinsupdate" m = Channel -> Maybe UTCTime -> m ()
EHType "guildcreate" m = Guild -> Bool -> m ()
EHType "guildupdate" m = Guild -> Guild -> m ()
EHType "guilddelete" m = Guild -> Bool -> m ()
EHType "guildbanadd" m = Guild -> User -> m ()
EHType "guildbanremove" m = Guild -> User -> m ()
EHType "guildemojisupdate" m = Guild -> [Emoji] -> m ()
EHType "guildintegrationsupdate" m = Guild -> m ()
EHType "guildmemberadd" m = Member -> m ()
EHType "guildmemberremove" m = Member -> m ()
EHType "guildmemberupdate" m = Member -> Member -> m ()
EHType "guildmemberschunk" m = Guild -> [Member] -> m ()
EHType "guildrolecreate" m = Guild -> Role -> m ()
EHType "guildroleupdate" m = Guild -> Role -> Role -> m ()
EHType "guildroledelete" m = Guild -> Role -> m ()
EHType "messagecreate" m = Message -> m ()
EHType "messageupdate" m = Message -> Message -> m ()
EHType "messagedelete" m = Message -> m ()
EHType "messagedeletebulk" m = [Message] -> m ()
EHType "messagereactionadd" m = Message -> Reaction -> m ()
EHType "messagereactionremove" m = Message -> Reaction -> m ()
EHType "messagereactionremoveall" m = Message -> m ()
EHType "typingstart" m = Channel -> Maybe Member -> UnixTimestamp -> m ()
EHType "userupdate" m = User -> User -> m ()
EHType s _ = TL.TypeError ('TL.Text "Unknown event name: " 'TL.:<>: 'TL.ShowType s)
type family EHType' d where
EHType' "ready" = Dynamic
EHType' "channelcreate" = Dynamic
EHType' "channelupdate" = Dynamic
EHType' "channeldelete" = Dynamic
EHType' "channelpinsupdate" = Dynamic
EHType' "guildcreate" = Dynamic
EHType' "guildupdate" = Dynamic
EHType' "guilddelete" = Dynamic
EHType' "guildbanadd" = Dynamic
EHType' "guildbanremove" = Dynamic
EHType' "guildemojisupdate" = Dynamic
EHType' "guildintegrationsupdate" = Dynamic
EHType' "guildmemberadd" = Dynamic
EHType' "guildmemberremove" = Dynamic
EHType' "guildmemberupdate" = Dynamic
EHType' "guildmemberschunk" = Dynamic
EHType' "guildrolecreate" = Dynamic
EHType' "guildroleupdate" = Dynamic
EHType' "guildroledelete" = Dynamic
EHType' "messagecreate" = Dynamic
EHType' "messageupdate" = Dynamic
EHType' "messagedelete" = Dynamic
EHType' "messagedeletebulk" = Dynamic
EHType' "messagereactionadd" = Dynamic
EHType' "messagereactionremove" = Dynamic
EHType' "messagereactionremoveall" = Dynamic
EHType' "typingstart" = Dynamic
EHType' "userupdate" = Dynamic
EHType' s = TL.TypeError ('TL.Text "Unknown event name: " 'TL.:<>: 'TL.ShowType s)
newtype EventHandlers = EventHandlers (TypeRepMap EventHandler)
newtype EventHandler d = EH
{ EventHandler d -> [EHType' d]
unwrapEventHandler :: [EHType' d]
}
deriving newtype ( b -> EventHandler d -> EventHandler d
NonEmpty (EventHandler d) -> EventHandler d
EventHandler d -> EventHandler d -> EventHandler d
(EventHandler d -> EventHandler d -> EventHandler d)
-> (NonEmpty (EventHandler d) -> EventHandler d)
-> (forall b. Integral b => b -> EventHandler d -> EventHandler d)
-> Semigroup (EventHandler d)
forall b. Integral b => b -> EventHandler d -> EventHandler d
forall a.
(a -> a -> a)
-> (NonEmpty a -> a)
-> (forall b. Integral b => b -> a -> a)
-> Semigroup a
forall (d :: Symbol). NonEmpty (EventHandler d) -> EventHandler d
forall (d :: Symbol).
EventHandler d -> EventHandler d -> EventHandler d
forall (d :: Symbol) b.
Integral b =>
b -> EventHandler d -> EventHandler d
stimes :: b -> EventHandler d -> EventHandler d
$cstimes :: forall (d :: Symbol) b.
Integral b =>
b -> EventHandler d -> EventHandler d
sconcat :: NonEmpty (EventHandler d) -> EventHandler d
$csconcat :: forall (d :: Symbol). NonEmpty (EventHandler d) -> EventHandler d
<> :: EventHandler d -> EventHandler d -> EventHandler d
$c<> :: forall (d :: Symbol).
EventHandler d -> EventHandler d -> EventHandler d
Semigroup, Semigroup (EventHandler d)
EventHandler d
Semigroup (EventHandler d) =>
EventHandler d
-> (EventHandler d -> EventHandler d -> EventHandler d)
-> ([EventHandler d] -> EventHandler d)
-> Monoid (EventHandler d)
[EventHandler d] -> EventHandler d
EventHandler d -> EventHandler d -> EventHandler d
forall a.
Semigroup a =>
a -> (a -> a -> a) -> ([a] -> a) -> Monoid a
forall (d :: Symbol). Semigroup (EventHandler d)
forall (d :: Symbol). EventHandler d
forall (d :: Symbol). [EventHandler d] -> EventHandler d
forall (d :: Symbol).
EventHandler d -> EventHandler d -> EventHandler d
mconcat :: [EventHandler d] -> EventHandler d
$cmconcat :: forall (d :: Symbol). [EventHandler d] -> EventHandler d
mappend :: EventHandler d -> EventHandler d -> EventHandler d
$cmappend :: forall (d :: Symbol).
EventHandler d -> EventHandler d -> EventHandler d
mempty :: EventHandler d
$cmempty :: forall (d :: Symbol). EventHandler d
$cp1Monoid :: forall (d :: Symbol). Semigroup (EventHandler d)
Monoid )
instance Default EventHandlers where
def :: EventHandlers
def = TypeRepMap EventHandler -> EventHandlers
EventHandlers (TypeRepMap EventHandler -> EventHandlers)
-> TypeRepMap EventHandler -> EventHandlers
forall a b. (a -> b) -> a -> b
$ [Item (TypeRepMap EventHandler)] -> TypeRepMap EventHandler
forall l. IsList l => [Item l] -> l
fromList [ EventHandler "ready" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "ready" -> Item (TypeRepMap EventHandler))
-> EventHandler "ready" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "ready"] -> EventHandler "ready"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"ready" []
, EventHandler "channelcreate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "channelcreate" -> Item (TypeRepMap EventHandler))
-> EventHandler "channelcreate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "channelcreate"] -> EventHandler "channelcreate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"channelcreate" []
, EventHandler "channelupdate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "channelupdate" -> Item (TypeRepMap EventHandler))
-> EventHandler "channelupdate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "channelupdate"] -> EventHandler "channelupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"channelupdate" []
, EventHandler "channeldelete" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "channeldelete" -> Item (TypeRepMap EventHandler))
-> EventHandler "channeldelete" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "channeldelete"] -> EventHandler "channeldelete"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"channeldelete" []
, EventHandler "channelpinsupdate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "channelpinsupdate"
-> Item (TypeRepMap EventHandler))
-> EventHandler "channelpinsupdate"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "channelpinsupdate"] -> EventHandler "channelpinsupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"channelpinsupdate" []
, EventHandler "guildcreate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildcreate" -> Item (TypeRepMap EventHandler))
-> EventHandler "guildcreate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildcreate"] -> EventHandler "guildcreate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildcreate" []
, EventHandler "guildupdate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildupdate" -> Item (TypeRepMap EventHandler))
-> EventHandler "guildupdate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildupdate"] -> EventHandler "guildupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildupdate" []
, EventHandler "guilddelete" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guilddelete" -> Item (TypeRepMap EventHandler))
-> EventHandler "guilddelete" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guilddelete"] -> EventHandler "guilddelete"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guilddelete" []
, EventHandler "guildbanadd" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildbanadd" -> Item (TypeRepMap EventHandler))
-> EventHandler "guildbanadd" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildbanadd"] -> EventHandler "guildbanadd"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildbanadd" []
, EventHandler "guildbanremove" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildbanremove" -> Item (TypeRepMap EventHandler))
-> EventHandler "guildbanremove" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildbanremove"] -> EventHandler "guildbanremove"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildbanremove" []
, EventHandler "guildemojisupdate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildemojisupdate"
-> Item (TypeRepMap EventHandler))
-> EventHandler "guildemojisupdate"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildemojisupdate"] -> EventHandler "guildemojisupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildemojisupdate" []
, EventHandler "guildintegrationsupdate"
-> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildintegrationsupdate"
-> Item (TypeRepMap EventHandler))
-> EventHandler "guildintegrationsupdate"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildintegrationsupdate"]
-> EventHandler "guildintegrationsupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildintegrationsupdate" []
, EventHandler "guildmemberadd" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildmemberadd" -> Item (TypeRepMap EventHandler))
-> EventHandler "guildmemberadd" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildmemberadd"] -> EventHandler "guildmemberadd"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildmemberadd" []
, EventHandler "guildmemberremove" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildmemberremove"
-> Item (TypeRepMap EventHandler))
-> EventHandler "guildmemberremove"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildmemberremove"] -> EventHandler "guildmemberremove"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildmemberremove" []
, EventHandler "guildmemberupdate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildmemberupdate"
-> Item (TypeRepMap EventHandler))
-> EventHandler "guildmemberupdate"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildmemberupdate"] -> EventHandler "guildmemberupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildmemberupdate" []
, EventHandler "guildrolecreate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildrolecreate" -> Item (TypeRepMap EventHandler))
-> EventHandler "guildrolecreate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildrolecreate"] -> EventHandler "guildrolecreate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildrolecreate" []
, EventHandler "guildroleupdate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildroleupdate" -> Item (TypeRepMap EventHandler))
-> EventHandler "guildroleupdate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildroleupdate"] -> EventHandler "guildroleupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildroleupdate" []
, EventHandler "guildroledelete" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "guildroledelete" -> Item (TypeRepMap EventHandler))
-> EventHandler "guildroledelete" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "guildroledelete"] -> EventHandler "guildroledelete"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"guildroledelete" []
, EventHandler "messagecreate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "messagecreate" -> Item (TypeRepMap EventHandler))
-> EventHandler "messagecreate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "messagecreate"] -> EventHandler "messagecreate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"messagecreate" []
, EventHandler "messageupdate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "messageupdate" -> Item (TypeRepMap EventHandler))
-> EventHandler "messageupdate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "messageupdate"] -> EventHandler "messageupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"messageupdate" []
, EventHandler "messagedelete" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "messagedelete" -> Item (TypeRepMap EventHandler))
-> EventHandler "messagedelete" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "messagedelete"] -> EventHandler "messagedelete"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"messagedelete" []
, EventHandler "messagedeletebulk" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "messagedeletebulk"
-> Item (TypeRepMap EventHandler))
-> EventHandler "messagedeletebulk"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "messagedeletebulk"] -> EventHandler "messagedeletebulk"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"messagedeletebulk" []
, EventHandler "messagereactionadd" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "messagereactionadd"
-> Item (TypeRepMap EventHandler))
-> EventHandler "messagereactionadd"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "messagereactionadd"] -> EventHandler "messagereactionadd"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"messagereactionadd" []
, EventHandler "messagereactionremove"
-> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "messagereactionremove"
-> Item (TypeRepMap EventHandler))
-> EventHandler "messagereactionremove"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "messagereactionremove"]
-> EventHandler "messagereactionremove"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"messagereactionremove" []
, EventHandler "messagereactionremoveall"
-> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "messagereactionremoveall"
-> Item (TypeRepMap EventHandler))
-> EventHandler "messagereactionremoveall"
-> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "messagereactionremoveall"]
-> EventHandler "messagereactionremoveall"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"messagereactionremoveall" []
, EventHandler "typingstart" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "typingstart" -> Item (TypeRepMap EventHandler))
-> EventHandler "typingstart" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "typingstart"] -> EventHandler "typingstart"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"typingstart" []
, EventHandler "userupdate" -> Item (TypeRepMap EventHandler)
forall k (a :: k) (f :: k -> *).
Typeable a =>
f a -> WrapTypeable f
WrapTypeable (EventHandler "userupdate" -> Item (TypeRepMap EventHandler))
-> EventHandler "userupdate" -> Item (TypeRepMap EventHandler)
forall a b. (a -> b) -> a -> b
$ [EHType' "userupdate"] -> EventHandler "userupdate"
forall (d :: Symbol). [EHType' d] -> EventHandler d
EH @"userupdate" []
]
instance Semigroup EventHandlers where
(EventHandlers a :: TypeRepMap EventHandler
a) <> :: EventHandlers -> EventHandlers -> EventHandlers
<> (EventHandlers b :: TypeRepMap EventHandler
b) = TypeRepMap EventHandler -> EventHandlers
EventHandlers (TypeRepMap EventHandler -> EventHandlers)
-> TypeRepMap EventHandler -> EventHandlers
forall a b. (a -> b) -> a -> b
$ (forall (x :: Symbol).
Typeable x =>
EventHandler x -> EventHandler x -> EventHandler x)
-> TypeRepMap EventHandler
-> TypeRepMap EventHandler
-> TypeRepMap EventHandler
forall k (f :: k -> *).
(forall (x :: k). Typeable x => f x -> f x -> f x)
-> TypeRepMap f -> TypeRepMap f -> TypeRepMap f
TM.unionWith forall a. Semigroup a => a -> a -> a
forall (x :: Symbol).
Typeable x =>
EventHandler x -> EventHandler x -> EventHandler x
(<>) TypeRepMap EventHandler
a TypeRepMap EventHandler
b
instance Monoid EventHandlers where
mempty :: EventHandlers
mempty = EventHandlers
forall a. Default a => a
def