Replace stir shell script by Haskell script