Ticket #7253 (new feature request)
Top-level bindings in ghci
|Reported by:||Feuerbach||Owned by:|
|Type of failure:||Other||Difficulty:||Unknown|
|Test Case:||Blocked By:|
ghci now supports most of the declarations. However, it doesn't support the most basic and common type of declaraion — pattern and function bindings!
Prelude> a = 1 <interactive>:2:3: parse error on input `='
I realise that, if implemented, they would have somewhat different semantics than in Haskell modules — e.g. with respect to recursion.
But even if they behaved in the same way as top-level monadic let-bindings, they would still be very useful for two reasons:
1. If you're doing quick experiments in ghci, "let a=1" is more than twice as long as "a=1", and that makes a difference.
2. Novices are often confused when they are told that they have to use one syntax for definitions in modules and another in ghci.