我添加了最后一个函数和重要性函数 -bSearch()
并将其链接combining()
如下
combining::[BookInfo]->[[Int]]
combining books=superBubble [(map index books)]
bSearch [xs] key s
if length[xs] <> s then return 9999
else
if
key=m then elemIndex m [xs]
else
if key<m then bsearch (splitAt (x:xs) o) key o
else bsearch (splitAt ms (o+2) ) key n
o<-s/2-1
n<-length ms
finalBsearch::(Ord)=> [a]->a->a->Int
finalBsearch ms key s= bsearch (combining [ms]) key s
但它Syntax error in input (unexpected keyword "if")
在第 5 行给了我一个错误谢谢你的帮助=有关完整代码的更多详细信息,请参阅Haskell 中的运行时错误
但请给我指示,而不是完整的解决方案