IPv6Addr-0.6.3: Library to deal with IPv6 address text representations.

Safe HaskellSafe
LanguageHaskell2010

Text.IPv6Addr.Internal

Synopsis

Documentation

ipv4AddrToIPv6AddrTokens :: IPv6AddrToken -> [IPv6AddrToken] Source #

Rewrites an embedded IPv4Addr into the corresponding list of pure IPv6Addr tokens.

ipv4AddrToIPv6AddrTokens (IPv4Addr "127.0.0.1") == [SixteenBits "7f0",Colon,SixteenBits "1"]

ipv6TokensToText :: [IPv6AddrToken] -> Text Source #

Given an arbitrary list of IPv6AddrToken, returns the corresponding Text.

isIPv6Addr :: [IPv6AddrToken] -> Bool Source #

Returns True if a list of IPv6AddrToken constitutes a valid IPv6 Address.

maybeTokIPv6Addr :: Text -> Maybe [IPv6AddrToken] Source #

This is the main function which returns Just the list of a tokenized IPv6 address text representation validated against RFC 4291 and canonized in conformation with RFC 5952, or Nothing.

maybeTokPureIPv6Addr :: Text -> Maybe [IPv6AddrToken] Source #

Returns Just the list of tokenized pure IPv6 address, always rewriting an embedded IPv4 address if present.

fromIPv6Addr :: IPv6Addr -> Text Source #

Returns the Text of an IPv6 address.