summaryrefslogtreecommitdiff
path: root/interactive-edit-lens
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2019-06-04 11:11:57 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2019-06-04 11:13:16 +0200
commit537ac8a2ecb64a141ec8ffc1ab053e84154c4f09 (patch)
treea50ef75e88f20ea88d7e347484bb79014ff3705a /interactive-edit-lens
parentf4c419b9ddec15bad267a4463f0720d6e28042d2 (diff)
downloadincremental-dfsts-537ac8a2ecb64a141ec8ffc1ab053e84154c4f09.tar
incremental-dfsts-537ac8a2ecb64a141ec8ffc1ab053e84154c4f09.tar.gz
incremental-dfsts-537ac8a2ecb64a141ec8ffc1ab053e84154c4f09.tar.bz2
incremental-dfsts-537ac8a2ecb64a141ec8ffc1ab053e84154c4f09.tar.xz
incremental-dfsts-537ac8a2ecb64a141ec8ffc1ab053e84154c4f09.zip
Cleanup
Diffstat (limited to 'interactive-edit-lens')
-rw-r--r--interactive-edit-lens/src/Main.hs16
1 files changed, 16 insertions, 0 deletions
diff --git a/interactive-edit-lens/src/Main.hs b/interactive-edit-lens/src/Main.hs
index c816515..21db685 100644
--- a/interactive-edit-lens/src/Main.hs
+++ b/interactive-edit-lens/src/Main.hs
@@ -92,6 +92,12 @@ instance Universe LineBreakState where
92instance Finite LineBreakState 92instance Finite LineBreakState
93instance NFData LineBreakState 93instance NFData LineBreakState
94 94
95data SwitchState = SwitchA | SwitchB
96 deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic)
97instance Universe SwitchState
98instance Finite SwitchState
99instance NFData SwitchState
100
95dfstMap :: String -> Maybe SomeDFST 101dfstMap :: String -> Maybe SomeDFST
96dfstMap "double" = Just . SomeDFST $ DFST 102dfstMap "double" = Just . SomeDFST $ DFST
97 { stInitial = () 103 { stInitial = ()
@@ -228,6 +234,16 @@ dfstMap "linebreak" = Just . SomeDFST $ DFST
228 ] 234 ]
229 , stAccept = Set.fromList universeF 235 , stAccept = Set.fromList universeF
230 } 236 }
237dfstMap "switch" = Just . SomeDFST $ DFST
238 { stInitial = SwitchA
239 , stTransition = Map.fromList
240 [ ((SwitchA, 's'), (SwitchB, Seq.empty))
241 , ((SwitchB, 's'), (SwitchA, Seq.empty))
242 , ((SwitchA, 'p'), (SwitchA, Seq.singleton 'a'))
243 , ((SwitchB, 'p'), (SwitchB, Seq.singleton 'b'))
244 ]
245 , stAccept = Set.fromList [SwitchA, SwitchB]
246 }
231dfstMap _ = Nothing 247dfstMap _ = Nothing
232 248
233main :: IO () 249main :: IO ()