From 94367adff362275ee85e37e69540a347cc51ba23 Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 28 Dec 2014 22:43:10 +0100 Subject: cleanup Scanner --- test5.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'test5.hs') diff --git a/test5.hs b/test5.hs index 5a682bd..c06f523 100644 --- a/test5.hs +++ b/test5.hs @@ -17,7 +17,7 @@ import Control.Exception import Control.Monad import Data.Maybe import Data.Monoid -import Scanner (scan, runScanner, toChar) +import Scanner (getKey) import System.Directory import System.Environment import System.Exit @@ -136,9 +136,7 @@ winchHandler putEvent = inputHandler :: (Event -> IO ()) -> IO () inputHandler putEvent = forever $ do -- TODO make stdin configurable - _ <- hLookAhead stdin - ((_, s), _) <- runScanner scan - putEvent $ EKey $ map toChar s + getKey >>= putEvent . EKey run :: IO Event -> State -> IO () -- cgit v1.2.3