Slacker News Slacker News logo featuring a lazy sloth with a folded newspaper hat
  • top
  • new
  • show
  • ask
  • jobs
Library
← Back to context

Comment by rienbdj

15 hours ago

Is a Go channel equivalent to a Haskell tvar ?

2 comments

rienbdj

Reply

masklinn  11 hours ago

A go channel is just a queue with a configurable amount of buffering. Buffering 0 is the most interesting as it creates a “rendezvous” channel which syncs the sender and the receiver.

A channel of size 1 is a bit like an mvar but with support for only take and put.

mrkeen  14 hours ago

Closer to mvar. Tvars support full transactional semantics.

Slacker News

Product

  • API Reference
  • Hacker News RSS
  • Source on GitHub

Community

  • Support Ukraine
  • Equal Justice Initiative
  • GiveWell Charities