diff options
| author | Tom Smeding <tom@tomsmeding.com> | 2026-08-19 00:16:05 +0200 |
|---|---|---|
| committer | Tom Smeding <tom@tomsmeding.com> | 2026-08-19 00:16:05 +0200 |
| commit | 7029f5b4069b643561780dbc6317358a7a7d2b11 (patch) | |
| tree | f93382ff6b646f6c3366fa94a998d088f7af1048 /src | |
| parent | 69a9851747520b6f1cb39664cb6cb7e887a37037 (diff) | |
startsWith = flip isPrefixOf
Diffstat (limited to 'src')
| -rw-r--r-- | src/Ghci.hs | 4 |
1 files 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 |
