News for hackers. Stuff that matters.
Re:Ask HN: What resources do you recommend for learning Hask... by doctorpangloss on Sunday July 21, 2024 @08:39PM (#41029807)

    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.

There are no comments on this comment yet.