title: Haskell: Monitor a file without polling (à la inotify in linux)
body: <p>Is there a haskell library function to monitor a file without polling?</p>
  
  <p>With polling i would do someting like this:</p>
  
  <pre><code>monitor file mtime handler = do
      threadDelay n -- sleep `n` ns
      t &lt;- getModificationTime file
      if t &gt; mtime
          then handler &gt;&gt; monitor file t handler
          else monitor file mtime handler
  </code></pre>
  
  <p>What I want is something like a blocking getModificationTime which will be woken up by the system. Is there something available?</p>
  
  <p>I would be perfectly happy if it was available for posix systems only, but the more portable the better :-)</p>
  
  <p><strong><em>Edit:</em></strong> I know <a href="http://code.haskell.org/hinotify/README.html" rel="noreferrer">hinotify</a>, but I'm on a Mac (that's why I mention POSIX).</p>