From 477ff950708946cf84d500f6326f99ef23af710e Mon Sep 17 00:00:00 2001 From: Jens Nolte <git@queezle.net> Date: Wed, 14 Oct 2020 23:42:00 +0200 Subject: [PATCH] Minor change --- src/lib/Qd/Observable.hs | 4 ++-- src/lib/Qd/Observable/ObservablePriority.hs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/Qd/Observable.hs b/src/lib/Qd/Observable.hs index 7a03441..6673331 100644 --- a/src/lib/Qd/Observable.hs +++ b/src/lib/Qd/Observable.hs @@ -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 diff --git a/src/lib/Qd/Observable/ObservablePriority.hs b/src/lib/Qd/Observable/ObservablePriority.hs index a4bd4c4..9f180fe 100644 --- a/src/lib/Qd/Observable/ObservablePriority.hs +++ b/src/lib/Qd/Observable/ObservablePriority.hs @@ -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 -- GitLab