text-postgresql-0.0.3.1: Parser and Printer of PostgreSQL extended types

Copyright2015-2018 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe
LanguageHaskell2010

Data.PostgreSQL.NetworkAddress

Contents

Description

This module defines network-address types of PostgreSQL. http://www.postgresql.org/docs/current/static/datatype-net-types.html

Synopsis

Definitions about inet and cidr types

newtype Inet Source #

Corresponding to INET type of PostgreSQL

Constructors

Inet NetAddress 
Instances
Eq Inet Source # 
Instance details

Defined in Data.PostgreSQL.NetworkAddress

Methods

(==) :: Inet -> Inet -> Bool #

(/=) :: Inet -> Inet -> Bool #

Ord Inet Source # 
Instance details

Defined in Data.PostgreSQL.NetworkAddress

Methods

compare :: Inet -> Inet -> Ordering #

(<) :: Inet -> Inet -> Bool #

(<=) :: Inet -> Inet -> Bool #

(>) :: Inet -> Inet -> Bool #

(>=) :: Inet -> Inet -> Bool #

max :: Inet -> Inet -> Inet #

min :: Inet -> Inet -> Inet #

Read Inet Source # 
Instance details

Defined in Data.PostgreSQL.NetworkAddress

Show Inet Source # 
Instance details

Defined in Data.PostgreSQL.NetworkAddress

Methods

showsPrec :: Int -> Inet -> ShowS #

show :: Inet -> String #

showList :: [Inet] -> ShowS #

newtype Cidr Source #

Corresponding to CIDR type of PostgreSQL

Constructors

Cidr NetAddress 
Instances
Eq Cidr Source # 
Instance details

Defined in Data.PostgreSQL.NetworkAddress

Methods

(==) :: Cidr -> Cidr -> Bool #

(/=) :: Cidr -> Cidr -> Bool #

Ord Cidr Source # 
Instance details

Defined in Data.PostgreSQL.NetworkAddress

Methods

compare :: Cidr -> Cidr -> Ordering #

(<) :: Cidr -> Cidr -> Bool #

(<=) :: Cidr -> Cidr -> Bool #

(>) :: Cidr -> Cidr -> Bool #

(>=) :: Cidr -> Cidr -> Bool #

max :: Cidr -> Cidr -> Cidr #

min :: Cidr -> Cidr -> Cidr #

Read Cidr Source # 
Instance details

Defined in Data.PostgreSQL.NetworkAddress

Show Cidr Source # 
Instance details

Defined in Data.PostgreSQL.NetworkAddress

Methods

showsPrec :: Int -> Cidr -> ShowS #

show :: Cidr -> String #

showList :: [Cidr] -> ShowS #

cidr4 :: V4HostAddress -> Word8 -> Maybe Cidr Source #

Make Cidr type of IPv4 from host-address bits consistent with mask

cidr4' :: V4HostAddress -> Word8 -> Maybe Cidr Source #

Same as cidr4 except for dropping host-address bits along with mask

cidr6 :: V6HostAddress -> Word8 -> Maybe Cidr Source #

Make Cidr type of IPv6 from host-address bits consistent with mask

cidr6' :: V6HostAddress -> Word8 -> Maybe Cidr Source #

Same as cidr6 except for dropping host-address bits along with mask

Definitions about the address type which is the pair of host-address and mask

netAddress4 Source #

Arguments

:: V4HostAddress

IPv4 host-address

-> Word8

IPv4 mask 0-32

-> Maybe NetAddress

result NetAddress

Make IPv4 NetAddress type consistent with IPv4 mask

netAddress6 Source #

Arguments

:: V6HostAddress

IPv6 host-address

-> Word8

IPv6 mask 0-128

-> Maybe NetAddress

result NetAddress

Make IPv6 NetAddress type consistent with IPv6 mask

Definitions about the host-address types

data V6HostAddress Source #

Host address type along with IPv6 address words with IPv6 string order. Each Word16 value is host byte order. Host byte order is portable in programs on its own host. Network byte order is only needed, when communicating other hosts.