Skip to content

Commit 833ff8c

Browse files
committed
[ clarify ] DFAMin: map instead of zip (repeat..)
1 parent 6e47771 commit 833ff8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/DFAMin.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
{-# LANGUAGE PatternGuards #-}
44
{-# LANGUAGE ScopedTypeVariables #-}
5+
{-# LANGUAGE TupleSections #-}
56

67
module DFAMin (minimizeDFA) where
78

@@ -54,7 +55,7 @@ minimizeDFA dfa@DFA { dfa_start_states = starts,
5455
number n (ss:sss) =
5556
case filter (`IS.member` ss) starts of
5657
[] -> (n,ss) : number (n+1) sss
57-
starts' -> zip starts' (repeat ss) ++ number n sss
58+
starts' -> map (,ss) starts' ++ number n sss
5859
-- if one of the states of the minimized DFA corresponds
5960
-- to multiple starts states, we just have to duplicate
6061
-- that state.

0 commit comments

Comments
 (0)