Skip to content

Commit 80a13c5

Browse files
author
Yogansh Sharma
committed
Haskell compiler and --no-persistent option
1 parent b0ab441 commit 80a13c5

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

run

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,14 @@ run() {
214214
ruby "$FILE"
215215

216216
elif [[ ${FILE#*.} == hs ]]; then
217-
runghc "$FILE"
217+
if [[ $COMPILE == true ]]; then
218+
ghc --make "$FILE"
219+
if [[ $PERSISTENT != true ]]; then
220+
rm "${FILE%%.*}.o" "${FILE%%.*}.hi" "${FILE%%.*}"
221+
fi
222+
else
223+
runghc "$FILE"
224+
fi
218225

219226
else
220227
_ERROR_UFTC_
@@ -306,6 +313,9 @@ for arg in "$@"; do
306313
"--persistent" | "p")
307314
PERSISTENT=true
308315
;;
316+
"--no-persistent" | "np")
317+
PERSISTENT=false
318+
;;
309319
"--compile" | "c")
310320
COMPILE=true
311321
PERSISTENT=true

0 commit comments

Comments
 (0)