我一直在尝试使用 Haskell 来运行一个简单的生产过程。像许多生产过程一样,它涉及改变整个地方的事物状态。出于这个原因,拥有一个脚本文件对我来说真的很方便,我可以在其中跟踪事物并有选择地将命令运行到交互式 Haskell 中,例如
-- 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"
如果像 R 中的 ESS(Emacs 说统计)一样,如果您可以按下按钮将这些行发送到 repl 进程,那将是非常酷的。可能是行、段落、区域的单独按钮。有没有办法做到这一点?
例如使用 ESS,C-Ret
发送行、C-c C-c
发送段落和C-c C-r
发送区域。