1
Fork 0
mirror of https://github.com/Jaxan/ons-hs.git synced 2025-04-27 14:47:45 +02:00

Adds hFlush for IO

This commit is contained in:
Joshua Moerman 2019-01-17 15:01:40 +01:00
parent 2ee2f091cb
commit 2b6a011551

View file

@ -15,6 +15,7 @@ import qualified EquivariantSet as Set
import Data.List (tails) import Data.List (tails)
import Control.Monad.State import Control.Monad.State
import System.IO (hFlush, stdout)
import Prelude hiding (filter, null, elem, lookup, product, Word, map, take, init) import Prelude hiding (filter, null, elem, lookup, product, Word, map, take, init)
-- We use Lists, as they provide a bit more laziness -- We use Lists, as they provide a bit more laziness
@ -158,6 +159,7 @@ askMember w = do
putStr "MQ \"" putStr "MQ \""
putStr (toStr w) putStr (toStr w)
putStrLn "\"" putStrLn "\""
hFlush stdout
a <- getLine a <- getLine
case a of case a of
"Y" -> return True "Y" -> return True
@ -169,6 +171,7 @@ askEquiv aut = do
putStr "EQ \"" putStr "EQ \""
putStr (toStr aut) putStr (toStr aut)
putStrLn "\"" putStrLn "\""
hFlush stdout
a <- getLine a <- getLine
case a of case a of
"Y" -> return Nothing "Y" -> return Nothing
@ -186,6 +189,7 @@ init alph = Observations
main :: IO () main :: IO ()
main = do main = do
putStrLn "ALPHABET" putStrLn "ALPHABET"
hFlush stdout
alph <- getLine alph <- getLine
case alph of case alph of
"ATOMS" -> do "ATOMS" -> do