Ticket #3302 (closed feature request: fixed)
Where-clause environments for GHCi
Often in ghci I'd like to interactively debug and play with functions in the where clause of a top-level definition. Currently, this requires one to change the code, lifting the definitions in question to the top level and adding appropriate parameters.
Given a definition such as
top :: Int -> Int top x = mult 4 - mult 3 + mult 2 where mult n = x * n
it would be nice to type something such as :environment top 2 to put me in an envrionment where mult is available and mult 4 will evaluate to 8. (Obviously this becomes more useful with more complex definitions.)