2
在Windows上使用GHC時崩潰。它在Linux上完美運行。正則表達式替換在Windows上使用正則表達式compat
這是否有意義或有錯誤?
module Main where
import qualified Text.Regex as Re -- from regex-compat
import Debug.Trace
main :: IO()
main = do
putStr $ cleanWord "jan"
putStr $ cleanWord "dec"
putStr $ cleanWord "jun" -- crashes here
cleanWord :: String -> String
cleanWord word_ =
let word = trace (show word_) word_ in
let re = Re.mkRegexWithOpts "(jun|jul|aug|sep|oct|nov|dec)" True False in
Re.subRegex re word ""
一些額外的細節
- 我與
stack
- 它崩潰在這兩個GHCI和運行編譯可執行建設
- 我試圖啓用分析,但似乎無法人物瞭解如何才能正常工作。
另外,什麼是例外? – Alec
@Zeta更新,其regex-compat – Andre
@Alec程序崩潰,控制檯輸出中沒有任何內容。 – Zeta