我有一個定義了 haskell 程式
module Lib
( someFunc
) where
someFunc :: IO ()
someFunc = do
print "Hello world"
使用堆疊打開 REPL 會將這個庫加載到背景關系中。
*Main Lib Paths_hs> someFunc
"Hello world"
在更改函式、寫入檔案并執行函式后,我得到了相同的結果
someFunc :: IO ()
someFunc = do
print "Bye bye"
*Main Lib Paths_hs> someFunc
"Hello world"
但我期待函式someFunc 回傳我宣告的新值"Bye bye"。
我試過運行 stack build,但沒有用。現在,我可以重新打開 REPL,并擁有新功能,但我不想丟失我當前的歷史記錄。無論如何我可以將新編譯的程式加載到當前的 REPL 中,或者將活動會話歷史記錄加載到新的 REPL 中
uj5u.com熱心網友回復:
根據檔案,您可以使用該:reload指令(或:r很快)。
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/446079.html
