@@ -48,16 +48,16 @@ simple objects with public attributes and no behavior, only data.
4848.. code :: python
4949
5050 class ReadLine (object ):
51- def __init__ (self , prompt ):
52- self .prompt = prompt
51+ def __init__ (self , prompt ):
52+ self .prompt = prompt
5353
5454 To perform the ReadLine intent, we must implement a performer function:
5555
5656.. code :: python
5757
5858 @sync_performer
5959 def perform_read_line (dispatcher , readline ):
60- return raw_input (readline.prompt)
60+ return raw_input (readline.prompt)
6161
6262
6363 To do something with the result of the effect, we must attach callbacks with
@@ -68,7 +68,7 @@ the ``on`` method:
6868 def greet ():
6969 return get_user_name().on(
7070 success = lambda r : Effect(Print(" Hello," , r)),
71- error = lambda exc_info : Effect(Print(" There was an error!" , exc_info[1 ])))
71+ error = lambda exc_info : Effect(Print(" There was an error!" , exc_info[1 ])))
7272
7373
7474 (Here we assume another intent, ``Print ``, which shows some text to the user.)
@@ -97,7 +97,7 @@ based on the intent.
9797
9898 def main ():
9999 eff = greet()
100- dispatcher = TypeDispatcher({ReadLine: perform_read_line})
100+ dispatcher = TypeDispatcher({ReadLine: perform_read_line})
101101 perform(dispatcher, effect)
102102
103103 This has a number of advantages. First, your unit tests for ``get_user_name ``
0 commit comments