You can't define an infix operator starting with ~
in F#.
The F# 3.0 specification, section Categorization of Symbolic Operators explains the reason quite clearly:
The operators
+
,-
,+.
,-.
,%
,%%
,&
,&&
can be used as both prefix and infix operators. When these operators are used as prefix operators, the tilde character is prepended internally to generate the operator name so that the parser can distinguish such usage from an infix use of the operator. For example,-x
is parsed as an application of the operator~-
to the identifierx
. This generated name is also used in definitions for these prefix operators. Consequently, the definitions of the following prefix operators include the~
character.