@@ -42,9 +42,8 @@ def submit[**P, T](
4242 >>> from effectful.handlers.futures import ThreadPoolFuturesInterpretation
4343 >>> from effectful.ops.semantics import handler
4444 >>>
45- >>> pool = ThreadPoolExecutor()
46- >>> with handler(ThreadPoolFuturesInterpretation(pool)):
47- >>> future = Executor.submit(my_function, arg1, arg2)
45+ >>> with handler(ThreadPoolFuturesInterpretation()):
46+ >>> future = Executor.submit(lambda x,y: x + y, 1, 2)
4847 """
4948 raise NotHandled
5049
@@ -153,16 +152,17 @@ class ThreadPoolFuturesInterpretation(FuturesInterpretation):
153152
154153 Example:
155154 >>> from concurrent.futures import ThreadPoolExecutor, Future
156- >>> from effectful.ops.semantics import defop, handler
155+ >>> from effectful.ops.syntax import defop
156+ >>> from effectful.ops.semantics import handler
157157 >>> from effectful.handlers.futures import Executor, ThreadPoolFuturesInterpretation
158158 >>>
159159 >>> @defop
160- >>> def async_pow (n: int, k: int) -> Future[int]:
160+ >>> def pow (n: int, k: int) -> Future[int]:
161161 >>> return Executor.submit(pow, n, k)
162162 >>>
163163 >>> pool = ThreadPoolExecutor()
164164 >>> with handler(ThreadPoolFuturesInterpretation(pool)):
165- >>> result = async_pow (2, 10).result()
165+ >>> result = pow (2, 10).result()
166166 >>> print(result) # 1024
167167 """
168168
0 commit comments