Skip to content

Commit c9bc39a

Browse files
committed
take out IM.elems from bigmap
1 parent ebc87b9 commit c9bc39a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/DFAMin.hs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,12 @@ groupEquivStates DFA { dfa_states = statemap }
137137
| otherwise = [nonaccepting_states]
138138
init_q = accept_groups
139139

140-
-- elements of
141-
-- a map from token T to
142-
-- a map from state S to the set of states that transition to
143-
-- S on token T
140+
-- a map from token T to
141+
-- a map from state S to the set of states that transition to
142+
-- S on token T
144143
-- This is a cache of the information needed to compute xs below
145-
bigmap :: [IntMap EquivalenceClass]
146-
bigmap = IM.elems $ IM.fromListWith (IM.unionWith IS.union)
144+
bigmap :: IntMap (IntMap EquivalenceClass)
145+
bigmap = IM.fromListWith (IM.unionWith IS.union)
147146
[ (i, IM.singleton to (IS.singleton from))
148147
| (from, state) <- Map.toList statemap,
149148
(i,to) <- IM.toList (state_out state) ]
@@ -156,7 +155,7 @@ groupEquivStates DFA { dfa_states = statemap }
156155
xs :: [EquivalenceClass]
157156
xs = filter (not . IS.null)
158157
. map (\m -> IS.unions [IM.findWithDefault IS.empty s m | s <- IS.toList a])
159-
$ bigmap
158+
$ IM.elems bigmap
160159

161160
go0 (r,q) x = go1 r [] []
162161
where

0 commit comments

Comments
 (0)