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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T15:13:14+00:00 2026-05-21T15:13:14+00:00

I have a nested list structure of arbitrary length, with a depth of three.

  • 0

I have a nested list structure of arbitrary length, with a depth of three. The first level has arbitrary length, as does the second level, but the third level is guaranteed to have a uniform length across the whole thing. An example of said structure would be '(((A B) (C D)) ((E F) (G H)) ((I J))).

I’m trying to write a function that would apply another function across the different levels of the structure (sorry, I don’t really know how to phrase that). An example of the function mapping across the example structure would be in this order:

f A C = AC, f B D = BD, f E G = EG, f F H = FH, f I = I, f J = J,

yielding

'((AC BD) (EG FH) (I J))

but imagining that the third level of the list contains many more elements (say, around 32,000 in the final version).

Essentially, what I’m trying to do would be expressed in Haskell as something like f . transpose. I know I need something like (map car (map flatten (car ...))) to get the first part of the first section, but after that, I’m really lost with the logic here. I’m sorry if this is a really convoluted, poorly explained question. I’m just really lost.

How would I go about applying the function across the structure in this manner?

  • 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-21T15:13:14+00:00Added an answer on May 21, 2026 at 3:13 pm
    (define l '(((A B)
       (C D))
      ((E F)
       (G H))
      ((I J)))
    )
    (define zip (lambda lists (apply map list lists)))
    (define (f values) (list 'f values))
    
    (map (lambda (v) (map (lambda values (apply f values)) (apply zip v))) l)
    

    prints

    (((f (a c)) (f (b d))) ((f (e g)) (f (f h))) ((f (i)) (f (j))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a nested ul/li list <ul> <li>first</li> <li>second <ul> <li>Third</li> </ul> </li> ...
I have this nested list structure. My tree can go to n level. I
I have a nested list comprising ~30,000 sub-lists, each with three entries, e.g., nested_list
I have a structure that can be very easily represented using a three-deep nested
I have this nested data frame test <- structure(list(id = c(13, 27), seq =
I have a nested list of data. Its length is 132 and each item
I have a very nested entity structure like this: DataObject > Universities (List) >
I have an autogenerated nested list structure, like so <ul> <li>AAA</li> <li>BBB <ul> <li>111
I have a nested ordered list with this structure <ol> <li> <span>A</span> <ol class=childol>
I have the following simple 3 level menu structure: <nav class=main-nav class=list> <ul> <li

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.