by hcarvalhoalves · 11y ago · 0 comments
With currying, you do away with OO and parameter initialization altogether.
@curry
def SMTPSender(host, message):
...
emailSender = SMTPSender(host='localhost')
# partially evaluated fn with `host` fixed
emailSender(message=message) emailSender = SMTPSender(host='localhost') # in container
emailSender.send(message) # in implementation
The consumer of the SMTPSender only interacts with the send() method.