-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Library for IP and MAC addresses -- -- The ip package provides types and functions for dealing with -- IPv4 addresses, CIDR blocks, and MAC addresses. We provide instances -- for typeclasses found in commonly used packages like aeson, -- vector, and hashable. We also provide Parsers for -- working with attoparsec. -- -- Notably, this package does not overload functions by introducing any -- typeclasses of its own. Neither does it prefix functions with the name -- of the type that they work on. Instead, functions of the same name are -- exported by several different modules, and it is expected that end -- users disambiguate by importing these modules qualified. For example, -- Data.IPv4.ByteString.Char8 and Data.IPv4.Text have -- nearly identical export lists. -- -- The only module intended to be imported unqualified is -- Net.Types. The types in this package should not conflict with -- the types in any other commonly used packages. -- -- The following packages are intended to be used with this package: -- -- @package ip @version 0.9.2 module Data.Word.Synthetic.Word48 newtype Word48 W48 :: Word64 -> Word48 narrow48Word :: Word64 -> Word64 popCnt48 :: Word64 -> Int word48UpperWord16 :: Word48 -> Word16 word48LowerWord32 :: Word48 -> Word32 word48FromUpperLower :: Word16 -> Word32 -> Word48 instance Data.Hashable.Class.Hashable Data.Word.Synthetic.Word48.Word48 instance GHC.Classes.Ord Data.Word.Synthetic.Word48.Word48 instance GHC.Classes.Eq Data.Word.Synthetic.Word48.Word48 instance GHC.Show.Show Data.Word.Synthetic.Word48.Word48 instance GHC.Num.Num Data.Word.Synthetic.Word48.Word48 instance GHC.Real.Real Data.Word.Synthetic.Word48.Word48 instance GHC.Enum.Enum Data.Word.Synthetic.Word48.Word48 instance GHC.Real.Integral Data.Word.Synthetic.Word48.Word48 instance GHC.Enum.Bounded Data.Word.Synthetic.Word48.Word48 instance GHC.Arr.Ix Data.Word.Synthetic.Word48.Word48 instance GHC.Read.Read Data.Word.Synthetic.Word48.Word48 instance Data.Bits.Bits Data.Word.Synthetic.Word48.Word48 instance Data.Bits.FiniteBits Data.Word.Synthetic.Word48.Word48 instance Data.Vector.Unboxed.Base.Unbox Data.Word.Synthetic.Word48.Word48 instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Data.Word.Synthetic.Word48.Word48 instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Data.Word.Synthetic.Word48.Word48 module Data.Word.Synthetic.Word12 -- | 12-bit unsigned integer type data Word12 W12# :: Word# -> Word12 -- | narrowings represented as primop and# in GHC. narrow12Word# :: Word# -> Word# -- | count leading zeros clz12# :: Word# -> Word# -- | count trailing zeros ctz12# :: Word# -> Word# -- | the number of set bits popCnt12# :: Word# -> Word# instance GHC.Classes.Ord Data.Word.Synthetic.Word12.Word12 instance GHC.Classes.Eq Data.Word.Synthetic.Word12.Word12 instance Data.Data.Data Data.Word.Synthetic.Word12.Word12 instance GHC.Show.Show Data.Word.Synthetic.Word12.Word12 instance GHC.Num.Num Data.Word.Synthetic.Word12.Word12 instance GHC.Real.Real Data.Word.Synthetic.Word12.Word12 instance GHC.Enum.Enum Data.Word.Synthetic.Word12.Word12 instance GHC.Real.Integral Data.Word.Synthetic.Word12.Word12 instance GHC.Enum.Bounded Data.Word.Synthetic.Word12.Word12 instance GHC.Arr.Ix Data.Word.Synthetic.Word12.Word12 instance GHC.Read.Read Data.Word.Synthetic.Word12.Word12 instance Data.Bits.Bits Data.Word.Synthetic.Word12.Word12 instance Data.Bits.FiniteBits Data.Word.Synthetic.Word12.Word12 module Data.Word.Synthetic data Word48 -- | 12-bit unsigned integer type data Word12 module Net.Internal -- | Taken from Data.ByteString.Internal. The same warnings apply -- here. c2w :: Char -> Word8 eitherToAesonParser :: Either String a -> Parser a attoparsecParseJSON :: Parser a -> Value -> Parser a stripDecimal :: Text -> Either String Text decodeIPv4TextReader :: Reader Word32 decodeIPv4TextEither :: Text -> Either String Word32 ipOctetSizeErrorMsg :: String rightToMaybe :: Either a b -> Maybe b toDotDecimalText :: Word32 -> Text toDotDecimalBuilder :: Word32 -> Builder rangeToDotDecimalText :: Word32 -> Word8 -> Text rangeToDotDecimalBuilder :: Word32 -> Word8 -> Builder -- | I 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. toTextPreAllocated :: Word32 -> Text toTextPreallocatedPartTwo :: Word -> Word -> Word -> Word -> Text putAndCount :: Int -> Word -> MArray s -> ST s Int putMac :: ByteString -> Int -> Word64 -> MArray s -> ST s () word48AsOctets :: Word48 -> (Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> a) -> a macToTextDefault :: Word48 -> Text macToTextPreAllocated :: Word8 -> Bool -> Word48 -> Text macToTextPartTwo :: Word8 -> Bool -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Text zero :: Word16 i2w :: Integral a => a -> Word16 fromDotDecimalText' :: Text -> Either String Word32 fromDotDecimalText :: Text -> Maybe Word32 rangeFromDotDecimalText' :: (Word32 -> Word8 -> a) -> Text -> Either String a rangeFromDotDecimalText :: (Word32 -> Word8 -> a) -> Text -> Maybe a dotDecimalRangeParser :: (Word32 -> Word8 -> a) -> Parser a -- | This does not do an endOfInput check because it is reused in the range -- parser implementation. dotDecimalParser :: Parser Word32 -- | This is sort of a misnomer. It takes Word32 to make dotDecimalParser -- probably perform better. This is mostly for internal use. -- -- At some point, it would be worth revisiting the decision to use -- Word32 here. Using Word would probably give better -- performance on a 64-bit processor. fromOctets' :: Word32 -> Word32 -> Word32 -> Word32 -> Word32 fromOctetsV6 :: Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> (Word64, Word64) fromWord16sV6 :: Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> (Word64, Word64) fromWord16Word64 :: Word64 -> Word64 -> Word64 -> Word64 -> Word64 -- | All the words given as argument should be range restricted from 0 to -- 255. This is not checked. fromOctetsWord64 :: Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -- | Given the size of the mask, return the total number of ips in the -- subnet. This only works for IPv4 addresses because an IPv6 subnet can -- have up to 2^128 addresses. countAddrs :: Word8 -> Word64 wordSuccessors :: Word64 -> Word32 -> [Word32] wordSuccessorsM :: MonadPlus m => (Word32 -> a) -> Word64 -> Word32 -> m a mask :: Word8 -> Word32 p24 :: Word32 p20 :: Word32 p16 :: Word32 mask8 :: Word32 mask4 :: Word32 mask12 :: Word32 mask20 :: Word32 mask28 :: Word32 mask16 :: Word32 mask10 :: Word32 mask24 :: Word32 mask32 :: Word32 mask15 :: Word32 macTextParser :: Maybe Char -> (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> a) -> Parser a unsafeWord48FromOctets :: Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word48 macFromText :: Maybe Char -> (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> a) -> Text -> Maybe a macFromText' :: Maybe Char -> (Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> Word64 -> a) -> Text -> Either String a twoDigits :: ByteString threeDigitsWord8 :: ByteString twoHexDigits :: ByteString twoHexDigitsLower :: ByteString module Net.Types -- | A 32-bit Internet Protocol version 4 address. newtype IPv4 IPv4 :: Word32 -> IPv4 [getIPv4] :: IPv4 -> Word32 -- | A 128-bit Internet Protocol version 6 address. data IPv6 IPv6 :: {-# UNPACK #-} !Word64 -> {-# UNPACK #-} !Word64 -> IPv6 [ipv6A] :: IPv6 -> {-# UNPACK #-} !Word64 [ipv6B] :: IPv6 -> {-# UNPACK #-} !Word64 -- | A 32-bit IPv4 address or a 128-bit IPv6 address. -- Internally, this is just represented as an IPv6 address. The -- functions provided in Net.IP help simulate pattern matching -- on it. newtype IP IP :: IPv6 -> IP [getIP] :: IP -> IPv6 -- | The 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. data IPv4Range IPv4Range :: {-# UNPACK #-} !IPv4 -> {-# UNPACK #-} !Word8 -> IPv4Range [ipv4RangeBase] :: IPv4Range -> {-# UNPACK #-} !IPv4 [ipv4RangeLength] :: IPv4Range -> {-# UNPACK #-} !Word8 -- | A 48-bit MAC address. newtype Mac Mac :: Word48 -> Mac [getMac] :: Mac -> Word48 data MacCodec MacCodec :: !MacGrouping -> !Bool -> MacCodec [macCodecGrouping] :: MacCodec -> !MacGrouping [macCodecUpperCase] :: MacCodec -> !Bool -- | The format expected by the mac address parser. The Word8 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. data MacGrouping -- | Two-character groups, FA:2B:40:09:8C:11 MacGroupingPairs :: !Char -> MacGrouping -- | Three-character groups, 24B-F0A-025-829 MacGroupingTriples :: !Char -> MacGrouping -- | Four-character groups, A220.0745.CAC7 MacGroupingQuadruples :: !Char -> MacGrouping -- | No separator, 24AF4B5B0780 MacGroupingNoSeparator :: MacGrouping instance GHC.Generics.Generic Net.Types.MacCodec instance GHC.Read.Read Net.Types.MacCodec instance GHC.Show.Show Net.Types.MacCodec instance GHC.Classes.Ord Net.Types.MacCodec instance GHC.Classes.Eq Net.Types.MacCodec instance GHC.Generics.Generic Net.Types.MacGrouping instance GHC.Read.Read Net.Types.MacGrouping instance GHC.Show.Show Net.Types.MacGrouping instance GHC.Classes.Ord Net.Types.MacGrouping instance GHC.Classes.Eq Net.Types.MacGrouping instance GHC.Generics.Generic Net.Types.Mac instance GHC.Read.Read Net.Types.Mac instance GHC.Show.Show Net.Types.Mac instance GHC.Classes.Ord Net.Types.Mac instance GHC.Classes.Eq Net.Types.Mac instance GHC.Generics.Generic Net.Types.IPv4Range instance GHC.Read.Read Net.Types.IPv4Range instance GHC.Show.Show Net.Types.IPv4Range instance GHC.Classes.Ord Net.Types.IPv4Range instance GHC.Classes.Eq Net.Types.IPv4Range instance GHC.Read.Read Net.Types.IP instance GHC.Show.Show Net.Types.IP instance GHC.Classes.Ord Net.Types.IP instance GHC.Classes.Eq Net.Types.IP instance GHC.Read.Read Net.Types.IPv6 instance GHC.Show.Show Net.Types.IPv6 instance GHC.Classes.Ord Net.Types.IPv6 instance GHC.Classes.Eq Net.Types.IPv6 instance Data.Bits.FiniteBits Net.Types.IPv4 instance Data.Bits.Bits Net.Types.IPv4 instance Data.Primitive.Types.Prim Net.Types.IPv4 instance GHC.Generics.Generic Net.Types.IPv4 instance Data.Hashable.Class.Hashable Net.Types.IPv4 instance GHC.Enum.Bounded Net.Types.IPv4 instance GHC.Enum.Enum Net.Types.IPv4 instance GHC.Read.Read Net.Types.IPv4 instance GHC.Show.Show Net.Types.IPv4 instance GHC.Classes.Ord Net.Types.IPv4 instance GHC.Classes.Eq Net.Types.IPv4 instance Data.Hashable.Class.Hashable Net.Types.Mac instance Data.Aeson.Types.ToJSON.ToJSON Net.Types.Mac instance Data.Aeson.Types.ToJSON.ToJSONKey Net.Types.Mac instance Data.Aeson.Types.FromJSON.FromJSONKey Net.Types.Mac instance Data.Aeson.Types.ToJSON.ToJSONKey Net.Types.IPv4 instance Data.Aeson.Types.FromJSON.FromJSONKey Net.Types.IPv4 instance Data.Aeson.Types.FromJSON.FromJSON Net.Types.Mac instance Data.Hashable.Class.Hashable Net.Types.IPv4Range instance Data.Aeson.Types.ToJSON.ToJSON Net.Types.IPv4 instance Data.Aeson.Types.FromJSON.FromJSON Net.Types.IPv4 instance Data.Aeson.Types.ToJSON.ToJSON Net.Types.IPv4Range instance Data.Aeson.Types.FromJSON.FromJSON Net.Types.IPv4Range instance Data.Vector.Unboxed.Base.Unbox Net.Types.IPv4 instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Net.Types.IPv4 instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Net.Types.IPv4 instance Data.Vector.Unboxed.Base.Unbox Net.Types.IPv4Range instance Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector Net.Types.IPv4Range instance Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector Net.Types.IPv4Range module Net.IP case_ :: (IPv4 -> a) -> (IPv6 -> a) -> IP -> a -- | If the address is an IPv4 address, return the address. ipv4 :: IP -> Maybe IPv4 -- | If the address is an IPv6 address, and if it is not an -- IPv4-mapped IPv6 address, return the address. ipv6 :: IP -> Maybe IPv6 -- | An IPv4 data type -- -- This module provides the IPv4 data type and functions for working with -- it. There are also encoding and decoding functions provided in this -- module, but they should be imported from Net.IPv4.Text and -- Net.IPv4.ByteString.Char8 instead. They are defined here so -- that the FromJSON and ToJSON instances can use them. -- -- At some point, a highly efficient IPv4-to-ByteString function needs to -- be added to this module to take advantage of aeson's new -- toEncoding method. module Net.IPv4 -- | Create an IPv4 address from four octets. The first argument is -- the most significant octet. The last argument is the least -- significant. -- -- Since the Show and Read instances for IPv4 are -- not generally usefully, this function is the recommened way to create -- IPv4 addresses. For example: -- --
--   >>> fromOctets 192 168 1 1
--   IPv4 {getIPv4 = 3232235777}
--   
fromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> IPv4 -- | Convert an IPv4 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. toOctets :: IPv4 -> (Word8, Word8, Word8, Word8) -- | The IP address representing any host: 0.0.0.0 any :: IPv4 -- | The loopback IP address: 127.0.0.1 loopback :: IPv4 -- | The broadcast IP address: 255.255.255.255 broadcast :: IPv4 -- | Checks to see if the IPv4 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. private :: IPv4 -> Bool -- | Checks to see if the IPv4 address belongs to a reserved -- network. This includes the three private networks that private -- checks along with several other ranges that are not used on the public -- Internet. reserved :: IPv4 -> Bool -- | Checks to see if the IPv4 address is publicly routable. -- --
--   public x == not (reserved x)
--   
public :: IPv4 -> Bool module Net.IPv4.Range -- | Normalize an IPv4Range. The first result of this is that the -- IPv4 inside the IPv4Range is changed so that the -- insignificant bits are zeroed out. For example: -- --
--   >>> prRange $ normalize $ IPv4Range (fromOctets 192 168 1 19) 24
--   192.168.1.0/24
--   
--   >>> prRange $ normalize $ IPv4Range (fromOctets 192 168 1 163) 28
--   192.168.1.160/28
--   
-- -- The second effect of this is that the mask length is lowered to be 32 -- or smaller. Working with IPv4Ranges 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 normalize is idempotent, that is: -- --
--   normalize r == (normalize . normalize) r
--   
normalize :: IPv4Range -> IPv4Range -- | Checks to see if an IPv4 address belongs in the -- IPv4Range. -- --
--   >>> let ip = fromOctets 10 10 1 92
--   
--   >>> contains (IPv4Range (fromOctets 10 0 0 0) 8) ip
--   True
--   
--   >>> contains (IPv4Range (fromOctets 10 11 0 0) 16) ip
--   False
--   
-- -- 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) 31
--   
--   >>> mapM_ (print . contains r) (take 5 $ iterate succ $ fromOctets 10 10 10 5)
--   False
--   True
--   True
--   False
--   False
--   
-- -- The implementation of contains 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. contains :: IPv4Range -> IPv4 -> Bool -- | This is provided to mirror the interface provided by -- Data.Set. It behaves just like contains but with -- flipped arguments. -- --
--   member ip r == contains r ip
--   
member :: IPv4 -> IPv4Range -> Bool -- | The inclusive lower bound of an IPv4Range. This is -- conventionally understood to be the broadcast address of a subnet. For -- example: -- --
--   >>> I.print $ lowerInclusive $ IPv4Range (fromOctets 10 10 1 160) 25
--   10.10.1.128
--   
-- -- Note that the lower bound of a normalized IPv4Range is simply -- the ip address of the range: -- --
--   lowerInclusive r == ipv4RangeBase (normalize r)
--   
lowerInclusive :: IPv4Range -> IPv4 upperInclusive :: IPv4Range -> IPv4 -- | Convert an IPv4Range into a list of the IPv4 addresses -- that are in it. >>> let r = IPv4Range (fromOctets 192 168 1 -- 8) 30 >>> mapM_ I.print (toList r) 192.168.1.8 192.168.1.9 -- 192.168.1.10 192.168.1.11 toList :: IPv4Range -> [IPv4] toGenerator :: MonadPlus m => IPv4Range -> m IPv4 -- | The RFC1918 24-bit block. Subnet mask: 10.0.0.0/8 private24 :: IPv4Range -- | The RFC1918 20-bit block. Subnet mask: 172.16.0.0/12 private20 :: IPv4Range -- | The RFC1918 16-bit block. Subnet mask: 192.168.0.0/16 private16 :: IPv4Range -- | This only exists for doctests. Do not use it. prRange :: IPv4Range -> IO () module Net.IPv4.Range.Text encode :: IPv4Range -> Text decode :: Text -> Maybe IPv4Range decodeEither :: Text -> Either String IPv4Range builder :: IPv4Range -> Builder parser :: Parser IPv4Range -- | This exists mostly for testing purposes. print :: IPv4Range -> IO () module Net.IPv4.Text encode :: IPv4 -> Text decode :: Text -> Maybe IPv4 decodeEither :: Text -> Either String IPv4 builder :: IPv4 -> Builder reader :: Reader IPv4 parser :: Parser IPv4 -- | This exists mostly for testing purposes. print :: IPv4 -> IO () module Net.IPv4.ByteString.Char8 -- | This should be rewritten to not create Text as an -- intermediate step. encode :: IPv4 -> ByteString -- | This should also be rewritten decode :: ByteString -> Maybe IPv4 builder :: IPv4 -> Builder parser :: Parser IPv4 -- | This module exists for the convenience of those who need a -- String representation of an IPv4 address. Using this -- module is discouraged unless the end user is working with a library -- that can only use String to deal with textual data (such as -- pandoc, hxr, or network). module Net.IPv4.String encode :: IPv4 -> String decode :: String -> Maybe IPv4 decodeEither :: String -> Either String IPv4 module Net.IPv6 fromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> IPv6 fromWord16s :: Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> Word16 -> IPv6 toWord16s :: IPv6 -> (Word16, Word16, Word16, Word16, Word16, Word16, Word16, Word16) module Net.IPv6.Text -- | Encodes the IP, using zero-compression on the leftmost-longest string -- of zeroes in the address. encode :: IPv6 -> Text parser :: Parser IPv6 instance GHC.Read.Read Net.IPv6.Text.S instance GHC.Show.Show Net.IPv6.Text.S module Net.Mac fromOctets :: Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Word8 -> Mac toOctets :: Mac -> (Word8, Word8, Word8, Word8, Word8, Word8) module Data.Text.Builder.Common.Internal -- | This 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. portableTextArray :: Text -> Array -- | This length is not the character length. It is the length of Word16s -- required by a UTF16 representation. portableTextLength :: Text -> Int portableUntext :: Text -> (Array, Int) writeString :: MArray s -> String -> ST s () charUtf16Size :: Char -> Int hexValuesWord12Upper :: Array hexValuesWord12Lower :: Array hexValuesWord8Upper :: Array hexValuesWord8Lower :: Array twoDecimalDigits :: Array threeDecimalDigits :: Array -- | For concatenating fixed-width strings that are only a few characters -- each, this can be ten times faster than the builder that ships with -- text. module Data.Text.Builder.Fixed data Builder a fromText :: Text -> Builder a run :: Builder a -> a -> Text contramapBuilder :: (b -> a) -> Builder a -> Builder b -- | Characters 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. charBmp :: Builder Char word8HexFixedLower :: Builder Word8 word8HexFixedUpper :: Builder Word8 word12HexFixedLower :: Builder Word12 word12HexFixedUpper :: Builder Word12 instance GHC.Base.Monoid (Data.Text.Builder.Fixed.Builder a) module Net.Mac.Text encode :: Mac -> Text encodeWith :: MacCodec -> Mac -> Text decode :: Text -> Maybe Mac decodeWith :: MacCodec -> Text -> Maybe Mac decodeEither :: Text -> Either String Mac decodeEitherWith :: MacCodec -> Text -> Either String Mac builder :: Mac -> Builder parser :: Parser Mac parserWith :: MacCodec -> Parser Mac -- | This is a builder optimized for concatenating short variable-length -- strings whose length has a known upper bound. In these cases, this can -- be up to ten times faster than the builder provided by the -- text library. However, data whose textual encoding has no -- known upper bound cannot be encoded by the builder provided here. For -- example, it is possible to provide decimal builders for types like -- Int8 and Word16, whose lengths are respectively -- bounded by 4 and 5. However, this is not possible for Integer, -- since its decimal representation could be arbitrarily long. module Data.Text.Builder.Variable data Builder a run :: Builder a -> a -> Text contramap :: (b -> a) -> Builder a -> Builder b -- | A character in the basic multilingual plane. charBmp :: Builder Char staticCharBmp :: Char -> Builder a word8 :: Builder Word8 instance GHC.Base.Monoid (Data.Text.Builder.Variable.Builder a) -- | For concatenating fixed-width strings that are only a few characters -- each, this can be six times faster than the builder that ships with -- bytestring. module Data.ByteString.Builder.Fixed data Builder a fromByteString :: ByteString -> Builder a run :: Builder a -> a -> ByteString contramapBuilder :: (b -> a) -> Builder a -> Builder b char8 :: Builder Char word8 :: Builder Word8 word8HexFixedLower :: Builder Word8 word8HexFixedUpper :: Builder Word8 word12HexFixedLower :: Builder Word12 word12HexFixedUpper :: Builder Word12 instance GHC.Base.Monoid (Data.ByteString.Builder.Fixed.Builder a) module Net.Mac.ByteString.Char8 encode :: Mac -> ByteString encodeWith :: MacCodec -> Mac -> ByteString decode :: ByteString -> Maybe Mac decodeWith :: MacCodec -> ByteString -> Maybe Mac decodeLenient :: ByteString -> Maybe Mac -- | Make a bytestring builder from a Mac address using a colon as -- the separator. builder :: Mac -> Builder -- | Parser for a Mac address using with a colon as the separator -- (i.e. FA:43:B2:C0:0F:99). parser :: Parser Mac -- | Parser for a Mac address using the provided settings. parserWith :: MacCodec -> Parser Mac parserLenient :: Parser Mac