参考 The F# 4.1 spec 4.4.2 Precedence of Symbolic Operators and Pattern/Expression Constructs 右側に書いてあるのは演算子の結合の仕方 %right 右結合 %left 左結合 %nonassoc 無結合 下に行くほど優先順位が上がる as %right when %right | %left ; %right let %nonassoc function, fun, match, try %nonassoc if %nonassoc -> %right := %right , %nonassoc or || %left & && %left :> :?> %right !=OP <OP >OP = |OP &OP $ %left ^OP %right :: %right :? %nonassoc -OP +OP %left -- for infix uses of these symbols *OP /OP %OP %left **OP %right "f x" "lazy x" "assert x" %left "| rule" %right -- パターンマッチルール prefix-op %left -- for prefix uses of these symbols . %left f(x) %left -- 関数適用 f<types> %left -- 型適用
let ( <<@ ) x y = x ** y;; //x ** y はxのy乗 let ( ^^@ ) x y = x ** y;;
> 3. <<@ 3. <<@ 3.;; //((3. <<@ 3.) <<@ 3.)が実行された val it : float = 19683.0 > 3. ^^@ 3. ^^@ 3.;; //(3. ^^@ (3. ^^@ 3.))が実行された val it : float = 7.625597485e+12
The F# 2.0 Language Specification April 2010(candidate) 3.6 Symbolic Keywords 3.7 Symbolic Operators User-defined and library-defined symbolic operators are sequences of characters as shown below, except where the sequence of characters is a symbolic keyword regexp first-op-char = !%&*+-./<=>@^|‾ regexp op-char = first-op-char | ? token quote-op-left = | <@ <@@ token quote-op-right = | @> @@> token symbolic-op = | ? | ?<- | first-op-char op-char* | quote-op-left | quote-op-right token symbolic-keyword = let! use! do! yield! return! | -> <- . : ( ) [ ] [< >] [| |] { } ' # :?> :? :> .. :: := ;; ; = _ ? ?? (*) <@ @> <@@ @@> token reserved-symbolic-sequence = ‾ `