aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorEduardo Julian2018-12-09 20:05:13 -0400
committerEduardo Julian2018-12-09 20:05:13 -0400
commit5a0a5b8bfca141e7641efd79c2fa5b2e3cb6f4ed (patch)
tree06c82aef031c16659d571b756502a92c455ccb7e /stdlib
parent09ace8e56f5a2015e6ce2a6396e89063816e0318 (diff)
WIP: Session recursion.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/source/lux/concurrency/session.lux22
1 files changed, 21 insertions, 1 deletions
diff --git a/stdlib/source/lux/concurrency/session.lux b/stdlib/source/lux/concurrency/session.lux
index d4f1d6591..8f896a905 100644
--- a/stdlib/source/lux/concurrency/session.lux
+++ b/stdlib/source/lux/concurrency/session.lux
@@ -9,7 +9,7 @@
[collection
["." list ("list/." Functor<List>)]]]
["." io]
- [type (#+ :share)]
+ ["." type (#+ :share)]
["." macro
["." code]
["s" syntax (#+ syntax:)
@@ -186,3 +186,23 @@
[$join /\ Join Fork ..join]
[$fork \/ Fork Join ..fork]
)
+
+(def: #export ($rec scope)
+ (-> (-> Session Session)
+ Session)
+ (case (type (All $recur [_]
+ (:~ ($session (scope [$recur $recur])))))
+ (^multi (#.UnivQ _env $scope)
+ [(type.flatten-tuple $scope)
+ (^ (list mine yours))])
+ [(#.UnivQ _env mine) (#.UnivQ _env yours)]
+
+ _
+ (undefined)))
+
+(def: #export (rec scope)
+ (All [session]
+ (-> (-> session
+ session)
+ session))
+ (scope (rec scope)))