From 6c2fdb64c1fada00d764d29b831b25a490eb3057 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 10 Dec 2018 00:45:09 -0400 Subject: Slight improvement. --- stdlib/source/lux/concurrency/session.lux | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'stdlib') diff --git a/stdlib/source/lux/concurrency/session.lux b/stdlib/source/lux/concurrency/session.lux index ea0f3666f..ac9f984d9 100644 --- a/stdlib/source/lux/concurrency/session.lux +++ b/stdlib/source/lux/concurrency/session.lux @@ -84,8 +84,8 @@ (All [value mine yours] (-> (Lazy [mine yours]) (Lazy [(Read value mine) (Write value yours)]))) - (let [channel (promise.promise #.None)] - (lazy.freeze [(function (_ _) + (lazy.freeze (let [channel (promise.promise #.None)] + [(function (_ _) (let [[mine yours] (lazy.thaw session)] (do promise.Monad [value channel] @@ -100,8 +100,8 @@ (All [value mine yours] (-> (Lazy [mine yours]) (Lazy [(Write value mine) (Read value yours)]))) - (let [channel (promise.promise #.None)] - (lazy.freeze [(function (_ value) + (lazy.freeze (let [channel (promise.promise #.None)] + [(function (_ value) (let [[mine yours] (lazy.thaw session)] (exec (io.run (promise.resolve value channel)) (promise.promise (#.Some mine))))) @@ -142,9 +142,9 @@ (All [myL yourL myR yourR] (-> (Lazy [myL yourL]) (Lazy [myR yourR]) (Lazy [(Fork myL myR) (Join yourL yourR)]))) - (let [channel (: (Promise Bit) - (promise.promise #.None))] - (lazy.freeze [(function (_ signal) + (lazy.freeze (let [channel (: (Promise Bit) + (promise.promise #.None))] + [(function (_ signal) (let [[myL yourL] (lazy.thaw left) [myR yourR] (lazy.thaw right)] (case signal @@ -169,9 +169,9 @@ (All [myL yourL myR yourR] (-> (Lazy [myL yourL]) (Lazy [myR yourR]) (Lazy [(Join myL myR) (Fork yourL yourR)]))) - (let [channel (: (Promise Bit) - (promise.promise #.None))] - (lazy.freeze [(function (_ _) + (lazy.freeze (let [channel (: (Promise Bit) + (promise.promise #.None))] + [(function (_ _) (let [[myL yourL] (lazy.thaw left) [myR yourR] (lazy.thaw right)] (do promise.Monad -- cgit v1.2.3