I should clarify that I’m using JaneStreet’s Base and I want to use bit operations on Int64 numbers
Int64
defines a lsl
infix operator:
val ( lsl ) : int64 > int > int64
and I want to describe some operation:
((1L lsl 2)  1L) lsl (10  1)
this leads to bigger issues than anticipated:

lsl
is moving anint64
number withint
bits
> so I need to perform additions and subtractions and etc. on bothint64
andint
initially I thought  I’ll just open Int64 since that’s what I need:
let do_things =
let open Int64 in
((1L lsl 2)  1L) lsl (10  1)
but 
now works on int64
, not int
> 10  1
doesn’t work
I tried defining an infix operator, so that I don’t need to open the whole Int64
module:
let ( lsl ) = Int64.shift_left
let do_things =
((1L lsl 2)  1L) lsl (10  1)
but this doesn’t work either since  1L
now expects ints
the closest approximation to what I would fine useful has been:
let do_things =
let shift = (10  1) in
let open Int64 in
((1L lsl 2)  1L) lsl shift
but it is fairly annoying to keep track of which syntax is overriden when;
How do people mix numeric operations of different types? is there a better way?
this is not very ergonomic