Safe Haskell | None |
---|---|
Language | Haskell2010 |
A Registry is a mapping from ordered values. For the Registry type itself, all target values have the same type. For the UntypedRegistry type, the values can have any Typeable type.
Synopsis
- data Ord from => Registry from to
- type UntypedRegistry from = Untyped Registry from
- data LockedRegistry from to
- type UntypedLockedRegistry from = Untyped LockedRegistry from
- data Untyped registry from
- data Unsafe registry from
- type UnsafeRegistry from = Unsafe Registry from
- class NewRegistry registry where
- newRegistry :: IO registry
- emptyRegistry :: registry -> IO ()
- class GetSetRegistry registry from to where
- class GetSetRegistryDyn registry from where
- setValueAsDyn :: registry -> from -> Dyn -> IO ()
- getValueAsDyn :: registry -> from -> IO Dyn
- class KeyOpsRegistry registry from where
- deleteFromRegistryBool :: registry -> from -> IO Bool
- deleteFromRegistry :: registry -> from -> IO ()
- listKeys :: registry -> IO [from]
- class ListRegistryContents registry from to where
- listRegistryContents :: registry from to -> IO [(from, to)]
- listRegistryContentsAndEmptyRegistry :: registry from to -> IO [(from, to)]
- listToNewRegistry :: [(from, to)] -> IO (registry from to)
- changeKey :: Ord from => Registry from to -> from -> from -> IO ()
- getRegistryValue :: Ord from => Registry from to -> from -> IO to
- getValueDefault :: GetSetRegistry registry from to => to -> registry -> from -> IO to
- lockedRegistryCheck :: IO a -> IO (Either String a)
- getValue' :: GetSetRegistry registry from to => String -> registry -> from -> IO to
- getValueSafe :: GetSetRegistry registry from to => String -> registry -> from -> IO to
- getRegistryValueSafe :: Ord from => String -> Registry from to -> from -> IO to
Documentation
data Ord from => Registry from to Source #
Instances
Ord from => ListRegistryContents Registry from to Source # | |
Defined in Util.Registry listRegistryContents :: Registry from to -> IO [(from, to)] Source # listRegistryContentsAndEmptyRegistry :: Registry from to -> IO [(from, to)] Source # listToNewRegistry :: [(from, to)] -> IO (Registry from to) Source # | |
Ord from => NewRegistry (Registry from to) Source # | |
Defined in Util.Registry newRegistry :: IO (Registry from to) Source # emptyRegistry :: Registry from to -> IO () Source # | |
(HasBinary (from, to) m, Ord from, MonadIO m) => HasBinary (Registry from to) m Source # | |
Defined in Util.Registry writeBin :: WriteBinary m -> Registry from to -> m () Source # readBin :: ReadBinary m -> m (Registry from to) Source # | |
Ord from => KeyOpsRegistry (Registry from to) from Source # | |
Ord from => GetSetRegistry (Registry from to) from to Source # | |
Defined in Util.Registry |
type UntypedRegistry from = Untyped Registry from Source #
data LockedRegistry from to Source #
Instances
Ord from => NewRegistry (LockedRegistry from to) Source # | |
Defined in Util.Registry newRegistry :: IO (LockedRegistry from to) Source # emptyRegistry :: LockedRegistry from to -> IO () Source # | |
Ord from => KeyOpsRegistry (LockedRegistry from to) from Source # | |
Defined in Util.Registry deleteFromRegistryBool :: LockedRegistry from to -> from -> IO Bool Source # deleteFromRegistry :: LockedRegistry from to -> from -> IO () Source # listKeys :: LockedRegistry from to -> IO [from] Source # | |
Ord from => GetSetRegistry (LockedRegistry from to) from to Source # | |
Defined in Util.Registry transformValue :: LockedRegistry from to -> from -> (Maybe to -> IO (Maybe to, extra)) -> IO extra Source # getValueOpt :: LockedRegistry from to -> from -> IO (Maybe to) Source # getValue :: LockedRegistry from to -> from -> IO to Source # setValue :: LockedRegistry from to -> from -> to -> IO () Source # |
type UntypedLockedRegistry from = Untyped LockedRegistry from Source #
data Untyped registry from Source #
Instances
NewRegistry (registry from Dyn) => NewRegistry (Untyped registry from) Source # | |
Defined in Util.Registry newRegistry :: IO (Untyped registry from) Source # emptyRegistry :: Untyped registry from -> IO () Source # | |
GetSetRegistry (registry from Dyn) from Dyn => GetSetRegistryDyn (Untyped registry from) from Source # | |
Defined in Util.Registry | |
KeyOpsRegistry (registry from Dyn) from => KeyOpsRegistry (Untyped registry from) from Source # | |
(Typeable to, GetSetRegistry (registry from Dyn) from Dyn) => GetSetRegistry (Untyped registry from) from to Source # | |
Defined in Util.Registry transformValue :: Untyped registry from -> from -> (Maybe to -> IO (Maybe to, extra)) -> IO extra Source # getValueOpt :: Untyped registry from -> from -> IO (Maybe to) Source # getValue :: Untyped registry from -> from -> IO to Source # setValue :: Untyped registry from -> from -> to -> IO () Source # |
data Unsafe registry from Source #
Instances
NewRegistry (registry from Obj) => NewRegistry (Unsafe registry from) Source # | |
Defined in Util.Registry newRegistry :: IO (Unsafe registry from) Source # emptyRegistry :: Unsafe registry from -> IO () Source # | |
KeyOpsRegistry (registry from Obj) from => KeyOpsRegistry (Unsafe registry from) from Source # | |
GetSetRegistry (registry from Obj) from Obj => GetSetRegistry (Unsafe registry from) from to Source # | |
Defined in Util.Registry |
type UnsafeRegistry from = Unsafe Registry from Source #
class NewRegistry registry where Source #
newRegistry :: IO registry Source #
emptyRegistry :: registry -> IO () Source #
Instances
Ord from => NewRegistry (LockedRegistry from to) Source # | |
Defined in Util.Registry newRegistry :: IO (LockedRegistry from to) Source # emptyRegistry :: LockedRegistry from to -> IO () Source # | |
NewRegistry (registry from Obj) => NewRegistry (Unsafe registry from) Source # | |
Defined in Util.Registry newRegistry :: IO (Unsafe registry from) Source # emptyRegistry :: Unsafe registry from -> IO () Source # | |
NewRegistry (registry from Dyn) => NewRegistry (Untyped registry from) Source # | |
Defined in Util.Registry newRegistry :: IO (Untyped registry from) Source # emptyRegistry :: Untyped registry from -> IO () Source # | |
Ord from => NewRegistry (Registry from to) Source # | |
Defined in Util.Registry newRegistry :: IO (Registry from to) Source # emptyRegistry :: Registry from to -> IO () Source # |
class GetSetRegistry registry from to where Source #
transformValue :: registry -> from -> (Maybe to -> IO (Maybe to, extra)) -> IO extra Source #
getValueOpt :: registry -> from -> IO (Maybe to) Source #
Instances
Ord from => GetSetRegistry (LockedRegistry from to) from to Source # | |
Defined in Util.Registry transformValue :: LockedRegistry from to -> from -> (Maybe to -> IO (Maybe to, extra)) -> IO extra Source # getValueOpt :: LockedRegistry from to -> from -> IO (Maybe to) Source # getValue :: LockedRegistry from to -> from -> IO to Source # setValue :: LockedRegistry from to -> from -> to -> IO () Source # | |
GetSetRegistry (registry from Obj) from Obj => GetSetRegistry (Unsafe registry from) from to Source # | |
Defined in Util.Registry | |
(Typeable to, GetSetRegistry (registry from Dyn) from Dyn) => GetSetRegistry (Untyped registry from) from to Source # | |
Defined in Util.Registry transformValue :: Untyped registry from -> from -> (Maybe to -> IO (Maybe to, extra)) -> IO extra Source # getValueOpt :: Untyped registry from -> from -> IO (Maybe to) Source # getValue :: Untyped registry from -> from -> IO to Source # setValue :: Untyped registry from -> from -> to -> IO () Source # | |
Ord from => GetSetRegistry (Registry from to) from to Source # | |
Defined in Util.Registry |
class GetSetRegistryDyn registry from where Source #
setValueAsDyn :: registry -> from -> Dyn -> IO () Source #
getValueAsDyn :: registry -> from -> IO Dyn Source #
Instances
GetSetRegistry (registry from Dyn) from Dyn => GetSetRegistryDyn (Untyped registry from) from Source # | |
Defined in Util.Registry |
class KeyOpsRegistry registry from where Source #
deleteFromRegistryBool :: registry -> from -> IO Bool Source #
deleteFromRegistry :: registry -> from -> IO () Source #
Instances
Ord from => KeyOpsRegistry (LockedRegistry from to) from Source # | |
Defined in Util.Registry deleteFromRegistryBool :: LockedRegistry from to -> from -> IO Bool Source # deleteFromRegistry :: LockedRegistry from to -> from -> IO () Source # listKeys :: LockedRegistry from to -> IO [from] Source # | |
KeyOpsRegistry (registry from Obj) from => KeyOpsRegistry (Unsafe registry from) from Source # | |
KeyOpsRegistry (registry from Dyn) from => KeyOpsRegistry (Untyped registry from) from Source # | |
Ord from => KeyOpsRegistry (Registry from to) from Source # | |
class ListRegistryContents registry from to where Source #
ListRegistryContents will not be implemented for the untyped registries.
listRegistryContents :: registry from to -> IO [(from, to)] Source #
listRegistryContentsAndEmptyRegistry Source #
:: registry from to | |
-> IO [(from, to)] | this is atomic. |
listToNewRegistry :: [(from, to)] -> IO (registry from to) Source #
Instances
Ord from => ListRegistryContents Registry from to Source # | |
Defined in Util.Registry listRegistryContents :: Registry from to -> IO [(from, to)] Source # listRegistryContentsAndEmptyRegistry :: Registry from to -> IO [(from, to)] Source # listToNewRegistry :: [(from, to)] -> IO (Registry from to) Source # |
changeKey :: Ord from => Registry from to -> from -> from -> IO () Source #
look up the element given by the first key, and if it exists delete it, replacing it with the element given by the second key.
getValueDefault :: GetSetRegistry registry from to => to -> registry -> from -> IO to Source #
getValueSafe :: GetSetRegistry registry from to => String -> registry -> from -> IO to Source #