Last active
June 16, 2019 15:08
-
-
Save Adzz/761eac503faaba1316e67e5bb37ff46e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defimpl Add, for: Decimal do | |
def calculate(decimal, decimal_2 = %Decimal{}), do: Decimal.add(decimal, decimal_2) | |
end | |
list_1 = [Decimal.new(1), Decimal.new(2)] | |
list_2 = [Decimal.new(3), Decimal.new(4)] | |
Zip.apply(list_1, list_2, Add) #=> [Decimal.new(4), Decimal.new(6)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment