Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .plus and .times to Expression interface #16

Merged
merged 6 commits into from
Sep 30, 2022

Conversation

kaiosilveira
Copy link
Owner

To make the Expression interface compliant to Money operations, we need to implement Sum.plus (that was mocked in chapter #15) and declare Expression.times. This PR does that. With this, we're done with our check list and with this example! 🎉

  • $5 + 10CHF = $10 if rate is 2:1 🎯 ✅ 🎉 ✨
  • $5 + $5 = $10 ✅
  • Return Money from $5 + $5 ✅
  • Bank.reduce(Money) ✅
  • Reduce Money with conversion ✅
  • Reduce(Bank, String) ✅
  • Sum.plus ✅
  • Expression.times ✅

Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯 ✅ 🎉 ✨
- $5 + $5 = $10 ✅
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion ✅
- Reduce(Bank, String) ✅
- Sum.plus 👈🏼
- Expression.times
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯 ✅ 🎉 ✨
- $5 + $5 = $10 ✅
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion ✅
- Reduce(Bank, String) ✅
- Sum.plus ✅
- Expression.times
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯 ✅ 🎉 ✨
- $5 + $5 = $10 ✅
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion ✅
- Reduce(Bank, String) ✅
- Sum.plus ✅
- Expression.times 👈🏼
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯 ✅ 🎉 ✨
- $5 + $5 = $10 ✅
- Return Money from $5 + $5
- Bank.reduce(Money) ✅
- Reduce Money with conversion ✅
- Reduce(Bank, String) ✅
- Sum.plus ✅
- Expression.times ✅
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯 ✅ 🎉 ✨
- $5 + $5 = $10 ✅
- Return Money from $5 + $5 👈🏼
- Bank.reduce(Money) ✅
- Reduce Money with conversion ✅
- Reduce(Bank, String) ✅
- Sum.plus ✅
- Expression.times ✅
Task list:
- $5 + 10CHF = $10 if rate is 2:1 🎯 ✅ 🎉 ✨
- $5 + $5 = $10 ✅
- Return Money from $5 + $5 ✅
- Bank.reduce(Money) ✅
- Reduce Money with conversion ✅
- Reduce(Bank, String) ✅
- Sum.plus ✅
- Expression.times ✅
@kaiosilveira kaiosilveira merged commit 665285e into main Sep 30, 2022
@kaiosilveira kaiosilveira deleted the chapter16/abstractions branch September 30, 2022 07:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant