network: Low-level networking interface

[ bsd3, library, network ] [ Propose Tags ]

This package provides a low-level networking interface.

High-Level Packages

Other packages provide higher level interfaces:

  • connection

  • hookup

  • network-simple

Extended Packages

network seeks to provide a cross-platform core for networking. As such some APIs live in extended libraries. Packages in the network ecosystem are often prefixed with network-.


In network- the Network.BSD module was split off into its own package, network-bsd-


In network-2.6 the Network.URI module was split off into its own package, network-uri-2.6. If you're using the Network.URI module you can automatically get it from the right package by adding this to your .cabal file:

  build-depends: network-uri-flag

[Skip to Readme]


Automatic Flags

using tests for developers


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees


  • No Candidates
Versions [RSS] 2.0,,,, 2.2.1,,,,,,,,,,, 2.2.3,, 2.3,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, (info)
Change log
Dependencies base (>=4.9 && <4.17), bytestring (>=0.10 && <0.12), deepseq, directory [details]
License BSD-3-Clause
Maintainer Kazu Yamamoto, Evan Borden
Revised Revision 1 made by KazuYamamoto at 2023-05-12T00:57:06Z
Category Network
Home page
Bug tracker
Source repo head: git clone git://
Uploaded by KazuYamamoto at 2022-01-20T13:31:47Z
Distributions Arch:, Debian:, Fedora:, FreeBSD:, LTSHaskell:, NixOS:, Stackage:, openSUSE:
Reverse Dependencies 986 direct, 4593 indirect [details]
Downloads 495249 total (998 in the last 30 days)
Rating 2.5 (votes: 4) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-01-20 [all 1 reports]

Readme for network-

[back to package description]

GitHub Actions status


To build this package directly from git, you must run autoreconf -i. And then use cabal configure; cabal build or stack build.

Support Policy


The network package support 3 major versions of GHC only. This means that the current stable version and two previous stable versions are supported. However, all GHC 8.x are supported currently.


We use MSYS to build this package on Windows. To use the network package on Cygwin, use stack.


.hs files

If you need C macros created by "configure" or CALLCONV/SAFE_ON_WIN, put

#include "HsNetDef.h"

"HsNet.h" does now work well since Mac's cpp sucks.

.hsc files

If you need #peek, #poke and others, create a .hsc file with

#include "HsNet.h"

HsNet.h includes HsNefDef.h and necessary C structures. Unfortunately, hsc2hs does not convert C macros. So, if you use CALLCONV/SAFE_ON_WIN, the following is also necessary:

##include "HsNetDef.h"



  • Making SockAddrCan deprecated



  • Making Network deprecated
  • Making Network.BSD deprecated
  • Making MkSocket deprecated
  • Making many APIs deprecated


  • Stop exporting the PortNum Constructor in PortNumber


  • Removing Network
  • Removing Network.BSD
  • Removing SockAddrCan
  • Changing the internal structure of Socket.
  • Make address extensible.
  • Remove EOF errors