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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:47:32+00:00 2026-06-02T20:47:32+00:00

I know the xs can be used for expressing the rest elements in a

  • 0

I know the “xs” can be used for expressing the rest elements in a list
but I totally have no idea what the “ls” mean in Haskell?

  • 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-02T20:47:34+00:00Added an answer on June 2, 2026 at 8:47 pm

    ls is not a predefined thing. It is whatever you bind it to, just like xs.

    For instance, I think you’ve seen examples like this:

    sum [] = 0
    sum (x:xs) = x + sum xs
    

    The variable xs, that you just defined here, gets bound (will have the value of) the rest of the list because of the pattern (x:xs). But this could equally well have been written as:

    sum [] = 0
    sum (l:ls) = l + sum ls
    

    We prefer not to call a variable l though, because it is easily confused with the digit 1 (or even the pipe symbol | on really messed up fonts).

    We could even write:

    sum [] = 0
    sum (head:tail) = head + sum tail
    

    where we reuse the names of the built-in prelude functions head and tail, but this is bound to lead to confusion.

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

Sidebar

Related Questions

I know regular expressions can be used, but am not able to find the
Does anyone know if TestComplete can be used with Adobe Air applications?
Can CUDA be used to generate OpenGL textures? I know it can be done
This is just a curiosity question. I know that Spring can be used in
Does anyone know of a tool that can be used to compare (relatively complex)
What languages can be used to develop for the iPhone? I know, I know:
I would like to know what kind of timers can be used in a
Would you happen to know of any tools that can be used to find
I would like to know what packages are out there that can be used
I would like to know if Google App Engine can be used as a

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.