Compile .tex and remove .div file from Haskell
When you are using packages, please make sure to say which ones. I guessed shellmate btw. As for the code, it's quite readable except for the handler definition which I've rewritten as follows:

handler :: S.FilePath -&gt; IO ()
handler f = do
  (Right isfile) &lt;- S.shell $ S.isFile f
  if      not isfile        then putStrLn "File not found."
  else if not $ isTeXFile f then putStrLn "Not a .tex file!"
  else compile f &gt;&gt;= either putStrLn return


Given that you are quickly dismissing the cases you are not interested in, I inspected not $ isTeXFile f and systematically written the if (...) then clauses on the same line. This avoids the crazy right-leaning nesting.

Using the either combinator of type (a -&gt; c) -&gt; (b -&gt; c) -&gt; Either a b -&gt; c lets you rewrite the final case expression in a more concise fashion.

Finally, I don't think it's good practice to test a file's type based on its extension. Given that you are already running external tools, you may want to use ̀file for that job. It would look something like this:

isTeXFile :: S.FilePath -&gt; IO Bool
isTeXFile fp = do
  (Right ans) &lt;- S.shell $ S.run "file" [fp] ""
  return $ " LaTeX " `isInfixOf` ans

handler :: S.FilePath -&gt; IO ()
handler f = do
  (Right isfile) &lt;- S.shell $ S.isFile f
  if not isfile        then putStrLn "File not found."
  else do
  testTexFile    &lt;- isTeXFile f
  if not $ testTexFile then putStrLn "Not a .tex file!"
  else compile f &gt;&gt;= either putStrLn return


The rest is pretty much perfect as far as I'm concerned (modulo some cosmetic preferences which I won't bore you with).