Portability | unknown |
---|---|
Stability | experimental |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Safe Haskell | None |
A parser combinator for ASN1 Stream.
- data ParseASN1 a
- runParseASN1State :: ParseASN1 a -> [ASN1] -> Either String (a, [ASN1])
- runParseASN1 :: ParseASN1 a -> [ASN1] -> Either String a
- onNextContainer :: ASN1ConstructionType -> ParseASN1 a -> ParseASN1 a
- onNextContainerMaybe :: ASN1ConstructionType -> ParseASN1 a -> ParseASN1 (Maybe a)
- getNextContainer :: ASN1ConstructionType -> ParseASN1 [ASN1]
- getNextContainerMaybe :: ASN1ConstructionType -> ParseASN1 (Maybe [ASN1])
- getNext :: ParseASN1 ASN1
- getNextMaybe :: (ASN1 -> Maybe a) -> ParseASN1 (Maybe a)
- hasNext :: ParseASN1 Bool
- getObject :: ASN1Object a => ParseASN1 a
- getMany :: ParseASN1 a -> ParseASN1 [a]
Documentation
Parse ASN1 Monad
run
runParseASN1State :: ParseASN1 a -> [ASN1] -> Either String (a, [ASN1])Source
run the parse monad over a stream and returns the result and the remaining ASN1 Stream.
runParseASN1 :: ParseASN1 a -> [ASN1] -> Either String aSource
run the parse monad over a stream and returns the result.
If there's still some asn1 object in the state after calling f, an error will be raised.
combinators
onNextContainer :: ASN1ConstructionType -> ParseASN1 a -> ParseASN1 aSource
run a function of the next elements of a container of specified type
onNextContainerMaybe :: ASN1ConstructionType -> ParseASN1 a -> ParseASN1 (Maybe a)Source
just like onNextContainer, except it doesn't throw an error if the container doesn't exists.
getNextContainer :: ASN1ConstructionType -> ParseASN1 [ASN1]Source
get next container of specified type and return all its elements
getNextContainerMaybe :: ASN1ConstructionType -> ParseASN1 (Maybe [ASN1])Source
just like getNextContainer, except it doesn't throw an error if the container doesn't exists.
getNextMaybe :: (ASN1 -> Maybe a) -> ParseASN1 (Maybe a)Source
get next element from the stream maybe
getObject :: ASN1Object a => ParseASN1 aSource
get next object