Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8254331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:09:09+00:00 2026-06-08T01:09:09+00:00

This is my searching in list of tuples program: import Data.List import Data.Char data

  • 0

This is my “searching in list of tuples program”:

   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  

Trying to compile it causes an error:
ERROR line 2 - Syntax error in input (unexpected keyword "import").

What does this mean and how do I fix it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:09:11+00:00Added an answer on June 8, 2026 at 1:09 am

    Did you indent the second line like this?

    import Data.List
     import Data.Char
    

    If so, the parser will think there is 1 statement not 2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My program is searching in list of tuples I wrote it as the following
This seems like a foolishly simple problem. I'm searching through a list of users,
I am not certain about this and searching a bit hasn't turned up anything
Test Page URL: http://www.guygar.com/inception/ultra/indexCopy.html I am new to this and searching SO I found
I tried searching for this but couldn't find a similar question. I have a
I've been searching for this answer all over internet but so far no luck.
I've done much searching on this and haven't worked out the answer, but I
I did a lot of searching on this subject, but I couldn't find anything
I've been searching for this for some time, but I couldn't seem to find
I've tried searching for this but it's pretty difficult to put into words. Basically,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.