[Haskell] select(2) or poll(2)-like function?