What's the right way to :reload and run :main as a single command in GHCi?

ghc, ghci, haskell

Solution

`:cmd` seems to accept string with multiple lines. Therefore you can do the following command.

:cmd return $ unlines [":reload",":main"]

also you can add following code to `~/.ghci`

:def hoge const $ return $ unlines [":reload",":main"]

now you can execute `:hoge` in ghci

Problem

Is there a way to chain `:reload/:r` along with `:main` as a single command in GHCi? The goal here is to avoid typing both every time I change something in my other terminal, but to just type ↑Enter.

Original source