我的程序正在搜索 我写的元组列表如下
import List
data BookInfo = Book Int String [String]
deriving(Show)
enter :: Int->String->[String]->BookInfo
enter id name subject=Book id name subject
bookId (Book id _ _ ) = id
index :: BookInfo -> Int
index (Book id name subject) = bookId (Book id name subject)
arrayentering ::BookInfo->[BookInfo]->[BookInfo]
arrayentering (Book id name subject) [] =[(Book id name subject)]
arrayentering (Book _ " " [" "]) [] =[]
arrayentering (Book id name subject) [(Book it namr suject)]=
(Book id name subject):[(Book it name suject)]
toList::[BookInfo]->[Int]
toList [(Book id name subject) ]= map index [ (Book id name subject)]
bubbleSort::(Ord t) => [t]->[t]
bubbleSort[x,y,z,xs]=
if x<y then x : [y,z,xs]
else y : [x,z,xs]
superBubble::(Ord t) => [[t]]->[[t]]
superBubble a=map bubbleSort a
combining::[BookInfo]->[[Int]]
combining [(Book id name subject)]=superBubble [toList [(Book id name subject)]]
并从任何语法错误中清除它,但是在我尝试输入一个元组列表之后,combining()
它会给我运行时错误说
Exception:Not Exhaustive pattern in function Main.combining
这是什么意思?
请只给我指示。如果可能的话,我想自己修复它。