あなたが要求している Haskell プログラム全体を書き込もうとはしませんが、ここでは、キーを押すたびに何かを実行するという、現時点で行き詰っていると主張する部分を示す非常に短い例を示します。わくわくするようなことは何もしません (数字を打ち込んで出力するだけです) が、その 1 つの小さなタスクを実行する方法を示します。おそらくそこからハッキングを開始できます。
あなたがそうでないように見えることを本当に知る必要がある唯一のことは、入力の行バッファリングをオフにできるということです。
import System.IO
loop n = do
c <- getChar
print n
-- do whatever recalculation you need to do here, using
-- n (which can be more complicated than an Integer, as
-- it is here, of course) and c (which is a Char
-- representing the key the user whacked)
-- our recalculation is just to increase n by one
loop (n+1)
main = do
hSetBuffering stdin NoBuffering -- do this once before anything else
loop 0