-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Internet Protocol data structures
--
-- This package provides Internet Protocol data structures
@package network-ip
@version 0.1
-- | Internet Protocol addressing.
module Network.IP.Addr
-- | IPv4 address.
newtype IP4
IP4 :: Word32 -> IP4
unIP4 :: IP4 -> Word32
-- | IP4 proxy value.
anIP4 :: Proxy IP4
-- | The octets of an IPv4 address.
ip4ToOctets :: IP4 -> (Word8, Word8, Word8, Word8)
-- | List the octets of an IPv4 address.
ip4ToOctetList :: IP4 -> [Word8]
-- | Assemble IPv4 address from the octets.
ip4FromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> IP4
-- | Assemble IPv4 address from the octet list.
ip4FromOctetList :: [Word8] -> Maybe IP4
-- | IPv4 address 0.0.0.0.
anyIP4 :: IP4
-- | IPv6 address.
newtype IP6
IP6 :: Word128 -> IP6
unIP6 :: IP6 -> Word128
-- | IP6 proxy value.
anIP6 :: Proxy IP6
-- | The 16-bit pieces of an IPv6 address.
ip6ToWords :: IP6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16)
-- | List the 16-bit pieces of an IPv6 address.
ip6ToWordList :: IP6 -> [Word16]
-- | Assemble IPv6 address from the 16-bit pieces.
ip6FromWords :: Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> IP6
-- | Assemble IPv6 address from the list of 16-bit pieces.
ip6FromWordList :: [Word16] -> Maybe IP6
-- | IPv6 address ::.
anyIP6 :: IP6
data IP
IPv4 :: {-# UNPACK #-} !IP4 -> IP
IPv6 :: {-# UNPACK #-} !IP6 -> IP
-- | IP proxy value.
anIP :: Proxy IP
-- | Network address.
class IsNetAddr n where type family NetHost n
netHost :: IsNetAddr n => n -> NetHost n
netHostIx :: IsNetAddr n => n -> NetHost n
netPrefix :: IsNetAddr n => n -> NetHost n
netMask :: IsNetAddr n => n -> NetHost n
netLength :: IsNetAddr n => n -> Word8
netAddr :: IsNetAddr n => NetHost n -> Word8 -> n
type Net4Addr = NetAddr IP4
type Net6Addr = NetAddr IP6
-- | Network address: host address + network mask length.
data NetAddr a
-- | NetAddr proxy value.
aNetAddr :: Proxy NetAddr
-- | NetAddr a proxy value.
aNetAddrOf :: Proxy a -> Proxy (NetAddr a)
-- | Net4Addr proxy value.
aNet4Addr :: Proxy Net4Addr
-- | Net6Addr proxy value.
aNet6Addr :: Proxy Net6Addr
-- | NetAddr IP proxy value.
aNetAddrIP :: Proxy (NetAddr IP)
-- | Print network address (CIDR notation).
printNetAddr :: (IsNetAddr n, Printable (NetHost n), Printer p) => n -> p
-- | IPv4 network address parser (CIDR notation).
net4Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP4) => μ n
-- | IPv6 network address parser (CIDR notation).
net6Parser :: (CharParsing μ, Monad μ, IsNetAddr n, NetHost n ~ IP6) => μ n
-- | IP network address parser (CIDR notation).
netParser :: (IsNetAddr n, NetHost n ~ IP, CharParsing μ, Monad μ) => μ n
-- | Port number.
newtype InetPort
InetPort :: Word16 -> InetPort
unInetPort :: InetPort -> Word16
-- | InetPort proxy value.
anInetPort :: Proxy InetPort
-- | Socket address: host address + port number.
data InetAddr a
InetAddr :: a -> {-# UNPACK #-} !InetPort -> InetAddr a
inetHost :: InetAddr a -> a
inetPort :: InetAddr a -> {-# UNPACK #-} !InetPort
type Inet4Addr = InetAddr IP4
type Inet6Addr = InetAddr IP6
-- | InetAddr proxy value.
anInetAddr :: Proxy (InetAddr IP)
-- | InetAddr a proxy value.
anInetAddrOf :: Proxy a -> Proxy (InetAddr a)
-- | Inet4Addr proxy value.
anInet4Addr :: Proxy Inet4Addr
-- | Inet6Addr proxy value.
anInet6Addr :: Proxy Inet6Addr
-- | InetAddr IP proxy value.
anInetAddrIP :: Proxy (InetAddr IP)
instance Typeable IP4
instance Typeable IP6
instance Typeable IP
instance Typeable1 NetAddr
instance Typeable InetPort
instance Typeable1 InetAddr
instance Eq IP4
instance Ord IP4
instance Bounded IP4
instance Enum IP4
instance Ix IP4
instance Num IP4
instance Bits IP4
instance Hashable IP4
instance Binary IP4
instance Serialize IP4
instance Eq IP6
instance Ord IP6
instance Bounded IP6
instance Enum IP6
instance Ix IP6
instance Num IP6
instance Bits IP6
instance Hashable IP6
instance Eq IP
instance Ord IP
instance Show IP
instance Read IP
instance Eq a => Eq (NetAddr a)
instance Eq InetPort
instance Ord InetPort
instance Bounded InetPort
instance Enum InetPort
instance Ix InetPort
instance Num InetPort
instance Real InetPort
instance Integral InetPort
instance Bits InetPort
instance Hashable InetPort
instance Binary InetPort
instance Serialize InetPort
instance Printable InetPort
instance Eq a => Eq (InetAddr a)
instance Ord a => Ord (InetAddr a)
instance Show a => Show (InetAddr a)
instance Read a => Read (InetAddr a)
instance Serialize a => Serialize (InetAddr a)
instance Binary a => Binary (InetAddr a)
instance Hashable a => Hashable (InetAddr a)
instance Textual (InetAddr IP)
instance Textual Inet6Addr
instance Textual Inet4Addr
instance Printable (InetAddr IP)
instance Printable Inet6Addr
instance Printable Inet4Addr
instance Functor InetAddr
instance Storable InetPort
instance Textual InetPort
instance Read InetPort
instance Show InetPort
instance IsNetAddr (NetAddr IP)
instance IsNetAddr Net6Addr
instance IsNetAddr Net4Addr
instance Serialize (NetAddr IP)
instance Serialize Net6Addr
instance Serialize Net4Addr
instance Binary (NetAddr IP)
instance Binary Net6Addr
instance Binary Net4Addr
instance Textual (NetAddr IP)
instance Textual Net6Addr
instance Textual Net4Addr
instance Printable a => Printable (NetAddr a)
instance Read (NetAddr IP)
instance Read Net6Addr
instance Read Net4Addr
instance Show a => Show (NetAddr a)
instance Serialize IP
instance Binary IP
instance Textual IP
instance Printable IP
instance Default IP6
instance Serialize IP6
instance Binary IP6
instance Storable IP6
instance Textual IP6
instance Printable IP6
instance Read IP6
instance Show IP6
instance Default IP4
instance Storable IP4
instance Textual IP4
instance Printable IP4
instance Read IP4
instance Show IP4