我编写了通过二进制搜索在元组的索引列表中搜索的程序我编写并且工作正常
superBubble::(Ord t) =>[[t]]->[[t]]
superBubble a=map bubbleSort a
combining::[BookInfo]->[Int]
combining books= bubbleSort(map index books)
binsearch :: [Int] -> Int -> Int -> Int -> Int -- list, value, low, high, return int
binsearch xs value low high
| high < low = -1
| xs!!mid > value = binsearch xs value low (mid-1)
| xs!!mid < value = binsearch xs value (mid+1) high
| otherwise = mid
where
mid = low + ((high - low) `div` 2)
final::[BookInfo]->Int->Int->Int->Int
final vs key s r= binsearch concat( combining vs) key s r
并且其他功能正常工作但是当我将它添加到孔中时会给我一个错误
错误是 unexcpted '|' 第一个,但为什么?