1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 18:23:44 +03:00

State is the other way around now.

This commit is contained in:
Rob Rix 2018-07-04 10:53:46 -04:00
parent ddbd2690bb
commit ea9b24a903

View File

@ -124,7 +124,7 @@ tagGraph :: forall a . (Eq a, Hashable a) => Graph a -> Graph (a, Tag)
tagGraph = unwrap . traverse go where
unwrap :: Eff '[Fresh, State (HashMap a Tag)] (Graph (a, Tag)) -> Graph (a, Tag)
unwrap = run . fmap fst . runState HashMap.empty . runFresh 1
unwrap = run . fmap snd . runState HashMap.empty . runFresh 1
go :: a -> Eff '[Fresh, State (HashMap a Tag)] (a, Tag)
go v = gets (HashMap.lookup v) >>= \case