We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4f0b51b commit c48f3f7Copy full SHA for c48f3f7
src/DFAMin.hs
@@ -15,7 +15,7 @@ import qualified Data.IntSet as IS
15
import Data.IntMap (IntMap)
16
import qualified Data.IntMap as IM
17
import qualified Data.List as List
18
-
+import Data.Foldable (foldl')
19
20
-- Hopcroft's Algorithm for DFA minimization (cut/pasted from Wikipedia):
21
@@ -155,7 +155,7 @@ groupEquivStates DFA { dfa_states = statemap }
155
where
156
xs :: [EquivalenceClass]
157
xs = filter (not . IS.null)
158
- . map (IS.unions . flip IM.restrictKeys a)
+ . map (foldl' IS.union IS.empty . flip IM.restrictKeys a)
159
$ bigmap
160
161
go0 (r,q) x = go1 r [] []
0 commit comments