We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 317ab6a commit 6a014eeCopy full SHA for 6a014ee
Network/Socket/Options.hsc
@@ -2,6 +2,7 @@
2
{-# LANGUAGE DeriveDataTypeable #-}
3
{-# LANGUAGE PatternSynonyms #-}
4
{-# LANGUAGE ScopedTypeVariables #-}
5
+{-# LANGUAGE ViewPatterns #-}
6
7
#include "HsNet.h"
8
##include "HsNetDef.h"
@@ -14,7 +15,8 @@ module Network.Socket.Options (
14
15
,RecvLowWater,SendLowWater,RecvTimeOut,SendTimeOut
16
,UseLoopBack,UserTimeout,IPv6Only
17
,RecvIPv4TTL,RecvIPv4TOS,RecvIPv4PktInfo
- ,RecvIPv6HopLimit,RecvIPv6TClass,RecvIPv6PktInfo)
18
+ ,RecvIPv6HopLimit,RecvIPv6TClass,RecvIPv6PktInfo
19
+ ,CustomSockOpt)
20
, isSupportedSocketOption
21
, whenSupported
22
, getSocketType
@@ -273,6 +275,11 @@ pattern RecvIPv6PktInfo = SockOpt (-1) (-1)
273
275
#endif
274
276
#endif // HAVE_DECL_IPPROTO_IPV6
277
278
+pattern CustomSockOpt :: (CInt, CInt) -> SocketOption
279
+pattern CustomSockOpt xy <- ((\(SockOpt x y) -> (x, y)) -> xy)
280
+ where
281
+ CustomSockOpt (x, y) = SockOpt x y
282
+
283
#ifdef SO_LINGER
284
data StructLinger = StructLinger CInt CInt
285
0 commit comments