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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:49:48+00:00 2026-05-16T08:49:48+00:00

I did this : let (-) (m:float[]) (n:float[])= [| for i = 0 to

  • 0

I did this :

let (-) (m:float[]) (n:float[])=  [| for i = 0 to Array.length m - 1 do yield m.[i]-n.[i] |]

But, why this is wrong?!

let y=1.0-0.0

That is ok before!

Error   1   This expression was expected to have type     float []     but here has type     float      E:\MyDocuments\Visual Studio 2010\Projects\curve intersection\newton\Module1.fs 28  7   newton
Error   2   This expression was expected to have type     float []     but here has type     float      E:\MyDocuments\Visual Studio 2010\Projects\curve intersection\newton\Module1.fs 28  11  newton

I think (m:float[]) (n:float[]) is set the parameters type , why 1.0-0.0, floatfloat, not go to use (-) floatfloat->float???

  • 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-16T08:49:49+00:00Added an answer on May 16, 2026 at 8:49 am

    You completely redefined the - operator.

    If you want to augment one of your own types to work with -, you can do that (the builtin operator definitions will pick up members on a type). But I don’t think there’s any way to define existing operators on builtin/existing types that doesn’t completely shadow the builtin operator definition.

    You can either use a local let binding to temporarily shadow - to work on float arrays, or you can define a new operator instead. Examples:

    // locally shadow
    let f() =
        let (-) (a:float[]) (b:float[]) = ...
        // use (-) on arrays for a moment
    // use (-) as normal
    

    and

    // new operator
    let (-@) (a:float[]) (b:float[]) = ...
    [|1.0|] -@ [|2.0|]  // my new op
    1.0 - 2.0           // minus as normal
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First let me say that I did see this article: How to remove AspxAutoDetectCookieSupport
Hypothetically -- not that I did this -- let's say someone I know updated
First, let me say that I have been at this for far too long,
I did this but it didn't work. Can anyone help me? Thanks. $('.current_element').mouseover(function() {
I did this: [User.first, User.last].to_xml and got this: <users type=array> <user> <created-at type=datetime>2010-03-16T06:40:51Z</created-at> <id
I did this in Perl, but how do you the same in python? Example:
Let's say I did this: script/generate controller home And in the home controller made
Let's say I have an object that is fairly complex. Since it is so
Let's say you have two arrays of arrays with the same structure but different
I have an ajax function in home.php that give me back this html response

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.