From 394fadec12950840b8f426e9d93341aece1c69d2 Mon Sep 17 00:00:00 2001 From: solomon Date: Sun, 11 Dec 2022 00:02:51 -0800 Subject: [PATCH] Remove KBot Kind Signature --- chat-bots/src/Data/Chat/Bot.hs | 5 ----- chat-bots/src/Data/Chat/Bot/Context.hs | 6 +++--- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/chat-bots/src/Data/Chat/Bot.hs b/chat-bots/src/Data/Chat/Bot.hs index 0066ad9..f734890 100644 --- a/chat-bots/src/Data/Chat/Bot.hs +++ b/chat-bots/src/Data/Chat/Bot.hs @@ -1,12 +1,10 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE ConstraintKinds #-} {-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ViewPatterns #-} module Data.Chat.Bot ( -- * Bot Bot (..), - KBot, invmapBot, mapMaybeBot, pureStatelessBot, @@ -41,7 +39,6 @@ import Control.Applicative (asum) import Data.Foldable (asum) #endif import Data.Functor ((<&>)) -import Data.Kind import Data.Profunctor import Data.Profunctor.Traversing import Data.Text qualified as T @@ -50,8 +47,6 @@ import System.FilePath -------------------------------------------------------------------------------- -type KBot = (Type -> Type) -> Type -> Type -> Type -> Type - -- | A 'Bot' maps from some input type 'i' and a state 's' to an -- output type 'o' and a state 's' newtype Bot m s i o = Bot {runBot :: s -> i -> ListT m (o, s)} diff --git a/chat-bots/src/Data/Chat/Bot/Context.hs b/chat-bots/src/Data/Chat/Bot/Context.hs index 5b8214d..b23e02e 100644 --- a/chat-bots/src/Data/Chat/Bot/Context.hs +++ b/chat-bots/src/Data/Chat/Bot/Context.hs @@ -36,11 +36,11 @@ import Data.Profunctor (second') import Data.Text (Text) import Data.Text qualified as Text import Network.Matrix.Client +import Data.Kind (Type) -------------------------------------------------------------------------------- -type RoomAware :: KBot -> KBot -type RoomAware bot m s i o = bot m s (RoomID, i) (RoomID, o) +type RoomAware bot (m :: Type -> Type) s i o = bot m s (RoomID, i) (RoomID, o) -- | Make a bot "room aware" by tensoring its input and output with a 'RoomID'. -- @@ -51,7 +51,7 @@ mkRoomAware = second' -------------------------------------------------------------------------------- -type UserAware bot m s i o = bot m s (UserID, i) (UserID, o) +type UserAware bot (m :: Type -> Type) s i o = bot m s (UserID, i) (UserID, o) -- | Make a bot "user aware" by tensoring its input and output with a 'UserID'. --