Is it possible in ocaml to define an operator like the array set function which can be written a.(n)<-v
?
The OCaml manual explains how to define 2-parameters infix operators but not 3-parameters operators. I would like to know if there is a way to define a function , a bit like the Array.set
method which can be called using the a.(n)<-v
syntax.
I would like to create a new operator that could be called using this syntax: a[b<-c]
I tried some things like this:
let ([<-]) a b c = ...
let (#1[#2<-#3]) a b c =...
but these didn't work.
Thanks in advance for your help!