diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2019-06-04 11:11:57 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2019-06-04 11:13:16 +0200 |
| commit | 537ac8a2ecb64a141ec8ffc1ab053e84154c4f09 (patch) | |
| tree | a50ef75e88f20ea88d7e347484bb79014ff3705a /interactive-edit-lens | |
| parent | f4c419b9ddec15bad267a4463f0720d6e28042d2 (diff) | |
| download | incremental-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.hs | 16 |
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 | |||
| 92 | instance Finite LineBreakState | 92 | instance Finite LineBreakState |
| 93 | instance NFData LineBreakState | 93 | instance NFData LineBreakState |
| 94 | 94 | ||
| 95 | data SwitchState = SwitchA | SwitchB | ||
| 96 | deriving (Eq, Ord, Enum, Bounded, Show, Read, Generic) | ||
| 97 | instance Universe SwitchState | ||
| 98 | instance Finite SwitchState | ||
| 99 | instance NFData SwitchState | ||
| 100 | |||
| 95 | dfstMap :: String -> Maybe SomeDFST | 101 | dfstMap :: String -> Maybe SomeDFST |
| 96 | dfstMap "double" = Just . SomeDFST $ DFST | 102 | dfstMap "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 | } |
| 237 | dfstMap "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 | } | ||
| 231 | dfstMap _ = Nothing | 247 | dfstMap _ = Nothing |
| 232 | 248 | ||
| 233 | main :: IO () | 249 | main :: IO () |
