I’d like to be able to load commands into ghci and have the commands verbosely printed.

Likely you have a lot of .ghci files

 1 locate .ghci

Case in point

This file is actually a .ghci file as it contains commands such as :t (>)

I created an expect script for this purpose using my expect-generation script

 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 hs|ghci) { cmd="$1" shift if stdin_exists; then tfin="$(cat | tf txt)" inpara="-sf $(aqf "$tfin")" else : ${cmd:="foldl (/) 64 [4,2,4]"} fi # x -cd "$(pwd)" -sh "ghci" -r "^.*[^ ]>" -s "$cmd" -c m "$@" -o exec <&1 # echo "$cmd" 1>&2 # exit 0 if test -n "$cmd"; then incmd="-s $(aqf "$cmd")" fi fullcmd="x -cd \"$(pwd)\" -sh \"ghci\" -r \"^.*[^ ]>\"$inpara $incmd -c m \"\$@\" -o" # echo "$fullcmd" # exit 0 eval "$fullcmd" }

compile-run

 1 2 3 4 5 6 .ghci*) { cd "$dn" xs ghci "$fn" exit 0 } ;;

Other examples of automating ghci

 1 ghciol '[ x | x <- [50..100], x mod 7 == 3]'