Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class TypedAttributes a
- takeTyped' :: (MonadPlus m, TypedAttributes a, Eq v) => Attributes v -> TypedNumber v a -> m (Attribute v a)
- takeTyped :: (MonadPlus m, TypedAttributes a, Eq v) => Attributes v -> TypedNumber v a -> m a
- data Attributes v
- extractAttributes :: Monad m => AttributeGetWT v m a -> m (Attributes v)
- tellT :: (TypedNumberSets v, Ord v) => Attribute' v -> AttributeGetWT v (Either String) ()
- type AttributeGetWT v m = AttributeGetWT' v (WriterT (DList (Attribute' v)) m)
- attributeGetWT :: m (((((a, AtList v AtIpV4), AtList v AtText), AtList v AtInteger), AtList v AtString), DList (Attribute' v)) -> AttributeGetWT v m a
- runAttributeGetWT :: AttributeGetWT v m a -> m (((((a, AtList v AtIpV4), AtList v AtText), AtList v AtInteger), AtList v AtString), DList (Attribute' v))
- decodeAsText :: (TypedNumberSets v, Ord v) => Attribute' v -> MaybeT (Either String) (Attribute v AtText)
- decodeAsString :: (TypedNumberSets v, Ord v) => Attribute' v -> MaybeT (Either String) (Attribute v AtString)
- decodeAsInteger :: (TypedNumberSets v, Ord v) => Attribute' v -> MaybeT (Either String) (Attribute v AtInteger)
- decodeAsIpV4 :: (TypedNumberSets v, Ord v) => Attribute' v -> MaybeT (Either String) (Attribute v AtIpV4)
DSL to get typed attributes from packet
class TypedAttributes a Source #
Type class to generalize typed attribute param
typedAttributes
Instances
TypedAttributes AtIpV4 Source # | |
Defined in Data.Radius.StreamGet.Monadic typedAttributes :: Attributes v -> [Attribute v AtIpV4] | |
TypedAttributes AtInteger Source # | |
Defined in Data.Radius.StreamGet.Monadic typedAttributes :: Attributes v -> [Attribute v AtInteger] | |
TypedAttributes AtString Source # | |
Defined in Data.Radius.StreamGet.Monadic typedAttributes :: Attributes v -> [Attribute v AtString] | |
TypedAttributes AtText Source # | |
Defined in Data.Radius.StreamGet.Monadic typedAttributes :: Attributes v -> [Attribute v AtText] |
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 #
decodeAsText :: (TypedNumberSets v, Ord v) => Attribute' v -> MaybeT (Either String) (Attribute v AtText) Source #
decodeAsString :: (TypedNumberSets v, Ord v) => Attribute' v -> MaybeT (Either String) (Attribute v AtString) Source #
decodeAsInteger :: (TypedNumberSets v, Ord v) => Attribute' v -> MaybeT (Either String) (Attribute v AtInteger) Source #
decodeAsIpV4 :: (TypedNumberSets v, Ord v) => Attribute' v -> MaybeT (Either String) (Attribute v AtIpV4) Source #