protocol-radius-0.0.1.1: parser and printer for radius protocol packet

Safe HaskellNone
LanguageHaskell2010

Data.Radius.StreamGet.Monadic

Contents

Synopsis

DSL to get typed attributes from packet

class TypedAttributes a Source #

Type class to generalize typed attribute param

Minimal complete definition

typedAttributes

takeTyped' :: (MonadPlus m, TypedAttributes a, Eq v) => Attributes v -> TypedNumber v a -> m (Attribute v a) Source #

Get typed attribute from attribute set.

takeTyped :: (MonadPlus m, TypedAttributes a, Eq v) => Attributes v -> TypedNumber v a -> m a Source #

Get typed attribute value from attribute set.

data Attributes v Source #

Type to express typed attribute set

extractAttributes :: Monad m => AttributeGetWT v m a -> m (Attributes v) Source #

Extract typed attributes. For example, use like this: extractAttributes . mapM tellT

tellT :: (TypedNumberSets v, Ord v) => Attribute' v -> AttributeGetWT v (Either String) () Source #

Decode untyped attribute into monadic context. When typed-value decode error found, either typed context makes sense.

low-level definitions

type AttributeGetWT v m = AttributeGetWT' v (WriterT (DList (Attribute' v)) m) Source #

attributeGetWT :: m (((((a, AtList v AtIpV4), AtList v AtText), AtList v AtInteger), AtList v AtString), DList (Attribute' v)) -> AttributeGetWT v m a Source #

runAttributeGetWT :: AttributeGetWT v m a -> m (((((a, AtList v AtIpV4), AtList v AtText), AtList v AtInteger), AtList v AtString), DList (Attribute' v)) Source #