When I compile a Haskell file with ghci, typically with :load, and if there is no type error, all the expressions are loaded in the ghc interpreter
ghci
:load
As @MikhailGlushenkov pointed out in the comments, the solution is to use the -fdefer-type-errors flag to GHCi.