From d6773ba47f9e743eb9849b4bfede6c571551a5f4 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sun, 18 Oct 2020 22:24:07 -0400 Subject: [PATCH] Parse command symbols into the void. --- src/Facet/REPL/Parser.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Facet/REPL/Parser.hs b/src/Facet/REPL/Parser.hs index c8a9e2d85..6cc2e724a 100644 --- a/src/Facet/REPL/Parser.hs +++ b/src/Facet/REPL/Parser.hs @@ -8,6 +8,7 @@ module Facet.REPL.Parser ) where import Control.Applicative (Alternative(..)) +import Data.Functor (void) import Text.Parser.Char import Text.Parser.Combinators import Text.Parser.Position @@ -34,9 +35,9 @@ parseCommands = choice . map go where go c = parseSymbols (symbols c) *> parseValue (value c) parseSymbols = \case - [] -> pure "" + [] -> pure () ss -> choice (map parseSymbol ss) - parseSymbol s = token (try (string (':':s) <* (eof <|> someSpace))) (':':s) + parseSymbol s = void $ token (try (string (':':s) <* (eof <|> someSpace))) (':':s) parseValue = \case Pure a -> pure a Meta _ p -> p