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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:11:01+00:00 2026-06-15T09:11:01+00:00

From Learn You a Haskell: Think about this list: [5] . That’s just syntactic

  • 0

From Learn You a Haskell:

Think about this list: [5]. That’s just syntactic sugar for 5:[]. On
the left side of the :, there’s a value; on the right side, there’s a
list. In this case, it’s an empty list. Now how about the list [4,5]?
Well, that desugars to 4:(5:[]). Looking at the first :, we see that
it also has an element on its left side and a list, (5:[]), on its
right side.
The same goes for a list like 3:(4:(5:6:[])), which could be written
either like that or like 3:4:5:6:[] (because : is right-associative)
or [3,4,5,6].

For the bolded part, I was expecting the growing list to culminate in 3:(4:(5:(6:[]))). This has something to do with my lack of understanding of currying, associativity, or both. Can someone tell me the flaw in my thinking?

  • 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-15T09:11:02+00:00Added an answer on June 15, 2026 at 9:11 am

    Multiplication is associative. This means that (x * y) * z is the same as x * (y * z). However, : is not associative.

    However, the terms “left-associative” and “right-associative” are different, and unrelated to the term “associative”.

    • If * is left-associative, then x * y * z is the same thing as (x * y) * z. The parentheses are redundant.

    • If * is right-associative, then x * y * z is the same thing as x * (y * z). The parentheses are redundant.

    Currying has nothing to do with this.

    Since : is right-associative, [3,4,5,6] can be written as:

    3:(4:(5:(6:[])))
    3:4:(5:(6:[]))
    3:(4:5:(6:[]))
    3:4:5:(6:[])
    3:(4:(5:6:[]))
    3:4:(5:6:[])
    3:(4:5:6:[])
    3:4:5:6:[]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've just read about binary search trees from the Learn You a Haskell book,
While learning an example from learn-you-a-haskell which right triangle that has integers for all
I'm trying to compile this function from Learn You a Haskell for Great Good
I found this script on about.com which I'm trying to learn from on how
This is an example from Learn you a Haskell: ghci> [ x*y | x
This code (taken from Learn You A Haskell ): main = do putStr Hey,
One of the examples from Learn You a Haskell is: pure (+) <*> Just
I'm trying to learn C from an unnamed book that contains the following sample
I just started to learn Rails from railstutorial.org. After installing Rails I cerated an
Lately, I've been trying to learn C++ from this website . Unfortunately whenever I

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.