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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:54:09+00:00 2026-05-13T19:54:09+00:00

Is there a list of valid prefix operator names somewhere? I haven’t been able

  • 0

Is there a list of valid prefix operator names somewhere? I haven’t been able to find one, but I’ve noticed that some operators that used to be valid as prefix operators in the last CTP are no longer valid in the RC.

let (~--) (str:string) = [str];;
-----^^^

stdin(4,6): error FS1208: Invalid operator definition. 
Prefix operator definitions must use a valid prefix operator name.

Edit:

Brian’s link includes the following list of valid prefix operators:

! (or repetitions of !)
~ (or repetitions of ~)
+
-
+.
-.
%
%%
&
&&

My link below lists only these operators:

~
!
?

A quick test shows that the MSDN docs do not seem to be current with the language spec. Thanks, Brian.

  • 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-13T19:54:09+00:00Added an answer on May 13, 2026 at 7:54 pm

    See

    http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc245030784

    which spells out the rules. I’ve quoted some of it below. (See also

    http://msdn.microsoft.com/en-us/library/dd233228(VS.100).aspx

    but I think it doesn’t have the full rules.)

    The following symbolic-op tokens can be used to form expressions:

    infix-op :=
        or || & && <OP >OP $OP = |OP &OP ^OP :: -OP +OP *OP /OP %OP 
        **OP
    
    infix-or=prefix-op :=
        -OP +OP % %% & &&
    
    prefix-op :=
        ! (or repetitions of !)
        ~ (or repetitions of ~) 
        +
        -
        +.
        -.
        %
        %%
        &
        &&
    

    Operators made of the following are always prefix operators:

    • repeated !
    • repeated ~

    Other operators beginning with these characters are not permitted.

    The operators +, -, +., -., %, &, && and may be used as both prefix and infix operators. When used as prefix operators these operators have an implicit operator name with ~ prepended. For example, -x is parsed as an application of the operator ~- to the expression x. This name is also used when giving definitions for these prefix operators:

    This means that these prefix operators are defined with the ~ character added:

    // For a complete redefinition of the operator:
    let (~+) x = x
    
    // For defining the operator on a type:
    type C(n:int) =
        let n = n % 7
        member x.N = n
        static member (~+) (x:C) = x
        static member (~-) (x:C) = C(-n)
        static member (+) (x1:C,x2:C) = C(x1.N+x2.N)
        static member (-) (x1:C,x2:C) = C(x1.N-x2.N)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there an exhaustive list of MySQL Time Zones? It seems that the valid
Is there a list of the differences between the various versions of Rails somewhere
Is there a list of COM error codes somewhere? Related: HRESULT: 0x80010105 (RPC_E_SERVERFAULT) question
I need to get list of valid countries for web application, is there any
I am trying to use SharePoint Web service to retrieve list changes but there
There is list <nodes> <node attr='1'/> <node attr='0'/> <node attr='1'/> <node attr='1'/> </nodes> i
Is there a list of items on the web that you should not use
Is there a list of them with examples accessible to a person without extensive
Is there a list of reserved memory addresses out there - a list of
Is there a list of standard marker interfaces in Java? I've read (in some

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.