In a long term it would be probably better to use one of the popular 
packages for the immutable opertaions.

Until the decision is not made these implementations can be used.

Please test these functions extremely in all possible ranges because 
they can cause hardly debuggable problems by nature.
 