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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:27:47+00:00 2026-05-25T20:27:47+00:00

I am working on Euler 8. After a bit of reading i decided that

  • 0

I am working on Euler 8. After a bit of reading i decided that use of the map function would solve a problem for me. Throwing a simple test program together to make sure I understood the concepts came up short.

From within the shell.

1> List = {3, 1, 4}.
{3,1,4}

2> io:format("oh my ~w ~n", [List]).
oh my {3,1,4}
ok

3> lists:map(fun (Z) -> Z * Z end , List).
** exception error: no function clause matching
                    lists:map(#Fun<erl_eval.6.80247286>,{3,1,4})

I see the fun, and the list in the message.
What concept am I missing here?

  • 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-25T20:27:48+00:00Added an answer on May 25, 2026 at 8:27 pm

    your List is actually a tuple. {} is for tuples, [] is for lists.

    your example should be:

    1> List = [3,1,4].
    [3,1,4]
    2> lists:map(fun(Z) -> Z*Z end, List).
    [9,1,16]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working to solve a problem that is a bit similar to Euler
I was working on Project Euler 40 , and was a bit bothered that
I'm in PHP working on an Euler problem. I have this function so far:
I'm working on problem four of Project Euler and am running into a stackoverflow
I'm again working on Project Euler, this time problem #4. The point of this
I'm currently working on a project Euler problem (www.projecteuler.net) for fun but have hit
I am working on Problem 14 on Project Euler, and my code seems to
Disclaimer: I'm working on Euler Problem 9. I'm adding up some pretty large numbers,
When working with Project Euler problems I often need large (> 10**7) bit array's.
I'm working on problem 14 of Project Euler ( http://projecteuler.net/problem=14 ). I'm trying to

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.