[GHC] #10663: ghci ignores stuff after an import command and a semicolon
GHC
ghc-devs at haskell.org
Tue Jul 21 01:36:23 UTC 2015
#10663: ghci ignores stuff after an import command and a semicolon
-------------------------------------+-------------------------------------
Reporter: rwbarton | Owner:
Type: bug | Status: new
Priority: normal | Milestone:
Component: GHCi | Version: 7.10.1
Keywords: newcomer | Operating System: Unknown/Multiple
Architecture: | Type of failure: GHC accepts
Unknown/Multiple | invalid program
Test Case: | Blocked By:
Blocking: | Related Tickets:
Differential Revisions: |
-------------------------------------+-------------------------------------
I can put a semicolon and then an expression or declaration after an
import command in ghci, and the expression or declaration is simply
ignored.
{{{
rwbarton at morphism:~/ghc$ ghci-7.10.1
GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help
Prelude> import Data.List; x
Prelude Data.List>
}}}
The stuff after the semicolon does have to parse, but then is discarded.
Pretty confusing.
It's especially confusing when using `ghc -e`
{{{
rwbarton at morphism:~/ghc$ ghc-7.10.1 -e "import Data.List; sort [2,1]"
rwbarton at morphism:~/ghc$ echo $?
0
}}}
The command is wrong (in general you cannot give multiple commands
separated by semicolons, you must use multiple `-e` options), but GHC
fails to complain in any way and silently ignores the "second command".
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10663>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list