Safe Haskell | None |
---|---|
Language | Haskell2010 |
- 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
- toTextPreAllocated :: Word32 -> Text
- putAndCount :: Int -> Word8 -> MArray s -> ST s Int
- putMac :: ByteString -> Int -> Int -> MArray s -> ST s ()
- macToTextPreAllocated :: Word8 -> Bool -> Word16 -> Word32 -> 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
- dotDecimalParser :: Parser Word32
- fromOctets' :: Word32 -> Word32 -> Word32 -> Word32 -> Word32
- 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 -> (Word16 -> Word16 -> Word32 -> Word32 -> Word32 -> Word32 -> a) -> Parser a
- macToText :: Word16 -> Word32 -> Text
- macToTextBuilder :: Word16 -> Word32 -> Builder
- macFromText :: Maybe Char -> (Word16 -> Word16 -> Word32 -> Word32 -> Word32 -> Word32 -> a) -> Text -> Maybe a
- macFromText' :: Maybe Char -> (Word16 -> Word16 -> Word32 -> Word32 -> Word32 -> Word32 -> a) -> Text -> Either String a
- twoDigits :: ByteString
- threeDigits :: ByteString
- twoHexDigits :: ByteString
- twoHexDigitsLower :: ByteString
Documentation
eitherToAesonParser :: Either String a -> Parser a Source
attoparsecParseJSON :: Parser a -> Value -> Parser a Source
rightToMaybe :: Either a b -> Maybe b Source
toDotDecimalText :: Word32 -> Text Source
rangeToDotDecimalText :: Word32 -> Word8 -> Text Source
rangeToDotDecimalBuilder :: Word32 -> Word8 -> Builder Source
toTextPreAllocated :: Word32 -> Text Source
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.
fromDotDecimalText :: Text -> Maybe Word32 Source
dotDecimalRangeParser :: (Word32 -> Word8 -> a) -> Parser a Source
dotDecimalParser :: Parser Word32 Source
This does not do an endOfInput check because it is reused in the range parser implementation.
fromOctets' :: Word32 -> Word32 -> Word32 -> Word32 -> Word32 Source
This is sort of a misnomer. It takes Word32 to make dotDecimalParser probably perform better. This is mostly for internal use.
countAddrs :: Word8 -> Word64 Source
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.
wordSuccessors :: Word64 -> Word32 -> [Word32] Source
macTextParser :: Maybe Char -> (Word16 -> Word16 -> Word32 -> Word32 -> Word32 -> Word32 -> a) -> Parser a Source
macToTextBuilder :: Word16 -> Word32 -> Builder Source
macFromText :: Maybe Char -> (Word16 -> Word16 -> Word32 -> Word32 -> Word32 -> Word32 -> a) -> Text -> Maybe a Source