IRC – Haskell – Aelve Guidehttps://guide.aelve.com/haskell/feed/category/e8ccmlfv2016-08-24T14:31:25Zq2cfbw2tirc-core2016-08-24T14:31:25Z<h1> <span class="item-name">irc-core</span>
(<a href="https://hackage.haskell.org/package/irc-core">Hackage</a>)
</h1><p>Library for parsing and rendering IRC message in a high and low-level format.</p>
<h2>Pros</h2><ul><p><li>Parser handles IRCv3 message-tags</li></p><p><li>Permissive parser handles a range of IRC server outputs</li></p><p><li>Support for splitting up MODE arguments</li></p><p><li>Complete list of reply codes</li></p><p><li>Integrates into an existing event loop</li></p><p><li>Offers both low-level and high-level message views</li></p></ul><h2>Cons</h2><ul></ul><h2>Ecosystem</h2><ul>
<li><a href="https://hackage.haskell.org/package/glirc">glirc</a> is a console based IRC client that is implemented on top of <code>irc-core</code></li>
<li><a href="https://github.com/glguy/irc-core/blob/v2/bot/src/Main.hs">irc-core-bot</a> is a simple echo-bot example using <code>irc-core</code>.</li>
</ul>
asf8whnbirc-client2016-08-23T23:16:09Z<h1> <span class="item-name">irc-client</span>
(<a href="https://hackage.haskell.org/package/irc-client">Hackage</a>)
</h1><p>A library that aims not to provide a full-blown “bot experience”, but some low-level building blocks for IRC clients.</p>
<h2>Pros</h2><ul><p><li>Very simple setup</li></p><p><li>Nice types</li></p></ul><h2>Cons</h2><ul><p><li>Event handling is kind of awkward and requires a lot of duplication because of partial handlers.</li></p></ul><h2>Notes</h2><h1><span id="item-notes-asf8whnb-gotchas"></span>Gotchas</h1><ul>
<li>Adding <code>defaultEventHandlers</code> to your <code>_eventHandlers</code> is a good idea for basic setup.</li>
<li>You can handle every kind of <a href="https://tools.ietf.org/html/rfc2812#section-5.1">defined server response</a> by using <code>ENumeric</code> and <code>Numeric</code>.</li>
</ul>
ybu64qifircbot2016-08-23T14:12:47Z<h1> <span class="item-name">ircbot</span>
(<a href="https://hackage.haskell.org/package/ircbot">Hackage</a>)
</h1><p>A library to create an IRC bot, from 2012. It heavily uses Monad Transformers so might not be very beginner friendly.</p>
<h2>Pros</h2><ul><p><li>Integrates into mtl</li></p></ul><h2>Cons</h2><ul><p><li>No way to wait for the bot to finish, since the function only returns a <code>ThreadId</code>.</li></p><p><li>Uses <code>irc</code>, which only provides a <em>very</em> thin layer of typing around the IRC protocol, no types for the different kinds of commands for example. You need to read the RFC.</li></p></ul><h2>Notes</h2><h1><span id="item-notes-ybu64qif-discussion"></span>Discussion</h1><p>Profpatsch: I had to drop this library because the composability stops at it only returning a <code>ThreadId</code>. I haven’t found a way how it wants you to integrate further IO.</p>