diff options
author | Ben Sima <ben@bsima.me> | 2021-01-29 02:37:14 -0500 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2021-01-29 03:22:01 -0500 |
commit | b289dee25ad8ce4c2622fadb2f4c31fb90914b39 (patch) | |
tree | 5511da780cdabbb98c8fbe01f03997d3263e7880 /Control | |
parent | 42c7614b6a4bd7504e9bf31e0882db58b85857bc (diff) |
Lint 'return' into 'pure', replace bind operator
Diffstat (limited to 'Control')
-rw-r--r-- | Control/Concurrent/Go.hs | 8 |
1 files changed, 4 insertions, 4 deletions
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": |