uni-util-2.2.0.0: Utilities for the uniform workbench

Util.Registry

Description

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

Documentation

data Ord from => Registry from to Source

Instances

Typeable2 Registry 
Ord from => ListRegistryContents Registry from to 
Ord from => NewRegistry (Registry from to) 
(HasBinary (from, to) m, Ord from, MonadIO m) => HasBinary (Registry from to) m 
Ord from => KeyOpsRegistry (Registry from to) from 
Ord from => GetSetRegistry (Registry from to) from to 

data LockedRegistry from to Source

Instances

Typeable2 LockedRegistry 
Ord from => NewRegistry (LockedRegistry from to) 
Ord from => KeyOpsRegistry (LockedRegistry from to) from 
Ord from => GetSetRegistry (LockedRegistry from to) from to 

data Untyped registry from Source

Instances

NewRegistry (registry from Dyn) => NewRegistry (Untyped registry from) 
GetSetRegistry (registry from Dyn) from Dyn => GetSetRegistryDyn (Untyped registry from) from 
KeyOpsRegistry (registry from Dyn) from => KeyOpsRegistry (Untyped registry from) from 
(Typeable to, GetSetRegistry (registry from Dyn) from Dyn) => GetSetRegistry (Untyped registry from) from to 

data Unsafe registry from Source

Instances

NewRegistry (registry from Obj) => NewRegistry (Unsafe registry from) 
KeyOpsRegistry (registry from Obj) from => KeyOpsRegistry (Unsafe registry from) from 
GetSetRegistry (registry from Obj) from Obj => GetSetRegistry (Unsafe registry from) from to 

class NewRegistry registry whereSource

Methods

newRegistry :: IO registrySource

emptyRegistry :: registry -> IO ()Source

Instances

Ord from => NewRegistry (LockedRegistry from to) 
NewRegistry (registry from Obj) => NewRegistry (Unsafe registry from) 
NewRegistry (registry from Dyn) => NewRegistry (Untyped registry from) 
Ord from => NewRegistry (Registry from to) 

class GetSetRegistry registry from to whereSource

Methods

transformValue :: registry -> from -> (Maybe to -> IO (Maybe to, extra)) -> IO extraSource

getValueOpt :: registry -> from -> IO (Maybe to)Source

getValue :: registry -> from -> IO toSource

setValue :: registry -> from -> to -> IO ()Source

Instances

Ord from => GetSetRegistry (LockedRegistry from to) from to 
GetSetRegistry (registry from Obj) from Obj => GetSetRegistry (Unsafe registry from) from to 
(Typeable to, GetSetRegistry (registry from Dyn) from Dyn) => GetSetRegistry (Untyped registry from) from to 
Ord from => GetSetRegistry (Registry from to) from to 

class GetSetRegistryDyn registry from whereSource

Methods

setValueAsDyn :: registry -> from -> Dyn -> IO ()Source

getValueAsDyn :: registry -> from -> IO DynSource

Instances

GetSetRegistry (registry from Dyn) from Dyn => GetSetRegistryDyn (Untyped registry from) from 

class KeyOpsRegistry registry from whereSource

Methods

deleteFromRegistryBool :: registry -> from -> IO BoolSource

deleteFromRegistry :: registry -> from -> IO ()Source

listKeys :: registry -> IO [from]Source

Instances

Ord from => KeyOpsRegistry (LockedRegistry from to) from 
KeyOpsRegistry (registry from Obj) from => KeyOpsRegistry (Unsafe registry from) from 
KeyOpsRegistry (registry from Dyn) from => KeyOpsRegistry (Untyped registry from) from 
Ord from => KeyOpsRegistry (Registry from to) from 

class ListRegistryContents registry from to whereSource

ListRegistryContents will not be implemented for the untyped registries.

Methods

listRegistryContents :: registry from to -> IO [(from, to)]Source

listRegistryContentsAndEmptyRegistrySource

Arguments

:: registry from to 
-> IO [(from, to)]

this is atomic.

listToNewRegistry :: [(from, to)] -> IO (registry from to)Source

Instances

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.

getRegistryValue :: Ord from => Registry from to -> from -> IO toSource

getValueDefault :: GetSetRegistry registry from to => to -> registry -> from -> IO toSource

getValue' :: GetSetRegistry registry from to => String -> registry -> from -> IO toSource

getValueSafe :: GetSetRegistry registry from to => String -> registry -> from -> IO toSource

getRegistryValueSafe :: Ord from => String -> Registry from to -> from -> IO toSource