From 7029f5b4069b643561780dbc6317358a7a7d2b11 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Tue, 18 Aug 2026 23:16:05 +0100 Subject: startsWith = flip isPrefixOf --- src/Ghci.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ghci.hs b/src/Ghci.hs index a36c05e..d3540cb 100644 --- a/src/Ghci.hs +++ b/src/Ghci.hs @@ -24,7 +24,7 @@ import qualified Data.ByteString.Lazy.UTF8 as LUTF8 import Data.ByteString.Short (ShortByteString) import qualified Data.ByteString.Short as BSS import Data.Char (isSpace, toLower) -import Data.List (nub) +import Data.List (nub, isPrefixOf) import Foreign (allocaBytes) import System.IO (hFlush, hIsClosed, hGetBufSome, hPutStrLn, stdout, stderr, Handle) import System.Process @@ -111,7 +111,7 @@ runStmtClever ghci pset line = _ -> runStmt ghci pset line where startsWith :: String -> String -> Bool - long `startsWith` short = take (length short) long == short + long `startsWith` short = short `isPrefixOf` long runStmt :: Ghci -> ParseSettings -> String -> IO (Ghci, Result String) runStmt ghci pset line = do -- cgit v1.3.1