I add the last function and importance function – bSearch() and link it with combining() as following
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
but it give me an error Syntax error in input (unexpected keyword "if") at line 5
thank u for help
= for more details about the full code see runtime error in Haskell
But please give me instructions only not full solution
For a quick fix, enclose the whole
if–then–elseexpression in parentheses:(–). But this will fix only this error message. Your code contains many more errors. I can’t tell what you expect this code to do.Instead of using cascading
if–then–elses, you may find it clearer to use guards.n.b. You do not have an exception; you have a compilation error.