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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T02:23:15+00:00 2026-05-19T02:23:15+00:00

I have checked everywhere and I can’t seem to locate the problem. The compiler

  • 0

I have checked everywhere and I can’t seem to locate the problem. The compiler is giving me this error: “error FS0039: The value or constructor 'dotProduct' is not defined“. But dotProduct is currently defined.

Visual Studio 2010 is also highlighting the second let (let rec dotProductAux list1 list2 acum =) saying that the expression is unfinished.

let dotProduct list1 list2 =
    let rec dotProductAux list1 list2 acum =
        match list1 ,list2 with
          | [],l | l,[] -> acum
          | head1 :: tail1, head2 :: tail2 -> let updated = (head1 * head2) + acum
                                              (dotProductAux tail1 tail2 updated)

This code multiplies and adds two list like this:

dotProduct [1;4;7] [3;4;1];;   //(1*3) + (4*4) + (7*1)

I’m fairly new to F# and can’t seem to get this code right. Any help?

  • 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-19T02:23:16+00:00Added an answer on May 19, 2026 at 2:23 am

    The body of dotProduct contains the definition of dotProductAux, but no actual expression. You need to actually call dotProductAux (i.e. you’re missing the call dotProductAux list1 list2 0 after the let rec).

    Furthermore the case | [],[]| l,[] -> accum will cause an error because the second pattern binds the variable l, while the first does not. You can fix that by replacing l with _, since you don’t actually need it. (Apparently you’ve already fixed this in an edit).

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

Sidebar

Related Questions

i can't get rid of these errors... i have semicolons everywhere i checked... the
I have checked the regional settings in my emulator and I can't yet choose
I have checked similarly named questions, but they don't answer this use case. Basically,
I have checked all posts here, but can't find a solution for me so
I have spent a hell lot of time on this bug and I can't
Hey all, I seem to have these types of methods everywhere. The method below
I have read about piconets and scatternets. However, everywhere I've checked I do not
I have checked out this question, but the answer is very large for me:
I have Office 2007 installed(with .NET support checked everywhere) and VS 2008(with all updates).
I have checked with the wikipedia article , and it seems like it is

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.