From 5dcc479287537253a20c32d28854c7df83041896 Mon Sep 17 00:00:00 2001 From: Kazu Yamamoto Date: Tue, 29 May 2018 12:22:49 +0900 Subject: [PATCH] exporting packFamily and unpackFamily again. (#324). --- Network/Socket.hs | 2 ++ Network/Socket/Types.hsc | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Network/Socket.hs b/Network/Socket.hs index 38c923b6..7ccd2986 100644 --- a/Network/Socket.hs +++ b/Network/Socket.hs @@ -137,6 +137,8 @@ module Network.Socket -- ** Family , Family(..) , isSupportedFamily + , packFamily + , unpackFamily -- ** Protocol number , ProtocolNumber , defaultProtocol diff --git a/Network/Socket/Types.hsc b/Network/Socket/Types.hsc index 240b9a39..8f29699a 100644 --- a/Network/Socket/Types.hsc +++ b/Network/Socket/Types.hsc @@ -315,6 +315,7 @@ data Family | AF_CAN -- ^ Controller Area Network deriving (Eq, Ord, Read, Show) +-- | Converting 'Family' to 'CInt'. packFamily :: Family -> CInt packFamily f = case packFamily' f of Just fam -> fam @@ -531,6 +532,7 @@ packFamily' f = case Just f of --------- ---------- +-- | Converting 'CInt' to 'Family'. unpackFamily :: CInt -> Family unpackFamily f = case f of (#const AF_UNSPEC) -> AF_UNSPEC