I've been attempting to use Haskell for running a simple production process. Like many production processes, it involves changing the states of things all over the place. For this reason, it would be really handy for me to have a script file where I could keep track of things and selectively run commands into interactive Haskell, something like
-- to start the process
process <- startProcess
-- to stop process
stopProcess
-- to check how things are going
summary <- checkStuff
summary
-- optionally restart bad processes
restartProcesses (getBadProcesses summary)
-- send summary emails
sendSummaryEmails summary ["abunch@ofemails.com", "thatIwould@rather.com",
"nothaveto@keep.com" "typing@out.com",
"orcopy@pasting.com"]
-- set up something big that I don't want to have to retype/paste every time
studentGrades <- getStudentGrades "John Peterson"
gen <- getStdGen
let (randomTest, gen') = generateRandomTest studentGrades gen
compilePdf randomTest
answers <- getAnswers
gradeTest randomTest answers "John Peterson"
It would be really cool if, like with ESS (Emacs speaks statistics) in R, if you could press a button to send these lines to the repl process. Maybe seperate buttons for line, paragraph, region. Is there already a way to do this?
For example with ESS, C-Ret
sends the line, C-c C-c
sends a paragraph, and C-c C-r
sends a region.