Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- newtype Info = Info [InfoEntry]
- data InfoEntry where
- class (Typeable v, Monoid v, Show v) => IsInfo v where
- propagateInfo :: v -> PropagateInfo
- data PropagateInfo
- addInfo :: IsInfo v => Info -> v -> Info
- toInfo :: IsInfo v => v -> Info
- fromInfo :: IsInfo v => Info -> v
- mapInfo :: IsInfo v => (v -> v) -> Info -> Info
- data InfoVal v
- fromInfoVal :: InfoVal v -> Maybe v
- class Typeable (a :: k)
Documentation
Information about a Host, which can be provided by its properties.
Many different types of data can be contained in the same Info value
at the same time. See toInfo
and fromInfo
.
class (Typeable v, Monoid v, Show v) => IsInfo v where Source #
Values stored in Info must be members of this class.
This is used to avoid accidentially using other data types as info, especially type aliases which coud easily lead to bugs. We want a little bit of dynamic types here, but not too far..
propagateInfo :: v -> PropagateInfo Source #
Should this info be propagated out of a container to its Host?
Instances
data PropagateInfo Source #
PropagateInfo Bool | |
PropagatePrivData | Info about PrivData generally will be propigated even in cases where other Info is not, so it treated specially. |
addInfo :: IsInfo v => Info -> v -> Info Source #
Any value in the IsInfo
type class can be added to an Info.
toInfo :: IsInfo v => v -> Info Source #
Converts any value in the IsInfo
type class into an Info,
which is otherwise empty.
mapInfo :: IsInfo v => (v -> v) -> Info -> Info Source #
Maps a function over all values stored in the Info that are of the appropriate type.
Use this to put a value in Info that is not a monoid. The last value set will be used. This info does not propagate out of a container.
fromInfoVal :: InfoVal v -> Maybe v Source #