From b289dee25ad8ce4c2622fadb2f4c31fb90914b39 Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Fri, 29 Jan 2021 02:37:14 -0500 Subject: Lint 'return' into 'pure', replace bind operator --- Control/Concurrent/Go.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Control/Concurrent') diff --git a/Control/Concurrent/Go.hs b/Control/Concurrent/Go.hs index 92444f4..5057bfe 100644 --- a/Control/Concurrent/Go.hs +++ b/Control/Concurrent/Go.hs @@ -49,7 +49,7 @@ fork = Concurrent.forkIO chan :: Int -> IO (Channel a) chan n = do (i, o) <- Chan.newChan n - return <| Channel i o n + pure <| Channel i o n -- | A channel for broadcasting to multiple consumers. See 'mult'. type Mult a = Chan.OutChan a @@ -64,7 +64,7 @@ mult = Chan.dupChan <. _in -- You can use this to read from a channel in a background process, e.g.: -- -- >>> c <- Go.chan --- >>> Go.fork <. forever <| Go.mult c >>= Go.tap >>= print +-- >>> Go.fork <. forever <| Go.mult c +> Go.tap +> print tap :: Mult a -> IO a tap = Chan.readChan @@ -93,9 +93,9 @@ write = Chan.tryWriteChan <. _in -- >>> Go.read c -- "hi" -- >>> Go.fork --- >>> Go.fork <| forever <| Go.mult c >>= Go.tap >>= \t -> print ("one: " <> t) +-- >>> Go.fork <| forever <| Go.mult c +> Go.tap +> \t -> print ("one: " <> t) -- ThreadId 810 --- >>> Go.fork <| forever <| Go.mult c >>= Go.tap >>= \t -> print ("two: " <> t) +-- >>> Go.fork <| forever <| Go.mult c +> Go.tap +> \t -> print ("two: " <> t) -- ThreadId 825 -- >>> Go.write c "test" -- "two: t"eosnte": -- cgit v1.2.3