I watched Coursera's Reactive Programming course, which Scala uses to implement the Observer pattern. There, Martin Odersky says that the Observer pattern forces imperative programming, which we see because subscriber handlers are of type Unit.
Unit
He says here: https://class.coursera.org/reactive-002/lecture/107 at 9:40
I really do not understand:
1.When should handlers have a type Unit?
2. How is the Observer pattern creating imperative programming?
, OP.
- - ; , Unit, , . . , , : (, notifyObservers (observer)) , , . .
, Unit , , , , , , -effects. , , , - , Observer, , , ...
, , Unit, , . , , .
, , , .
wiki , in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes,, state , , FP,
in which an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes,
state
Source: https://habr.com/ru/post/1619922/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1619917/how-to-dynamically-add-class-to-parent-div-of-focused-input-field&usg=ALkJrhijKF7VPq0_54itqQ0KyX_xPWPEnAПоиск разницы между двумя датами в PHP - jqueryMedian of medians vs TreeMap - algorithmCan I change the Android NFC tag verification interval? - androidHow to send Codename One app to itunes repository - javaПоиск списка объектов для максимального значения по дате - c#How to enable reset password for users with unusable password in Django? - authenticationSpring Security. Basic authentication - javahow to get inserted identifiers from multiple INSERT - phpHow to exclude tests from PIT mutation analysis? - mavenAll Articles