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

  • Home
  • SEARCH
  • 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 8153271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:57:48+00:00 2026-06-06T15:57:48+00:00

From where can I get complete set of Indentation rules for Haskell code writing?

  • 0

From where can I get complete set of Indentation rules for Haskell code writing?

Past SO questions which are similar to my following question has led me to ask above question. What are the reasons behind the error message: parse error on input 'something'?

Error message I got:

baby.hs:103:2: parse error on input `myList'(error in this line)

Code I am trying to compile:

myList = ["aeroplane", "Aeroplane", "AeRoPlAne", "helicopter", "HELICOPTER", "Zebra"]
quicksort :: (Ord a) => [a] -> [a]  
quicksort [] = []  
quicksort (x:xs) =
let smallerSorted = quicksort [a | a <- xs, a <= x]  
biggerSorted = quicksort [a | a <- xs, a > x]  
in smallerSorted ++ [x] ++ biggerSorted

Edit by Optimight:

I shifted the code in the question to new .hs file and tried to compile it. Still similar error message remains. Details below:

Error
quickSort.hs:5:62: parse error on input `=’
Failed, modules loaded: none.
(0.02 secs, 0 bytes)

Code
quicksort :: (Ord a) => [a] -> [a]
quicksort [] = []
quicksort (x:xs) =
let smallerSorted = quicksort [a | a <- xs, a <= x]
biggerSorted = quicksort [a | a <- xs, a > x]
in smallerSorted ++ [x] ++ biggerSorted
myList = [“aeroplane”, “Aeroplane”, “AeRoPlAne”, “helicopter”, “HELICOPTER”, “Zebra”, “America”]

  • 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-06T15:57:50+00:00Added an answer on June 6, 2026 at 3:57 pm

    At least for standard Haskell (without language extensions), the layout rules are explained in Section 10.3 of the Haskell 2010 report.

    The report may be a bit formal for your taste. Various tutorials and textbooks on Haskell have some more informal explanations of the layout rules, for example the Haskell Wikibook.

    In your particular case, the error message points to line 103, but you are only pasting a couple of lines. I can see that at least the indentation of the let-in construct is broken. You should write something like the following:

    xs = ["aeroplane", "Aeroplane", "AeRoPlAne", "helicopter", "HELICOPTER", "Zebra"]
    quicksort :: (Ord a) => [a] -> [a]
    quicksort [] = []
    quicksort (x:xs) = let smallerSorted = quicksort [a | a <- xs, a <= x]
                           biggerSorted = quicksort [a | a <- xs, a > x]
                       in smallerSorted ++ [x] ++ biggerSorted
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can i get song details to play from sdcard and complete the action
I have a code from where I can get the contacts name in a
From windows event viewer I can get the following xml structure: <Event xmlns=http://schemas.microsoft.com/win/2004/08/events/event> <System>
Launch app from homescreen can't get remote push payload? But launch from Notification Center
I have an app from where I can get the list of all installed
Is there any attribute associated with the starting time I can get from the
I can get individual uncompressed frames from the iPhone's camera in iOS4. What i
Is there any method I can get the full JSON data from jqGrid when
I meam for example I can get var collection = from c in el.Descendants(current_conditions)
How do I set environment variables from Java? I see that I can do

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.