Java プログラムを Haskell に変換しようとしています。私の目標は、文字列をいくつかの文字列に分割し、これらをリスト内に配置することです。
これはこれまでの私のコードです
import Char
import IO
import Text.Regex
translate :: String -> Int
translate input =
testcode(splitRegex (mkRegex "\\s") input)
testcode は、最初の値が何であるかに応じていくつかのテストを行います。
testcode :: [String] -> Int -> Int
testcode [] 0
testcode (x:xs) n
|(x=="test") = 1
|otherwise = testcode xs
私が取得し続けるコンパイルエラーは次のとおりです。
Could not find module `Text.Regex'
Perhaps you meant Text.Read (from base)
Text.Regex をインポートするにはどうすればよいですか?