HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulefoundation-0.0.30Haskell2010

Foundation.Network.IPv6

IPv6 data type

Contents
  1. parsers
Synopsis
datadata IPv6

IPv6 data type

Instances8Eq, Ord, Show, IsString, NormalForm, Storable, …
  • Eq IPv6Defined in foundation-0.0.30 · Foundation.Network.IPv6
  • Ord IPv6Defined in foundation-0.0.30 · Foundation.Network.IPv6
  • Show IPv6Defined in foundation-0.0.30 · Foundation.Network.IPv6
  • IsString IPv6Defined in foundation-0.0.30 · Foundation.Network.IPv6
  • NormalForm IPv6Defined in foundation-0.0.30 · Foundation.Network.IPv6
  • Storable IPv6Defined in foundation-0.0.30 · Foundation.Network.IPv6
  • StorableFixed IPv6Defined in foundation-0.0.30 · Foundation.Network.IPv6
  • Hashable IPv6Defined in foundation-0.0.30 · Foundation.Network.IPv6
valuetoString :: IPv6 -> String

serialise to human readable IPv6

Example1 expression
toString (fromString "0:0:0:0:0:0:0:1" :: IPv6)

parsers

valueipv6ParserCompressed :: (ParserSource input, Element input ~ Char, Element (Chunk input) ~ Char) => Parser input IPv6

IPv6 parser as described in RFC4291 section 2.2.2

The use of "::" indicates one or more groups of 16 bits of zeros. The "::" can only appear once in an address. The "::" can also be used to compress leading or trailing zeros in an address.

  • `2001:DB8::8:800:200C:417A`

  • `FF01::101`

  • `::1`

  • ::

valueipv6ParserIpv4Embedded :: (ParserSource input, Element input ~ Char, Element (Chunk input) ~ Char) => Parser input IPv6

IPv6 address with embedded IPv4 address

when dealing with a mixed environment of IPv4 and IPv6 nodes is x:x:x:x:x:x:d.d.d.d, where the xs are the hexadecimal values of the six high-order 16-bit pieces of the address, and the ds are the decimal values of the four low-order 8-bit pieces of the address (standard IPv4 representation).

  • `0:0:0:0:0:0:13.1.68.3`

  • `0:0:0:0:0:FFFF:129.144.52.38`

  • `::13.1.68.3`

  • `::FFFF:129.144.52.38`