socket-unix: Unix domain sockets

[ library, mit, network, system ] [ Propose Tags ]

A Unix domain socket extension for the socket library

[Skip to Readme]
Dependencies base (>=4.7 && <5), bytestring (>= && <0.11), socket (>= && < [details]
License MIT
Copyright 2017 Vyacheslav Hashov
Author Vyacheslav Hashov
Revised Revision 1 made by VyacheslavHashov at Fri Jan 6 05:20:56 UTC 2017
Category System, Network
Home page
Source repo head: git clone
Uploaded by VyacheslavHashov at Fri Jan 6 05:18:39 UTC 2017
Distributions NixOS:
Downloads 764 total (16 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-01-06 [all 1 reports]
Hackage Matrix CI




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

For package maintainers and hackage trustees

Readme for socket-unix-

[back to package description]

Available on Hackage License MIT Build Status


A Unix domain socket API for the socket library.


Creating the Unix domain socket:

import System.Socket
import System.Socket.Type.Stream
import System.Socket.Family.Unix

s <- socket :: IO (Socket Unix Stream Unix)

Creating the address for binding/connecting

address <- case socketAddressUnixPath "example.sock" of
             Just addr -> pure addr
             Nothing -> putStrLn "invalid pathname for socket"


Binding to a socket with a filename creates a socket in the filesystem, but does not unlink it after close called. You should handle deleting links yourself.


Only Linux is supported.