From 67529f64f1a5a2815287021d60ffa361f51df1f7 Mon Sep 17 00:00:00 2001 From: Torsten Schmits Date: Sat, 7 Oct 2023 00:12:21 +0200 Subject: [PATCH] export some menu actions --- packages/menu/lib/Ribosome/Menu.hs | 3 +++ packages/menu/lib/Ribosome/Menu/Loop.hs | 11 +---------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/packages/menu/lib/Ribosome/Menu.hs b/packages/menu/lib/Ribosome/Menu.hs index ed8cde6..4496e9b 100644 --- a/packages/menu/lib/Ribosome/Menu.hs +++ b/packages/menu/lib/Ribosome/Menu.hs @@ -41,6 +41,9 @@ import Ribosome.Menu.Action ( menuToggle, menuToggleAll, menuUpdatePrompt, + menuUpdatePromptState, + menuAttachPrompt, + menuDetachPrompt, ) import Ribosome.Menu.App (MenuApp, PromptApp, builtinHandlers, defaultHandlers, insert, promptControl, withInsert) import Ribosome.Menu.Data.Entry (Entries, Entry) diff --git a/packages/menu/lib/Ribosome/Menu/Loop.hs b/packages/menu/lib/Ribosome/Menu/Loop.hs index 5198aad..be8e130 100644 --- a/packages/menu/lib/Ribosome/Menu/Loop.hs +++ b/packages/menu/lib/Ribosome/Menu/Loop.hs @@ -6,7 +6,7 @@ import qualified Log import qualified Streamly.Prelude as Stream import Streamly.Prelude (SerialT) -import Ribosome.Data.Mapping (MappingLhs (MappingLhs), MappingSpec) +import Ribosome.Data.Mapping (MappingLhs, MappingSpec) import Ribosome.Host.Data.RpcError (RpcError) import Ribosome.Menu.Action (MenuActionSem) import qualified Ribosome.Menu.App @@ -69,15 +69,6 @@ menuAction = \case MenuAction.Quit result -> pure (PromptAction.Quit result) -mappingResult :: - Members [MenuCore, Reader PromptState, Log] r => - MappingLhs -> - MenuAction result -> - Sem r (PromptAction (MenuResult result)) -mappingResult (MappingLhs trigger) action = do - Log.debug [exon|menu mapping #{trigger}: #{MenuAction.describe action}|] - menuAction action - handleMapping :: Members [MenuCore, Reader PromptState, Log] r => (InputParams -> Maybe (MenuActionSem r result)) ->