Skip to content
Snippets Groups Projects
Commit 477ff950 authored by Jens Nolte's avatar Jens Nolte
Browse files

Minor change

parent f9d78416
No related branches found
No related tags found
No related merge requests found
......@@ -121,8 +121,8 @@ instance Settable v (ObservableVar v) where
newObservableVar :: Maybe v -> IO (ObservableVar v)
newObservableVar defaultValue = do
ObservableVar <$> newMVar (defaultValue, HM.empty)
newObservableVar initialValue = do
ObservableVar <$> newMVar (initialValue, HM.empty)
setObservableVar :: ObservableVar v -> ObservableState v -> IO ()
setObservableVar (ObservableVar mvar) value = do
......
......@@ -57,7 +57,7 @@ currentValue Internals{current} = (\(_, _, value) -> value) <$> current
-- | Insert a value with an assigned priority into the data structure. If the priority is higher than the current highest priority the value will become the current value (and will be sent to subscribers). Otherwise the value will be stored and will only become the current value when all values with a higher priority and all values with the same priority that have been inserted earlier have been removed.
-- Returns an `RegistrationHandle` that can be used to remove the value from the data structure.
insertValue :: forall p v. (Eq v, Ord p, Hashable p) => ObservablePriority p v -> p -> v -> IO RegistrationHandle
insertValue :: forall p v. (Ord p, Hashable p) => ObservablePriority p v -> p -> v -> IO RegistrationHandle
insertValue (ObservablePriority mvar) priority value = modifyMVar mvar $ \internals -> do
key <- newUnique
newInternals <- insertValue' key internals
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment