1
0
mirror of https://github.com/robonen/fp-haskell.git synced 2026-03-20 02:44:41 +00:00

Initial commit

This commit is contained in:
2023-05-02 21:10:55 +07:00
commit 69c53a7949
11 changed files with 293 additions and 0 deletions

25
run.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env sh
PROG_NAME=$1
if [ -z "$PROG_NAME" ]; then
echo "Usage: run.sh <program name>"
exit 1
fi
# Source and build paths
SRC_PATH=src/$PROG_NAME/$PROG_NAME.hs
BUILD_PATH=build/$PROG_NAME
# Build trash paths
OBJ_PATH=src/$PROG_NAME/$PROG_NAME.o
HI_PATH=src/$PROG_NAME/$PROG_NAME.hi
if [ ! -f $SRC_PATH ]; then
echo "File $SRC_PATH does not exist"
exit 1
fi
ghc -o $BUILD_PATH $SRC_PATH \
&& rm $OBJ_PATH $HI_PATH \
&& ./$BUILD_PATH