!?      !"#$%&'()*+,-./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.ipkThis length is not the character length. It is the length of Word16s required by a UTF16 representation. NoneSX`6ip,A character in the basic multilingual plane.ip(Default, used when index is out of rangeipTexts to index intosee src/Data/LICENSE experimentalnon-portable (GHC Extensions)NoneFip12-bit unsigned integer typeip!narrowings represented as primop  in GHC.ipcount leading zerosipcount trailing zerosipthe number of set bitsNone&'SXipCharacters 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&'SXip Taken from Data.ByteString.Internal". The same warnings apply here.      None-.7@AFHMV:ipThe 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.ipFA 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 Y 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 W address belongs to a reserved network. This includes the three private networks that S checks along with several other ranges that are not used on the public Internet.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"NLeft "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.KParser.parseBytes (parserUtf8Bytes ()) (Bytes.fromAsciiString "10.0.1.254")BSuccess (Slice {offset = 10, length = 0, value = ipv4 10 0 1 254})ip Variant of  with unboxed result type.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.9UB.run 1 (byteArrayBuilderUtf8 (fromOctets 192 168 2 13))H[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.BBB.run Nat.constant (boundedBuilderUtf8 (fromOctets 192 168 2 14))H[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"NLeft "Failed reading: All octets in an ipv4 address must be between 0 and 255"#ip Encode an  as a .$ip Decode an  from a .%ip0Convert an unboxed IPv4 address to a boxed one. &ip0Convert a boxed IPv4 address to an unboxed one. 'ip Print an  using the textual encoding.ipThis is sort of a misnomer. It takes Word to make dotDecimalParser perform better. This is mostly for internal use. The arguments must all fit in a Word8. ip^This does not do an endOfInput check because it is reused in the range parser implementation.!ipI think that this function can be improved. Right now, it always allocates enough space for a fifteen-character text rendering of an IP address. I think that it should be possible to do more of the math upfront and allocate less space.(ipSmart constructor for I. Ensures the mask is appropriately sized and sets masked bits in the  to zero.)ipDGiven an inclusive lower and upper ip address, create the smallest Y that contains the two. This is helpful in situations where input given as a range like 192.168.16.0-192.168.19.255b needs to be handled. This makes the range broader if it cannot be represented in CIDR notation.MprintRange $ fromBounds (fromOctets 192 168 16 0) (fromOctets 192 168 19 255)192.168.16.0/22DprintRange $ 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) ipFalse/Typically, 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) 31LmapM_ (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:FT.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 .FT.putStrLn $ encode $ upperInclusive $ IPv4Range (ipv4 10 10 1 160) 25 10.10.1.255.ip 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.11/ip'A stream-polymorphic generator over an . For more information, see  Qhttp://www.haskellforall.com/2014/11/how-to-build-library-agnostic-streaming.html/How to build library-agnostic streaming sources.0ip'The RFC1918 24-bit block. Subnet mask:  10.0.0.0/81ip'The RFC1918 20-bit block. Subnet mask:  172.16.0.0/122ip'The RFC1918 16-bit block. Subnet mask: 192.168.0.0/163ip Normalize an (. The first result of this is that the  inside the H is changed so that the insignificant bits are zeroed out. For example:?printRange $ normalize $ IPv4Range (fromOctets 192 168 1 19) 24192.168.1.0/24@printRange $ normalize $ IPv4Range (fromOctets 192 168 1 163) 28192.168.1.160/28`The 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 3 is idempotent, that is:(normalize r == (normalize . normalize) r4ip Encode an  as .,encodeRange (IPv4Range (ipv4 172 16 0 0) 12)"172.16.0.0/12"5ip Decode an  from .decodeRange "172.16.0.0/12"HJust (IPv4Range {ipv4RangeBase = ipv4 172 16 0 0, ipv4RangeLength = 12})decodeRange "192.168.25.254/16"IJust (IPv4Range {ipv4RangeBase = ipv4 192 168 0 0, ipv4RangeLength = 16})6ip Encode an  to a .-builderRange (IPv4Range (ipv4 172 16 0 0) 12)"172.16.0.0/12"7ip Parse an  using a .,AT.parseOnly parserRange "192.168.25.254/16"JRight (IPv4Range {ipv4RangeBase = ipv4 192 168 0 0, ipv4RangeLength = 16})8ip Print an =. Helper function that exists mostly for testing purposes.:ipNote: we use network order (big endian) as opposed to host order (little endian) which differs from the underlying IPv4 type representation.Eip0Note: the size is determined by the range lengthFipNotes:.bit operations use network order (big endian),do not operate on host bits,-return a normalized range dropping host bits,Rand "promote operands" by extending the length to the larger of two ranges.9  !"#$%&'()*+,-./0123456789 " !#$'()3*+,-./01245678%&None-./7FHMX_-![ipAn [. It is made up of the first _ in the range and its length._ip.A 128-bit Internet Protocol version 6 address.bip Print an _ using the textual encoding.cipDecode  as an _ address.decodeShort "ffff::2:b"CJust (ipv6 0xffff 0x0000 0x0000 0x0000 0x0000 0x0000 0x0002 0x000b)dipNThis could be useful for the rare occasion in which one could construct an _ 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.eip Create an _ address from the eight 16-bit fragments that make it up. This closely resembles the standard IPv6 notation, so is used for the T 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.<let addr = ipv6 0x3124 0x0 0x0 0xDEAD 0xCAFE 0xFF 0xFE00 0x1addr<ipv6 0x3124 0x0000 0x0000 0xdead 0xcafe 0x00ff 0xfe00 0x0001T.putStrLn (encode addr)3124::dead:cafe:ff:fe00:1fipAn alias for the e smart constructor.gip Convert an _ to eight 16-bit words.hipUncurried variant of f.iip Build an _e from four 32-bit words. The leftmost argument is the high word and the rightword is the low word.jipUncurried variant of i.kip Convert an _ to four 32-bit words.lipThe local loopback IP address.loopback<ipv6 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0001mipA useful alias for l. localhost<ipv6 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0001nip%The IP address representing any host.any<ipv6 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000oip Encodes the __ address using zero-compression on the leftmost longest string of zeroes in the address. Per  -https://tools.ietf.org/html/rfc5952#section-5RFC 5952 Section 5F, this uses mixed notation when encoding an IPv4-mapped IPv6 address:JT.putStrLn $ encode $ fromWord16s 0xDEAD 0xBEEF 0x0 0x0 0x0 0x0 0x0 0x1234dead:beef::1234JT.putStrLn $ encode $ fromWord16s 0x0 0x0 0x0 0x0 0x0 0xFFFF 0x6437 0xA5B4::ffff:100.55.165.180AT.putStrLn $ encode $ fromWord16s 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0::Per  1https://tools.ietf.org/html/rfc5952#section-4.2.2 Section 4.2.2% of the same RFC, this does not use ::T to shorten a single 16-bit 0 field. Only runs of multiple 0 fields are considered.pipDecode UTF-8-encoded Bytes into an _ address.1decodeUtf8Bytes (Bytes.fromAsciiString "::cab:1")CJust (ipv6 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0cab 0x0001)qip Encodes the _Y address using zero-compression on the leftmost longest string of zeroes in the address._BB.run Nat.constant $ boundedBuilderUtf8 $ fromWord16s 0xDEAD 0xBEEF 0x0 0x0 0x0 0x0 0x0 0x1234Z[0x64, 0x65, 0x61, 0x64, 0x3a, 0x62, 0x65, 0x65, 0x66, 0x3a, 0x3a, 0x31, 0x32, 0x33, 0x34]rip Encodes the _ address as W using zero-compression on the leftmost longest string of zeroes in the address. Per  -https://tools.ietf.org/html/rfc5952#section-5RFC 5952 Section 5F, this uses mixed notation when encoding an IPv4-mapped IPv6 address.EencodeShort $ fromWord16s 0xDEAD 0xBEEF 0x0 0x0 0x0 0x0ABC 0x0 0x1234"dead:beef::abc:0:1234"sip Decode an _ address. This accepts both standard IPv6 notation (with zero compression) and mixed notation for IPv4-mapped IPv6 addresses. For a decoding function that additionally accepts dot-decimal-encoded IPv4 addresses, see  Net.IP.decode.tipParse UTF-8-encoded Bytes as an _^ address. This accepts both uppercase and lowercase characters in the hexadecimal components.<let str = "dead:beef:3240:a426:ba68:1cd0:4263:109b -> alive"BParser.parseBytes (parserUtf8Bytes ()) (Bytes.fromAsciiString str)oSuccess (Slice {offset = 39, length = 9, value = ipv6 0xdead 0xbeef 0x3240 0xa426 0xba68 0x1cd0 0x4263 0x109b})EThis does not currently support parsing embedded IPv4 address (e.g. ff00:8000:abc::224.1.2.3).uip Parse an _ using .KAtto.parseOnly parser (Text.pack "dead:beef:3240:a426:ba68:1cd0:4263:109b")DRight (ipv6 0xdead 0xbeef 0x3240 0xa426 0xba68 0x1cd0 0x4263 0x109b)vip Normalize an [*. The first result of this is that the _ inside the [J is changed so that the insignificant bits are zeroed out. For example:Daddr1 = ipv6 0x0192 0x0168 0x0001 0x0019 0x0000 0x0000 0x0000 0x0000Daddr2 = ipv6 0x0192 0x0168 0x0001 0x0163 0x0000 0x0000 0x0000 0x0000+printRange $ normalize $ IPv6Range addr1 24 192:100::/24+printRange $ normalize $ IPv6Range addr2 28 192:160::/28cThe second effect of this is that the mask length is lowered to be 128 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 128).,Note that 'normalize is idempotent, that is:(normalize r == (normalize . normalize) rwip Encode an [ as .Caddr = ipv6 0xDEAD 0xBEEF 0x3240 0xA426 0xBA68 0x1CD0 0x4263 0x109B,T.putStrLn $ encodeRange $ IPv6Range addr 28*dead:beef:3240:a426:ba68:1cd0:4263:109b/28xip Decode an [ from .Caddr = ipv6 0xDEAD 0xBEEF 0x3240 0xA426 0xBA68 0x1CD0 0x4263 0x109BWfmap encodeRange $ decodeRange (Text.pack "dead:beef:3240:a426:ba68:1cd0:4263:109b/28")Just "dead:bee0::/28"yip Parse an [ using a .zipChecks to see if an _ address belongs in the [.Elet ip = ipv6 0x2001 0x0db8 0x0db8 0x1094 0x2051 0x0000 0x0000 0x0001`let iprange mask = IPv6Range (ipv6 0x2001 0x0db8 0x0000 0x0000 0x0000 0x0000 0x0000 0x0001) maskcontains (iprange 8) ipTruecontains (iprange 48) ipFalse/Typically, 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:Slet r = IPv6Range (ipv6 0x2001 0x0db8 0x0000 0x0000 0x0000 0x0000 0x0000 0x0001) 64hfmap (contains r) (take 5 $ iterate succ $ ipv6 0x2001 0x0db8 0x0000 0x0000 0xffff 0xffff 0xffff 0xfffe)[True,True,False,False,False]The implementation of z 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 z 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:rT.putStrLn $ encode $ lowerInclusive $ IPv6Range (ipv6 0x2001 0x0db8 0x0000 0x0000 0x0000 0x0000 0x0000 0x0001) 25 2001:d80::*Note that the lower bound of a normalized [( is simply the ip address of the range:/lowerInclusive r == ipv6RangeBase (normalize r)}ip The inclusive upper bound of an [.Glet addr = ipv6 0xDEAD 0xBEEF 0x3240 0xA426 0xBA68 0x1CD0 0x4263 0x109B8T.putStrLn $ encode $ upperInclusive $ IPv6Range addr 25'dead:beff:ffff:ffff:ffff:ffff:ffff:ffff~ip Print an [ using the textual encoding.ipSmart constructor for [I. Ensures the mask is appropriately sized and sets masked bits in the _ to zero.Glet addr = ipv6 0xDEAD 0xBEEF 0x3240 0xA426 0xBA68 0x1CD0 0x4263 0x109BprintRange $ range addr 25dead:be80::/25ipCGiven an inclusive lower and upper ip address, create the smallest [b that contains the two. This is helpful in situations where input is given as a range, like  .<This makes the range broader if it cannot be represented in  <https://en.wikipedia.org/wiki/Classless_Inter-Domain_RoutingCIDR notation.HaddrLower = ipv6 0xDEAD 0xBE80 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000HaddrUpper = ipv6 0xDEAD 0xBEFF 0xFFFF 0xFFFF 0xFFFF 0xFFFF 0xFFFF 0xFFFF+printRange $ fromBounds addrLower addrUpperdead:be80::/25&[\]^_`abcdefghijklmnopqrstuvwxyz{|}~&edfihjgknlmorscutpqbvz{|}wxy~_`a[\]^None.7Q5ip A 32-bit  address or a 128-bit _8 address. Internally, this is just represented as an _' address. The functions provided in Net.IP help simulate constructing and pattern matching on values of this type. All functions and typeclass methods that convert & values to text will display it as an  address if possible.ipRun a function over an " depending on its status as an  or _.1case_ IPv4.encode IPv6.encode (ipv4 192 168 2 47)"192.168.2.47"Caddr = ipv6 0x2001 0x0db8 0x0000 0x0000 0x0000 0x0000 0x0000 0x0001"case_ IPv4.encode IPv6.encode addr "2001:db8::1"ip Construct an 4 address from the four octets of an IPv4 address.ip Construct an < address from the eight 16-bit chunks of an IPv6 address.ipTurn an  into an .ipTurn an _ into an .ip Encode an  as .encode (ipv4 10 0 0 25) "10.0.0.25":encode (ipv6 0x3124 0x0 0x0 0xDEAD 0xCAFE 0xFF 0xFE00 0x1)"3124::dead:cafe:ff:fe00:1"ip Encode an  as .encodeShort (ipv4 10 0 1 26) "10.0.1.26"BencodeShort (ipv6 0x3124 0x0 0x0 0xDEAD 0xCAFE 0xFF 0xFE01 0x0000)"3124::dead:cafe:ff:fe01:0"ip Encode an  as a bounded bytearray builder.<BB.run Nat.constant (boundedBuilderUtf8 (ipv4 192 168 2 14))H[0x31, 0x39, 0x32, 0x2e, 0x31, 0x36, 0x38, 0x2e, 0x32, 0x2e, 0x31, 0x34]ip Decode an  from .decode "10.0.0.25"Just (ipv4 10 0 0 25) fmap isIPv4 (decode "10.0.0.25") Just True"decode "3124::dead:cafe:ff:fe00:1"CJust (ipv6 0x3124 0x0000 0x0000 0xdead 0xcafe 0x00ff 0xfe00 0x0001)0fmap isIPv6 (decode "3124::dead:cafe:ff:fe00:1") Just Trueip Decode an  from .decodeShort "10.0.0.25"Just (ipv4 10 0 0 25)decodeShort "::dead:cafe"CJust (ipv6 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0xdead 0xcafe)ipParse UTF-8-encoded Bytes as an  address.ipIs the  an IPv4 address?isIPv4 (ipv4 10 0 0 25)True:isIPv4 (ipv6 0x3124 0x0 0x0 0xDEAD 0xCAFE 0xFF 0xFE00 0x1)FalseipIs the  an IPv6 address?isIPv6 (ipv4 10 0 0 25)False:isIPv6 (ipv6 0x3124 0x0 0x0 0xDEAD 0xCAFE 0xFF 0xFE00 0x1)Trueip Print an J using the textual encoding. This exists mostly for debugging purposes.print (ipv4 10 0 0 25) 10.0.0.259print (ipv6 0x3124 0x0 0x0 0xDEAD 0xCAFE 0xFF 0xFE00 0x1)3124::dead:cafe:ff:fe00:1None/7@AFHMVX ip3The format expected by the mac address parser. The " taken by some of these constructors is the ascii value of the character to be used as the separator. This is typically a colon, a hyphen, or a space character. All decoding functions are case insensitive.ipTwo-character groups, FA:2B:40:09:8C:11ipThree-character groups, 24B-F0A-025-829ipFour-character groups, A220.0745.CAC7ipNo separator,  24AF4B5B0780ipA ; allows users to control the encoding/decoding of their  addresses.ipA 48-bit MAC address. Do not use the data constructor for this type. It is not considered part of the stable API, and it allows you to construct invalid MAC addresses.ip Construct a  address from a #%. Only the lower 48 bits are used.ip Create a  address from six octets.ip Convert a A address to the six octets that make it up. This function and  are inverses:?m == (let (a,b,c,d,e,f) = toOctets m in fromOctets a b c d e f)ip Decode a  address from a 1. Each byte is interpreted as an octet of the  address. Consequently, 4s of length 6 successfully decode, and all other s fail to decode.4decodeBytes (B.pack [0x6B,0x47,0x18,0x90,0x55,0xC3])Just (mac 0x6b47189055c3) decodeBytes (B.replicate 6 0x3A)Just (mac 0x3a3a3a3a3a3a) decodeBytes (B.replicate 7 0x3A)Nothingip Encode a  address using the default  $.(T.putStrLn (encode (Mac 0xA47F247AB423))a4:7f:24:7a:b4:23ip Encode a  address using the given .m = Mac 0xA47F247AB423"T.putStrLn $ encodeWith defCodec ma4:7f:24:7a:b4:23BT.putStrLn $ encodeWith (MacCodec (MacGroupingTriples '-') True) mA47-F24-7AB-423ip Decode a  address using the default  $.&decode (Text.pack "a4:7f:24:7a:b4:23")Just (mac 0xa47f247ab423)$decode (Text.pack "a47-f24-7ab-423")Nothingip Decode a  address from  using the given .3decodeWith defCodec (Text.pack "a4:7f:24:7a:b4:23")Just (mac 0xa47f247ab423)MdecodeWith (MacCodec MacGroupingNoSeparator False) (Text.pack "a47f247ab423")Just (mac 0xa47f247ab423)ip Encode a  address as a .ipParse a  address using a .3AT.parseOnly parser (Text.pack "a4:7f:24:7a:b4:23")Right (mac 0xa47f247ab423)1AT.parseOnly parser (Text.pack "a47-f24-7ab-423")#Left "':': Failed reading: satisfy"ip Parser a  address using the given .p1 = parserWith defCodec/AT.parseOnly p1 (Text.pack "a4:7f:24:7a:b4:23")Right (mac 0xa47f247ab423)7p2 = parserWith (MacCodec MacGroupingNoSeparator False)*AT.parseOnly p2 (Text.pack "a47f247ab423")Right (mac 0xa47f247ab423)$ip The default C: all characters are lowercase hex, separated by colons into pairs.5T.putStrLn $ encodeWith defCodec (Mac 0xa47f247ab423)a4:7f:24:7a:b4:23ip Encode a  address using the default  $.-BC.putStrLn (encodeUtf8 (mac 0x64255A0F2C47))64:25:5a:0f:2c:47ip`Lenient decoding of MAC address that accepts lowercase, uppercase, and any kind of separator.decodeUtf8 "A2:DE:AD:BE:EF:67"Just (mac 0xa2deadbeef67)decodeUtf8 "13-a2-fe-a4-17-96"Just (mac 0x13a2fea41796)decodeUtf8 "0A42.47BA.67C2"Just (mac 0x0a4247ba67c2)ip Decode a  as a  address using the given .5decodeWithUtf8 defCodec (BC.pack "64:25:5a:0f:2c:47")Just (mac 0x64255a0f2c47)OdecodeWithUtf8 (MacCodec MacGroupingNoSeparator False) (BC.pack "64255a0f2c47")Just (mac 0x64255a0f2c47)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.%ipYParse a single hexidecimal character. This will skip at most one character to do this.&ipKind of a confusing type signature. The Word8 that stands alone represented an ascii-encoded value. The others actually describes the numbers that would be decoded from this value.ip Encode a  address as a  using the given .m = Mac 0xA47F247AB423'BC.putStrLn $ encodeWithUtf8 defCodec ma4:7f:24:7a:b4:23GBC.putStrLn $ encodeWithUtf8 (MacCodec (MacGroupingTriples '-') True) mA47-F24-7AB-423ipPrint a $ address using the textual encoding.ipUThis 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 #M instead and use the mac address data constructor to coerce between the two. None1[\]^_`a_`a[\]^'     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcddefggh0# ijklmno%*$& <=>@3456A12pqrstuvwxyz{|}~ i$*#&0  !"(+0  ip-1.6.0-CIeh7MAqUxyKmXbRG36sdrNet.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# builderUtf8byteArrayBuilderUtf8boundedBuilderUtf8 parserUtf8 encodeString decodeStringboxunboxprintrange fromBoundscontainsmemberlowerInclusiveupperInclusivetoList toGenerator private24 private20 private16 normalize encodeRange decodeRange builderRange parserRange printRange$fFiniteBitsIPv4 $fBitsIPv4$fFromJSONKeyIPv4$fToJSONKeyIPv4$fFromJSONIPv4 $fToJSONIPv4$fVectorVectorIPv4$fMVectorMVectorIPv4 $fUnboxIPv4 $fReadIPv4 $fShowIPv4 $fNFDataIPv4$fFiniteBitsIPv4Range$fBitsIPv4Range$fVectorVectorIPv4Range$fMVectorMVectorIPv4Range$fUnboxIPv4Range$fFromJSONIPv4Range$fToJSONIPv4Range$fHashableIPv4Range$fNFDataIPv4Range$fEqIPv4 $fOrdIPv4 $fEnumIPv4 $fBoundedIPv4$fHashableIPv4 $fGenericIPv4 $fPrimIPv4$fStorableIPv4 $fEqIPv4Range$fOrdIPv4Range$fShowIPv4Range$fReadIPv4Range$fGenericIPv4Range IPv6Range ipv6RangeBaseipv6RangeLengthIPv6getIPv6ipv6 fromWord16s toWord16sfromTupleWord16s fromWord32sfromTupleWord32s toWord32s$fFromJSONIPv6 $fToJSONIPv6 $fReadIPv6 $fShowIPv6$fNFDataIPv6Range $fBoundedIPv6 $fEnumIPv6$fEqIPv6$fIntegralIPv6 $fNumIPv6 $fOrdIPv6 $fRealIPv6$fStorableIPv6 $fBitsIPv6$fFiniteBitsIPv6 $fNFDataIPv6 $fPrimIPv6 $fEqIPv6Range$fOrdIPv6Range$fShowIPv6Range$fReadIPv6Range$fGenericIPv6RangeIPgetIPcase_fromIPv4fromIPv6isIPv4isIPv6 $fFromJSONIP $fToJSONIP$fReadIP$fShowIP $fNFDataIP$fEqIP$fOrdIP $fGenericIP MacGroupingMacGroupingPairsMacGroupingTriplesMacGroupingQuadruplesMacGroupingNoSeparatorMacCodecmacCodecGroupingmacCodecUpperCaseMacmac decodeBytes encodeWith decodeWith parserWithdecodeWithUtf8parserWithUtf8encodeWithUtf8 $fFromJSONMac$fFromJSONKeyMac$fToJSONKeyMac $fToJSONMac $fHashableMac $fEnumMac $fBoundedMac $fReadMac $fShowMac $fPrimMac $fNFDataMac$fEqMac$fOrdMac $fGenericMac$fEqMacGrouping$fOrdMacGrouping$fShowMacGrouping$fReadMacGrouping$fGenericMacGrouping $fEqMacCodec $fOrdMacCodec$fShowMacCodec$fReadMacCodec$fGenericMacCodecportableTextArrayportableTextLengthportableUntext writeString charUtf16SizehexValuesWord12UpperhexValuesWord12LowerhexValuesWord8UpperhexValuesWord8LowertwoDecimalDigitsthreeDecimalDigitscharBmp_vectorBuilderrun contramap staticCharBmpword8Word12 narrow12Word#ghc-primGHC.Primand#clz12#ctz12# popCnt12#W12#fromTextcontramapBuilderword8HexFixedUpperword8HexFixedLowerword12HexFixedUpperword12HexFixedLowerc2wfromByteStringchar8baseGHC.WordWord32GHC.ShowShowGHC.ReadRead text-1.2.3.1Data.Text.InternalTextData.Text.Internal.BuilderData.Text.ReadReader*attoparsec-0.13.2.3-1B7gC0zLqr66G1FATj1feeData.Attoparsec.Text.InternalParserbytestring-0.10.8.2Data.ByteString.Internal ByteString'text-short-0.1.3-6s9Vn5x19Vb5f1556qmx0oData.Text.Short.Internal ShortText Data.ByteString.Builder.Internal#Data.Attoparsec.ByteString.InternalGHC.BaseString fromOctets'dotDecimalParsertoTextPreAllocatedWord8Word64defCodecparseOneHexLenientUtf8tryParseWord8Hex