allow definition of functions in the interpreter
|Reported by:||ahrivera||Owned by:|
|Type of failure:||Difficulty:||Unknown|
|Test Case:||Blocked By:|
Description (last modified by simonpj)
Right now, the only way to define functions is through the .hs files. Other interpreted languages such as Python allow the user to define functions in the command line. This is very helpful when one wants to prototype some quick functions.
One way to do it could be to detect when one declares the function and then enable a mode where one can add definitions. For example:
Prelude> x:: Int ->Int *definition*> x a = a + 1 *definition*> Prelude> x 10 11
Please consider adding this functionality to GHCI.
Change History (4)
comment:1 Changed 6 years ago by simonpj
- Description modified (diff)
- Difficulty set to Unknown
- Resolution set to worksforme
- Status changed from new to closed