diff options
Diffstat (limited to 'stdlib/source')
-rw-r--r-- | stdlib/source/lux/concurrency/session.lux | 22 |
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))) |