From ca87352723bc2f36c8e37df6b50e310a1a38054d Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 7 Aug 2014 06:36:34 +0200 Subject: add Scanner.getKey --- src/Scanner.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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 -- cgit v1.2.3