4 ms·
type JokeM a = IO a askQuestion :: JokeM String askQuestion = do putStr "How do you know someone works at Jane Street? " hFlush stdout
by doctorpangloss 2y ago
type JokeM a = IO a
askQuestion :: JokeM String
askQuestion = do
putStr "How do you know someone works at Jane Street? "
hFlush stdout
getLine
tellPunchline :: String -> JokeM ()
tellPunchline _ = putStrLn "They tell you!"
janeStreetJoke :: JokeM ()
janeStreetJoke = askQuestion >>= tellPunchline
main :: IO ()
main = forever janeStreetJoke
I don't know this feels kind of verbose to me.