Haskell:找不到模块“ Data.List.Split”

时间:2018-10-13 11:55:41

标签: haskell

我正在尝试在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)

该如何解决?谢谢。

0 个答案:

没有答案