File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,26 +38,6 @@ TVarId Context::newGUID()
3838 return guid;
3939}
4040
41- // tryCommit :: Context -> UStamp -> TVars -> IO Bool
42- // tryCommit (Context mtvars) ustamp stagedTVars = do
43- // tvars <- takeMVar mtvars
44-
45- // let conflict = Map.foldMapWithKey (f tvars "") stagedTVars
46- // let newTVars = Map.unionWith (merge ustamp) stagedTVars tvars
47-
48- // putMVar mtvars $ if null conflict then newTVars else tvars
49-
50- // pure $ null conflict
51-
52- // where
53- // f :: TVars -> String -> TVarId -> TVarHandle -> String
54- // f origTvars acc tvarId (TVarHandle stagedUS _) = case Map.lookup tvarId origTvars of
55- // Nothing -> acc
56- // Just (TVarHandle origUS _) | origUS == stagedUS -> acc
57- // | otherwise -> acc ++ " " ++ show tvarId
58- // merge :: UStamp -> TVarHandle -> TVarHandle -> TVarHandle
59- // merge us' (TVarHandle _ d) _ = TVarHandle us' d
60-
6141bool Context::tryCommit (const UStamp& ustamp, const TVars& stagedTvars)
6242{
6343 takeLock ();
Original file line number Diff line number Diff line change @@ -161,30 +161,6 @@ STML<Ret> bothTVars(
161161 f);
162162}
163163
164- // template <typename A>
165- // STML<std::tuple<A>> readMany(const TVar<A>& tvar)
166- // {
167- // STML<A> ma = readTVar(tvar);
168- // return stm::bind<A, std::tuple<A>>(ma, [](const A& a)
169- // {
170- // return pure(std::make_tuple(a));
171- // });
172- // }
173-
174- // template <typename A, typename... Tail>
175- // STML<std::tuple<Tail>> readMany(const TVar<A>& tvar, Tail... tailTVars)
176- // {
177- // STML<std::tuple<Tail...> mTail = readMany<Tail...>(tailTVars);
178- // return stm::bind(mTail, [=](const std::tuple<Tail...>& tail)
179- // {
180- // STML<A> ma = readTVar(tvar);
181- // return stm::bind<A, std::tuple<Tail...>>(ma, [=](const A& a)
182- // {
183- // return stm::pure(std::make_tuple(a, std::tie(tail)));
184- // });
185- // });
186- // }
187-
188164template <typename A, typename B>
189165STML <B> sequence (const STML <A> ma, const STML <B>& mb)
190166{
@@ -237,11 +213,6 @@ STML<fp::Unit> unless(const STML<bool>& ma, const STML<B>& mb)
237213 });
238214}
239215
240- // const auto writeTVarRet = [](const auto& tvar, const auto& val)
241- // {
242- // return sequence(writeTVar(tvar, val), readTVar(tvar));
243- // };
244-
245216} // namespace stm
246217
247218#endif // STM_H
You can’t perform that action at this time.
0 commit comments