File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change 1
1
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
2
2
3
- {-# LANGUAGE CPP #-}
4
3
{-# LANGUAGE PatternGuards #-}
5
4
{-# LANGUAGE ScopedTypeVariables #-}
6
5
{-# LANGUAGE TupleSections #-}
@@ -16,13 +15,6 @@ import qualified Data.IntSet as IS
16
15
import Data.IntMap (IntMap )
17
16
import qualified Data.IntMap as IM
18
17
import qualified Data.List as List
19
- import Data.Foldable (foldl' )
20
-
21
- #if __GLASGOW_HASKELL__ >= 802
22
- restrictKeys = IM. restrictKeys
23
- #else
24
- restrictKeys m s = IM. intersection m (IM. fromSet (const () ) s)
25
- #endif
26
18
27
19
-- Hopcroft's Algorithm for DFA minimization (cut/pasted from Wikipedia):
28
20
@@ -162,7 +154,7 @@ groupEquivStates DFA { dfa_states = statemap }
162
154
where
163
155
xs :: [EquivalenceClass ]
164
156
xs = filter (not . IS. null )
165
- . map (foldl' IS. union IS. empty . flip restrictKeys a )
157
+ . map (\ m -> IS. unions [ IM. findWithDefault IS. empty s m | s <- IS. toList a] )
166
158
$ bigmap
167
159
168
160
go0 (r,q) x = go1 r [] []
You can’t perform that action at this time.
0 commit comments