kazu-yamamoto/dns — pull request #17 by joecrayne (2014-05-17 06:52:04+00:00)
Title: Support for custom RDATA representations.

These changes make the library more versatile by dropping the assumption that
RDATA is sufficient to represent whatever resource record type the user might
be interested in. This is particularly useful for experimenting with custom
DNS extensions or rarely used RR types for which it would not be appropriate to
add parsing support to library because of the imposed dependencies or the
unnessary cluttering of the API.

It is my intention that this pull request has the following properties:

1. Backwards-compatiblity. I believe that I've not broken anyone's code.

2. To facilitate review, it is composed as a series of small sensible
commits.

Summary of Changes
------------------

DNSFormat and Resource record are now type aliases:

```haskell
type DNSFormat = DNSMessage RDATA
type ResourceRecord = RR RDATA
```

*DNSMessage* and *RR* are parameterized with a user-supplied representation of
the rdata field. The newly added *lookupRaw'* function can be used to obtain
the ByteString versions of these. The newly added *dnsTraverseWithType*
function can be used to parse those into any representation that the user
wants.