the resolution of abbreviated commands in ghci is surprising.
GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> :i True
data Bool = ... | True -- Defined in GHC.Bool
Prelude> :def ifoo \_ -> putStrLn "ifoo" >> return ""
Prelude> :i True
ifoo
It seems that abbreviations are resolved to the command, that matches the prefix, which is defined last. I've found this behaviour very confusing in practice.
I'd expect rebinding :i to some command that's not :info to require an explicit declaration.
Trac metadata
Trac field | Value |
---|---|
Version | 6.12.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | |
Blocking | |
CC | Saizan |
Operating system | |
Architecture |