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 520661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:10:07+00:00 2026-05-13T08:10:07+00:00

Could someone provide a link to a good coding standard for Haskell? I’ve found

  • 0

Could someone provide a link to a good coding standard for Haskell? I’ve found this and this, but they are far from comprehensive. Not to mention that the HaskellWiki one includes such “gems” as “use classes with care” and “defining symbolic infix identifiers should be left to library writers only.”

  • 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-05-13T08:10:08+00:00Added an answer on May 13, 2026 at 8:10 am

    Really hard question. I hope your answers turn up something good. Meanwhile, here is a catalog of mistakes or other annoying things that I have found in beginners’ code. There is some overlap with the Cal Tech style page that Kornel Kisielewicz points to. Some of my advice is every bit as vague and useless as the HaskellWiki “gems”, but I hope at least it is better advice 🙂

    • Format your code so it fits in 80 columns. (Advanced users may prefer 87 or 88; beyond that is pushing it.)

    • Don’t forget that let bindings and where clauses create a mutually recursive nest of definitions, not a sequence of definitions.

    • Take advantage of where clauses, especially their ability to see function parameters that are already in scope (nice vague advice). If you are really grokking Haskell, your code should have a lot more where-bindings than let-bindings. Too many let-bindings is a sign of an unreconstructed ML programmer or Lisp programmer.

    • Avoid redundant parentheses. Some places where redundant parentheses are particularly offensive are

      • Around the condition in an if expression (brands you as an unreconstructed C programmer)

      • Around a function application which is itself the argument of an infix operator (Function application binds tighter than any infix operator. This fact should be burned into every Haskeller’s brain, in much the same way that us dinosaurs had APL’s right-to-left scan rule burned in.)

    • Put spaces around infix operators. Put a space following each comma in a tuple literal.

    • Prefer a space between a function and its argument, even if the argument is parenthesized.

    • Use the $ operator judiciously to cut down on parentheses. Be aware of the close relationship between $ and infix .:

      f $ g $ h x == (f . g . h) x == f . g . h $ x
      
    • Don’t overlook the built-in Maybe and Either types.

    • Never write if <expression> then True else False; the correct phrase is simply <expression>.

    • Don’t use head or tail when you could use pattern matching.

    • Don’t overlook function composition with the infix dot operator.

    • Use line breaks carefully. Line breaks can increase readability, but there is a tradeoff: Your editor may display only 40–50 lines at once. If you need to read and understand a large function all at once, you mustn’t overuse line breaks.

    • Almost always prefer the -- comments which run to end of line over the {- ... -} comments. The braced comments may be appropriate for large headers—that’s it.

    • Give each top-level function an explicit type signature.

    • When possible, align -- lines, = signs, and even parentheses and commas that occur in adjacent lines.

    • Influenced as I am by GHC central, I have a very mild preference to use camelCase for exported identifiers and short_name with underscores for local where-bound or let-bound variables.

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

Sidebar

Ask A Question

Stats

  • Questions 355k
  • Answers 355k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer you must say with port and layer 7 protocol you… May 14, 2026 at 8:40 am
  • Editorial Team
    Editorial Team added an answer OK, I solved it by just reading out directly from… May 14, 2026 at 8:40 am
  • Editorial Team
    Editorial Team added an answer No, you can't assign width to anything that is displayed… May 14, 2026 at 8:40 am

Related Questions

Could someone provide a good documentation / tutorial/ PDFs/ reference to book link about
I need to be able to modify every single link in an HTML document.
I am writing a Perl script that is searching for a term in large
I was wondering if someone could help me get pointers to solve this problem.
I need to invoke a VBA macro within an Excel workbook from a python

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.