开发者

Can you define an operator (***) in F#?

开发者 https://www.devze.com 2023-01-21 21:59 出处:网络
I\'m working on Arrows in F# and I wanted to create a *** operator.I note, however, that (***), the necessary way to express an operator in a function definition, overlaps with the F# block comment sy

I'm working on Arrows in F# and I wanted to create a *** operator. I note, however, that (***), the necessary way to express an operator in a function definition, overlaps with the F# block comment syntax. So how could you actually express this?

I tho开发者_C百科ught of maybe .***. but I think that will actually treat the dots as part of the operator, which I'd rather avoid.


Yes, but you need to add spaces between the parentheses and the asterisks:

let ( *** ) x y = x * y

let z = 4 *** 5
0

精彩评论

暂无评论...
验证码 换一张
取 消