diff options
author | tv <tv@shackspace.de> | 2014-08-07 06:36:34 +0200 |
---|---|---|
committer | tv <tv@shackspace.de> | 2014-08-07 06:36:34 +0200 |
commit | ca87352723bc2f36c8e37df6b50e310a1a38054d (patch) | |
tree | 0e570846ac2e42859b74d7eda85191f08097c736 /src | |
parent | 9e6ad8f3f05010a40802aa7579547c76c65e5b63 (diff) |
add Scanner.getKey
Diffstat (limited to 'src')
-rw-r--r-- | src/Scanner.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Scanner.hs b/src/Scanner.hs index 780f9f8..9f0b5ed 100644 --- a/src/Scanner.hs +++ b/src/Scanner.hs @@ -20,6 +20,14 @@ import Control.Monad.Writer import Data.Time.Clock +-- high level interface +getKey :: IO String +getKey = do + _ <- hLookAhead stdin -- wait for input + ((_, raw_s), _) <- runScanner scan + return $ map toChar raw_s + + type P = C type I = C type F = C |