h$Xy      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ NoneipThis is slower that just pattern matching on the Text data constructor. However, it will work with GHCJS. This should only be used in places where we know that it will only be evaluated once.ipThis length is not the character length. It is the length of Word16s required by a UTF16 representation. None8ip,A character in the basic multilingual plane.see src/Data/LICENSE experimentalnon-portable (GHC Extensions)Nonecip12-bit unsigned integer typeip!narrowings represented as primop  in GHC.ipcount leading zerosipcount trailing zerosipthe number of set bitsNone '(gipCharacters outside the basic multilingual plane are not handled correctly by this function. They will not cause a program to crash; instead, the character will have the upper bits masked out.  None '( None./381i6ipThe length should be between 0 and 32. These bounds are inclusive. This expectation is not in any way enforced by this library because it does not cause errors. A mask length greater than 32 will be treated as if it were 32.ipA 32-bit Internet Protocol version 4 address. To use this with the network! library, it is necessary to use Network.Socket.htonl to convert the underlying / from host byte order to network byte order.ipUnboxed variant of . Before GHC 8.10, this is implemented as a type synonym. Portable use of this type requires treating it as though it were opaque. Use ' and () to convert between this and the lifted .ip Create an  address from four octets. The first argument is the most significant octet. The last argument is the least significant. Since IP addresses are commonly written using dot-decimal notation, this is the recommended way to create an IP address. Additionally, it is used for the  and  instances of & to help keep things readable in GHCi.let addr = ipv4 192 168 1 1addripv4 192 168 1 1 getIPv4 addr 3232235777 ipAn alias for the  smart constructor. ipAn uncurried variant of  . ip Convert an  address into a quadruple of octets. The first element in the quadruple is the most significant octet. The last element is the least significant octet. ip%The IP address representing any host.any ipv4 0 0 0 0 ipThe local loopback IP address.loopbackipv4 127 0 0 1ipA useful and common alias for  . localhostipv4 127 0 0 1ipThe broadcast IP address. broadcastipv4 255 255 255 255ipChecks to see if the  address belongs to a private network. The three private networks that are checked are  10.0.0.0/8,  172.16.0.0/12, and 192.168.0.0/16.ipChecks to see if the  address belongs to a reserved network. This includes the three private networks that  checks along with several other ranges that are not used on the public Internet. The implementation of this function is optimized.ipChecks to see if the  address is publicly routable.public x == not (reserved x)ip Encode an  address to  using dot-decimal notation:'T.putStrLn (encode (ipv4 192 168 2 47)) 192.168.2.47ip Decode an  address.decode "192.168.2.47"Just (ipv4 192 168 2 47)decode "10.100.256.256"Nothingip Encode an  address to a text .builder (ipv4 192 168 2 47)"192.168.2.47"ip Parse an  address using a .reader "192.168.2.47"Right (ipv4 192 168 2 47,"")reader "192.168.2.470">Left "All octets in an IPv4 address must be between 0 and 255"ip Parse an  address using a ."AT.parseOnly parser "192.168.2.47"Right (ipv4 192 168 2 47)#AT.parseOnly parser "192.168.2.470"Left "Failed reading: All octets in an IPv4 address must be between 0 and 255"ip Encode an  address to a UTF-8 encoded .encodeUtf8 (ipv4 192 168 2 47)"192.168.2.47"ipDecode a UTF8-encoded  into an .decodeUtf8 "192.168.2.47"Just (ipv4 192 168 2 47)Currently not terribly efficient since the implementation re-encodes the argument as UTF-16 text before decoding that IPv4 address from that. PRs to fix this are welcome.ipDecode  as an  address.decodeShort "192.168.3.48"Just (ipv4 192 168 3 48)ip Encode an  address as .encodeShort (ipv4 192 168 5 99)"192.168.5.99"ipDecode UTF-8-encoded Bytes into an  address.3decodeUtf8Bytes (Bytes.fromAsciiString "127.0.0.1")Just (ipv4 127 0 0 1)ipParse UTF-8-encoded Bytes as an  address.Parser.parseBytes (parserUtf8Bytes ()) (Bytes.fromAsciiString "10.0.1.254")Success (Slice {offset = 10, length = 0, value = ipv4 10 0 1 254})ip Variant of  with unboxed result type.ipParse UTF-8-encoded Bytes into an (. This requires the mask to be present.maybe (putStrLn "nope") printRange $ Parser.parseBytesMaybe (parserRangeUtf8Bytes ()) (Bytes.fromAsciiString "192.168.0.0/16")192.168.0.0/16maybe (putStrLn "nope") printRange $ Parser.parseBytesMaybe (parserRangeUtf8Bytes ()) (Bytes.fromAsciiString "10.10.10.1")nopeSee  0 for a variant that treats a missing mask as a /32 mask. ip Variant of  that allows the mask to be omitted. An omitted mask is treated as a /32 mask.maybe (putStrLn "nope") printRange $ Parser.parseBytesMaybe (parserRangeUtf8BytesLenient ()) (Bytes.fromAsciiString "192.168.0.0/16")192.168.0.0/16maybe (putStrLn "nope") printRange $ Parser.parseBytesMaybe (parserRangeUtf8BytesLenient ()) (Bytes.fromAsciiString "10.10.10.1") 10.10.10.1/32!ip Encode an  as a bytestring Builder.toLazyByteString (builderUtf8 (fromOctets 192 168 2 12))"192.168.2.12""ip Encode an + address as a unbounded byte array builder.Chunks.concat (UB.run 1 (byteArrayBuilderUtf8 (fromOctets 192 168 2 13)))=[0x31,0x39,0x32,0x2e,0x31,0x36,0x38,0x2e,0x32,0x2e,0x31,0x33](Note that period is encoded by UTF-8 as 0x2e.#ip Encode an ) address as a bounded byte array builder.BB.run Nat.constant (boundedBuilderUtf8 (fromOctets 192 168 2 14))[0x31, 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x32, 0x2e, 0x31, 0x34](Note that period is encoded by UTF-8 as 0x2e.$ip Parse an  using a .&AB.parseOnly parserUtf8 "192.168.2.47"Right (ipv4 192 168 2 47)'AB.parseOnly parserUtf8 "192.168.2.470"Left "Failed reading: All octets in an ipv4 address must be between 0 and 255"%ip Encode an  as a .&ip Decode an  from a .'ip/Convert an unboxed IPv4 address to a boxed one.(ip/Convert a boxed IPv4 address to an unboxed one.)ip Print an  using the textual encoding.*ipSmart constructor for . Ensures the mask is appropriately sized and sets masked bits in the  to zero.+ipGiven an inclusive lower and upper ip address, create the smallest  that contains the two. This is helpful in situations where input given as a range like 192.168.16.0-192.168.19.255 needs to be handled. This makes the range broader if it cannot be represented in CIDR notation.printRange $ fromBounds (fromOctets 192 168 16 0) (fromOctets 192 168 19 255)192.168.16.0/22printRange $ fromBounds (fromOctets 10 0 5 7) (fromOctets 10 0 5 14) 10.0.5.0/28,ipChecks to see if an  address belongs in the .let ip = fromOctets 10 10 1 92/contains (IPv4Range (fromOctets 10 0 0 0) 8) ipTrue1contains (IPv4Range (fromOctets 10 11 0 0) 16) ipFalseTypically, element-testing functions are written to take the element as the first argument and the set as the second argument. This is intentionally written the other way for better performance when iterating over a collection. For example, you might test elements in a list for membership like this:,let r = IPv4Range (fromOctets 10 10 10 6) 31mapM_ (P.print . contains r) (take 5 $ iterate succ $ fromOctets 10 10 10 5)FalseTrueTrueFalseFalseThe implementation of , ensures that (with GHC), the bitmask creation and range normalization only occur once in the above example. They are reused as the list is iterated.-ip5This is provided to mirror the interface provided by Data.Set. It behaves just like , but with flipped arguments.member ip r == contains r ip.ip The inclusive lower bound of an . This is conventionally understood to be the broadcast address of a subnet. For example:T.putStrLn $ encode $ lowerInclusive $ IPv4Range (ipv4 10 10 1 160) 25 10.10.1.128*Note that the lower bound of a normalized ( is simply the ip address of the range:/lowerInclusive r == ipv4RangeBase (normalize r)/ip The inclusive upper bound of an .T.putStrLn $ encode $ upperInclusive $ IPv4Range (ipv4 10 10 1 160) 25 10.10.1.2550ip Convert an  into a list of the  addresses that are in it.-let r = IPv4Range (fromOctets 192 168 1 8) 30&mapM_ (T.putStrLn . encode) (toList r) 192.168.1.8 192.168.1.9 192.168.1.10 192.168.1.111ip'A stream-polymorphic generator over an . For more information, see  http://www.haskellforall.com/2014/11/how-to-build-library-agnostic-streaming.html/How to build library-agnostic streaming sources.2ip'The RFC1918 24-bit block. Subnet mask:  10.0.0.0/83ip'The RFC1918 20-bit block. Subnet mask:  172.16.0.0/124ip'The RFC1918 16-bit block. Subnet mask: 192.168.0.0/165ip Normalize an (. The first result of this is that the  inside the  is changed so that the insignificant bits are zeroed out. For example:?printRange $ normalize $ IPv4Range (fromOctets 192 168 1 19) 24192.168.1.0/24printRange $ normalize $ IPv4Range (fromOctets 192 168 1 163) 28192.168.1.160/28The second effect of this is that the mask length is lowered to be 32 or smaller. Working with s that have not been normalized does not cause any issues for this library, although other applications may reject such ranges (especially those with a mask length above 32). Note that 5 is idempotent, that is:(normalize r == (normalize . normalize) r6ip Encode an  as .,encodeRange (IPv4Range (ipv4 172 16 0 0) 12)"172.16.0.0/12"7ip Decode an  from .decodeRange "172.16.0.0/12"Just (IPv4Range {ipv4RangeBase = ipv4 172 16 0 0, ipv4RangeLength = 12})decodeRange "192.168.25.254/16"Just (IPv4Range {ipv4RangeBase = ipv4 192 168 0 0, ipv4RangeLength = 16})8ip Encode an  to a .-builderRange (IPv4Range (ipv4 172 16 0 0) 12)"172.16.0.0/12"9ip Parse an  using a .,AT.parseOnly parserRange "192.168.25.254/16"Right (IPv4Range {ipv4RangeBase = ipv4 192 168 0 0, ipv4RangeLength = 16}):ip Print an =. Helper function that exists mostly for testing purposes.;  !"#$%&'()*+,-./0123456789:; !$"#%&)*+5,-./012346789: '(None./038V#^ipAn ^. It is made up of the first b in the range and its length.bip.A 128-bit Internet Protocol version 6 address.eip Print an b using the textual encoding.fipDecode  as an b address.decodeShort "ffff::2:b"Just (ipv6 0xffff 0x0000 0x0000 0x0000 0x0000 0x0000 0x0002 0x000b)gipThis could be useful for the rare occasion in which one could construct an b from octets.Note that while  Net.IPv4.  = Net.IPv4. , $Net.IPv6.fromOctets /= Net.IPv6.ipv6. While this should be obvious from their types, it is worth mentioning since the similarity in naming might be confusing.hip Create an b address from the eight 16-bit fragments that make it up. This closely resembles the standard IPv6 notation, so is used for the  instance. Note that this lacks the formatting feature for suppress zeroes in an b address, but it should be readable enough for hacking in GHCi.BBB.run Nat.constant $ boundedBuilderUtf8 $ mac 0xDEADBEEF1609[0x64, 0x65, 0x3a, 0x61, 0x64, 0x3a, 0x62, 0x65, 0x3a, 0x65, 0x66, 0x3a, 0x31, 0x36, 0x3a, 0x30, 0x39]ipLenient decoding of MAC address. This is case insensitive and allows either : or - as the separator. It also allows leading zeroes to be missing.;decodeUtf8Bytes (Bytes.fromAsciiString "A2:DE:AD:BE:EF:67")Just (mac 0xa2deadbeef67);decodeUtf8Bytes (Bytes.fromAsciiString "13-a2-FE-A4-17-96")Just (mac 0x13a2fea41796)ipLeniently parse UTF-8-encoded Bytes as a 8 address. This is case insensitive and allows either : or - as the separator. It also allows leading zeroes to be missing.Parser.parseBytes (parserUtf8Bytes ()) (Bytes.fromAsciiString "de:ad:BE:EF:1:23")Success (Slice {offset = 16, length = 0, value = mac 0xdeadbeef0123})ip!Make a bytestring builder from a + address using a colon as the separator.ipLenient parser for a  address using any character as the separator and accepting any digit grouping (i.e. FA:43:B2:C0:0F:99 or A065.647B.87FA).ip Parser for a % address using the provided settings.ip Encode a  address as a  using the given .m = Mac 0xA47F247AB423'BC.putStrLn $ encodeWithUtf8 defCodec ma4:7f:24:7a:b4:23BC.putStrLn $ encodeWithUtf8 (MacCodec (MacGroupingTriples '-') True) mA47-F24-7AB-423ipPrint a $ address using the textual encoding.ipThis only preserves the lower 6 bytes of the 8-byte word that backs a mac address. It runs slower than it would if it used a full 8-byte word, but it consumes less space. When storing millions of mac addresses, this is a good trade to make. When storing a small number of mac address, it might be preferable to make a primitive array of  instead and use the mac address data constructor to coerce between the two.## Noney_^_`abcdbcd^_`a     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefgghijjk2# lmnopqr%,$&() >?@B5678C34stuvwxyz{|}~ l$,#&2  !"$,%&*-2          ip-1.7.3-55ZwDgM4labHVZFLHwdgFhNet.IPv4Net.IPv6Net.IPNet.Mac!Data.Text.Builder.Common.InternalData.Text.Builder.VariableData.Word.Synthetic.Word12Data.Text.Builder.FixedData.ByteString.Builder.Fixed fromOctetsipv4 Net.Types IPv4Range ipv4RangeBaseipv4RangeLengthIPv4getIPv4IPv4#fromTupleOctetstoOctetsanyloopback localhost broadcastprivatereservedpublicencodedecodebuilderreaderparser encodeUtf8 decodeUtf8 decodeShort encodeShortdecodeUtf8BytesparserUtf8BytesparserUtf8Bytes#parserRangeUtf8BytesparserRangeUtf8BytesLenient builderUtf8byteArrayBuilderUtf8boundedBuilderUtf8 parserUtf8 encodeString decodeStringboxunboxprintrange fromBoundscontainsmemberlowerInclusiveupperInclusivetoList toGenerator private24 private20 private16 normalize encodeRange decodeRange builderRange parserRange printRange$fFromJSONKeyIPv4$fToJSONKeyIPv4$fFromJSONIPv4 $fToJSONIPv4$fVectorVectorIPv4$fMVectorMVectorIPv4 $fUnboxIPv4 $fReadIPv4 $fShowIPv4 $fNFDataIPv4$fVectorVectorIPv4Range$fMVectorMVectorIPv4Range$fUnboxIPv4Range$fFromJSONIPv4Range$fToJSONIPv4Range$fHashableIPv4Range$fNFDataIPv4Range $fEqIPv4Range$fOrdIPv4Range$fShowIPv4Range$fReadIPv4Range$fGenericIPv4Range$fDataIPv4Range $fBitsIPv4 $fBoundedIPv4 $fDataIPv4 $fEnumIPv4$fEqIPv4$fFiniteBitsIPv4 $fGenericIPv4$fHashableIPv4$fIxIPv4 $fOrdIPv4 $fPrimIPv4$fStorableIPv4 IPv6Range ipv6RangeBaseipv6RangeLengthIPv6getIPv6ipv6 fromWord16s toWord16sfromTupleWord16s fromWord32sfromTupleWord32s toWord32s$fFromJSONIPv6 $fToJSONIPv6 $fReadIPv6 $fShowIPv6$fFromJSONIPv6Range$fToJSONIPv6Range$fNFDataIPv6Range $fEqIPv6Range$fOrdIPv6Range$fShowIPv6Range$fReadIPv6Range$fGenericIPv6Range$fDataIPv6Range $fBoundedIPv6 $fEnumIPv6$fEqIPv6 $fOrdIPv6$fStorableIPv6 $fBitsIPv6$fFiniteBitsIPv6 $fNFDataIPv6 $fPrimIPv6$fIxIPv6 $fDataIPv6IPgetIPcase_fromIPv4fromIPv6isIPv4isIPv6 $fFromJSONIP $fToJSONIP$fReadIP$fShowIP $fNFDataIP$fEqIP$fOrdIP $fGenericIP$fIxIP$fDataIP MacGroupingMacGroupingPairsMacGroupingTriplesMacGroupingQuadruplesMacGroupingNoSeparatorMacCodecmacCodecGroupingmacCodecUpperCaseMacmac decodeBytes decodeOctets encodeWith decodeWith parserWithdecodeWithUtf8parserWithUtf8encodeWithUtf8 $fFromJSONMac$fFromJSONKeyMac$fToJSONKeyMac $fToJSONMac $fHashableMac $fEnumMac $fBoundedMac $fReadMac $fShowMac $fPrimMac $fNFDataMac $fEqMacCodec $fOrdMacCodec$fShowMacCodec$fReadMacCodec$fGenericMacCodec$fDataMacCodec$fEqMacGrouping$fOrdMacGrouping$fShowMacGrouping$fReadMacGrouping$fGenericMacGrouping$fDataMacGrouping$fEqMac$fOrdMac $fGenericMac$fIxMac $fDataMacportableTextArrayportableTextLengthportableUntext writeString charUtf16SizehexValuesWord12UpperhexValuesWord12LowerhexValuesWord8UpperhexValuesWord8LowertwoDecimalDigitsthreeDecimalDigitscharBmpBuilderrun contramap staticCharBmpword8Word12 narrow12Word#ghc-primGHC.Primand#clz12#ctz12# popCnt12#W12#fromTextcontramapBuilderword8HexFixedUpperword8HexFixedLowerword12HexFixedUpperword12HexFixedLowerfromByteStringchar8baseGHC.WordWord32GHC.ShowShowGHC.ReadRead text-1.2.3.2Data.Text.InternalTextData.Text.Internal.BuilderData.Text.ReadReader*attoparsec-0.13.2.4-JRid9zEiLev1OUHUDdftfYData.Attoparsec.Text.InternalParserbytestring-0.10.10.0Data.ByteString.Internal ByteString'text-short-0.1.3-ASCIMgLxu93KXFLXfYz2DTData.Text.Short.Internal ShortText Data.ByteString.Builder.Internal#Data.Attoparsec.ByteString.InternalGHC.BaseStringWord8Word64defCodec