File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Expand file tree Collapse file tree 1 file changed +8
-1
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 #-}
3
4
{-# LANGUAGE PatternGuards #-}
4
5
{-# LANGUAGE ScopedTypeVariables #-}
5
6
{-# LANGUAGE TupleSections #-}
@@ -17,6 +18,12 @@ import qualified Data.IntMap as IM
17
18
import qualified Data.List as List
18
19
import Data.Foldable (foldl' )
19
20
21
+ #if __GLASGOW_HASKELL__ >= 802
22
+ restrictKeys = IM. restrictKeys
23
+ #else
24
+ restrictKeys m s = IM. filterWithKey (\ k _ -> IS. member k s) m
25
+ #endif
26
+
20
27
-- Hopcroft's Algorithm for DFA minimization (cut/pasted from Wikipedia):
21
28
22
29
-- P := {{all accepting states}, {all nonaccepting states}};
@@ -155,7 +162,7 @@ groupEquivStates DFA { dfa_states = statemap }
155
162
where
156
163
xs :: [EquivalenceClass ]
157
164
xs = filter (not . IS. null )
158
- . map (foldl' IS. union IS. empty . flip IM. restrictKeys a)
165
+ . map (foldl' IS. union IS. empty . flip restrictKeys a)
159
166
$ bigmap
160
167
161
168
go0 (r,q) x = go1 r [] []
You can’t perform that action at this time.
0 commit comments