Opened 4 years ago

Closed 16 months ago

#7625 closed bug (duplicate)

Semicolon is not handled between imports at the ghci command prompt

Reported by: JohnWiegley Owned by:
Priority: normal Milestone:
Component: GHCi Version: 7.4.2
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Test Case:
Blocked By: Blocking:
Related Tickets: #11392 Differential Rev(s):
Wiki Page:


You cannot use "import Data.List ; import Control.Monad" at the ghci command prompt. It gives:

<no location info>: parse error in import declaration

Attachments (1)

0001-Allow-multiple-import-statements-on-one-line-in-GHCi.patch (2.4 KB) - added by parcs 4 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 4 years ago by parcs

Status: newpatch

Patch attached.

comment:2 Changed 4 years ago by igloo

difficulty: Unknown
Status: patchnew

Thanks for the patch, parcs. However, if I understand it correctly, it only works for import declarations?

If we support that, then we should presumably also support

import Data.List ; let x = 1


let { x = 1 } ; let { y = 2 }

John, how did you come across this?

comment:3 Changed 4 years ago by parcs

Yes, it only works for multiple import declarations. I can investigate supporting the two examples you mentioned.

comment:4 Changed 4 years ago by JohnWiegley

It was brought up in #haskell, I just reported it because another user was having difficulty registering for the Trac.

comment:5 Changed 4 years ago by igloo

Milestone: 7.8.1

comment:6 Changed 3 years ago by thoughtpolice


Moving to 7.10.1

comment:7 Changed 2 years ago by thoughtpolice


Moving to 7.12.1 milestone; if you feel this is an error and should be addressed sooner, please move it back to the 7.10.1 milestone.

comment:8 Changed 21 months ago by thoughtpolice


Milestone renamed

comment:9 Changed 16 months ago by thomie

Milestone: 8.0.1

comment:10 Changed 16 months ago by thomie

Resolution: duplicate
Status: newclosed

This is now tracked in #11392.

The error message in 8.0 is a little bit nicer at least, after #10663:

Prelude> import Data.List ; import Data.Map
error: expecting a single import declaration
Note: See TracTickets for help on using tickets.