compiler-discord/docker/haskell/run.sh

14 lines
292 B
Bash
Raw Normal View History

2019-03-13 06:51:49 +01:00
if [ "$EVAL_EXPR" = "true" ]; then
ghc -e "$1"
else
mkdir "$COUNT" && cd "$COUNT"
2019-03-13 06:51:49 +01:00
echo "$1" > program.hs
ghc -O0 -j +RTS -A128m -n2m -RTS \
-no-keep-o-files -no-keep-hi-files \
program.hs >/dev/null \
&& ./program
cd .. && rm -rf "$COUNT"
2019-03-13 06:51:49 +01:00
fi