yak: A strongly typed IRC library

[ library, mit, network ] [ Propose Tags ] [ Report a vulnerability ]

See README.rst


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.2.0.0
Dependencies attoparsec (>=0.13 && <0.14), base (>=4.11 && <5), bytestring (>=0.10 && <0.11), lens (>=4.16 && <5), template-haskell (>=2.12), text (>=1.2 && <1.3), time (>=1.8 && <2) [details]
License MIT
Copyright 2018 Paul Ogris
Author Paul Ogris
Maintainer paul@tsahyt.com
Category Network
Home page https://github.com/tsahyt/yak#readme
Source repo head: git clone https://github.com/tsahyt/yak
Uploaded by tsahyt at 2019-02-23T18:27:00Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 1221 total (11 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2019-02-23 [all 1 reports]

Readme for yak-0.2.0.0

[back to package description]

yak

An experimental, radically over-engineered library for handling IRC messages in Haskell.

Design

Every IRC message type has its own type, all hinging around the central Msg type. A Msg is parameterized by a type level command string, and a heterogeneous list of parameter types. Combined with a number of suitable parameter types to encode the structure of an IRC message, this provides a simple type level DSL for declaring IRC messages.

Messages can be emitted (rendered) or fetched (parsed). The behaviour of these functions depends on the concrete type, as determined through type inference or explicit annotation. There is an existential wrapper SomeMsg for passing around any IRC message.

Messages can be created using a polymorphic variadic function build, which serves as a general purpose constructor for all IRC message types.

Fields of messages can be accessed either through pattern matching on the Msg constructor and the parameter list therein, or through lenses. A TH function is provided to generate lenses for newly defined message types.

Predefined Messages

The Network.Yak.Client module defines message types commonly used by IRC clients. It implements the "living standard" found here. Responses can be found in Network.Yak.Responses, and capability negotiation in Network.Yak.Capabilities. This should suffice for most applications.

Status

This library is highly experimental and the interface may turn out to be rather cumbersome to use. There are test cases in place for common IRC messages, but most of the library is untested