Can't define GHCi :def macro with NoImplicitPrelude on
GHCi is unusually prohibitive in typechecking :def
macros when NoImplicitPrelude
is enabled. Here's an example to illustrate what I mean:
$ ghci -XNoImplicitPrelude
GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help
λ> :def pf \str -> Prelude.return Prelude.$ ":! pointfree \"" Prelude.++ str Prelude.++ "\""
<interactive>:1:111:
Not in scope: type constructor or class ‘String’
<interactive>:1:121: Not in scope: type constructor or class ‘IO’
<interactive>:1:124:
Not in scope: type constructor or class ‘String’
I can understand the functions being out-of-scope when NoImplicitPrelude
is on, but the type errors don't make any sense to me, especially since :t
seems to pick up on the types just fine:
λ> :t Prelude.return
Prelude.return :: GHC.Base.Monad m => a -> m a
λ> :t "\""
"\"" :: [GHC.Types.Char]
Trac metadata
Trac field | Value |
---|---|
Version | 7.10.1 |
Type | Bug |
TypeOfFailure | OtherFailure |
Priority | normal |
Resolution | Unresolved |
Component | GHCi |
Test case | |
Differential revisions | |
BlockedBy | |
Related | #8640 (closed) |
Blocking | |
CC | |
Operating system | |
Architecture |