#!/bin/sh find ./src -name '*.hs' -printf '%T@ %p\n' \ | sort -r | head -n1 | cut -d' ' -f2 | while read file do out_file="$(basename "$file" | cut -d'.' -f1)" echo "Compiling file '${file}' into '${out_file}'" ghc -o "$out_file" "$file" done