Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,399
    • Issues 5,399
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 592
    • Merge requests 592
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #7253
Closed
Open
Issue created Sep 19, 2012 by Feuerbach@trac-Feuerbach

Top-level bindings in ghci

ghci now supports most of the declarations. However, it doesn't support the most basic and common type of declaraion — pattern and function bindings!

E.g.

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.
Trac metadata
Trac field Value
Version 7.6.1
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking