[Haskell] [ANNOUNCE] network-address-0.1.0
sebnow at gmail.com
Mon Aug 22 12:26:13 CEST 2011
I have just released network-address-0.1.0. This is the first version
of the package.
The network-address library provides data structures for IP addresses
as well as subnetworks. The goal is to have a generic library for
representing network addresses in binary or textual form. Currently it
supports IPv4 and IPv6 (partially).
*Data.Network.Address> readAddress "127.0.0.1" :: IPv4
*Data.Network.Address> let ip = readAddress "127.0.0.1" :: IPv4
*Data.Network.Address> showAddress ip
*Data.Network.Address> let subnet = readSubnet "192.168.1.42/8" :: IPSubnet IPv4
IPSubnet (IPv4 3232235776) (-256)
*Data.Network.Address> showSubnet subnet
*Data.Network.Address> showAddress . base $ subnet
*Data.Network.Address> (readAddress "192.168.1.5" :: IPv4) `member` subnet
*Data.Network.Address> (readAddress "192.168.2.5" :: IPv4) `member` subnet
I was looking for an IPv4/IPv6 data structure, and found a few
libraries such as network-data, iproute, and nettle-openflow. These
libraries are either written for a specific purpose or bring along
dependencies. I decided to create network-address to consolidate the
data structures and make a lightweight, fast, generic and complete
library for representing these addresses.
This is my first public Haskell library. The API is unstable and
possibly not idiomatic. I'd appreciate any feedback.
More information about the Haskell