2012-07-17 3 views
-1

이것은 "튜플 프로그램의 목록에서 검색"내된다 ERROR line 2 - Syntax error in input (unexpected keyword "import") :수입 예외

import Data.List 
    import Data.Char 
    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 book bookList 
     | empty book = bookList 
     | otherwise = book : bookList 
     where 
     empty (Book _ name subject) = all isSpace name && all (all isSpace) 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 books=superBubble [(map index books)] 

      bsearch :: [[a]]-> a -> a -> Int 
      bsearch ms key s 

        | elemtIndex m ms = s return 9999 
        | 
        key=m elemIndex m ms 
        | 
        key<m bsearch (splitAt ms o) key o 
        | otherwise 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 

를 컴파일하려고하면 오류가 발생합니다.

이것은 무엇을 의미하며 어떻게 수정합니까?

답변

1

두 번째 줄을 들여 썼습니까?

import Data.List 
import Data.Char 

이 경우, 파서는 1 개 문은하지

+0

2. 오류가 어디 있는지 알고 도움을 유 감사 있다고 생각합니다 –