我正在尝试在Haskell中拆分列表,我想导入Data.List.Split。 但是,我看到此错误:
a.hs:2:1: error:
Could not find module ‘Data.List.Split’
Use -v to see a list of the files searched for.
|
2 | import Data.List.Split
| ^^^^^^^^^^^^^^^^^^^^^^
Failed, no modules loaded.
这是我的代码:
module PoemLines where
import Data.List.Split
firstSen = "Tyger Tyger, burning bright\n"
secondSen = "In the forests of the night\n"
thirdSen = "What immortal hand or eye\n"
fourthSen = "Could frame thy fearful symmetry?"
sentences = firstSen ++ secondSen ++ thirdSen ++ fourthSen
myLines :: String -> [String]
myLines x = undefined
shouldEqual =
[ "Tyger Tyger, burning bright"
, "In the forests of the night"
, "What immortal hand or eye"
, "Could frame thy fearful symmetry?"
]
main :: IO ()
main =
print $ "Are they equal? "
++ show (myLines sentences == shouldEqual)
该如何解决?谢谢。