是否可以使提示功能与 -XNoImplicitPrelude 一起使用?

Is it possible to make prompt-function work with -XNoImplicitPrelude?

我有一个使用自定义 Prelude 的项目,但是它似乎与我在 ~/.ghci 中的提示功能冲突。简单示例:

$ ghci -XNoImplicitPrelude
GHCi, version 8.2.2: http://www.haskell.org/ghc/  :? for help
Loaded GHCi configuration from /home/refold/etc/ghci
> :set prompt-function \ms _ -> ms

<interactive>:1:19: error:
    Not in scope: type constructor or class ‘String’

<interactive>:1:30: error:
    Not in scope: type constructor or class ‘Int’

<interactive>:1:37: error:
    Not in scope: type constructor or class ‘IO’

<interactive>:1:40: error:
    Not in scope: type constructor or class ‘String’

是否可以让 -XNoImplicitPrelude:set prompt-function 一起工作?

StringIntIO 以及任何必要的内容放回范围内。如果 Prelude 不可用(因为使用 base-noprelude),这些类型可以在它们自己的模块中找到:

> import Data.String (String)
> import Data.Int (Int)
> import System.IO (IO)
> import Text.Show (show)
> import Control.Applicative (pure)
> :set prompt-function \ms n -> pure (show (ms, n))  -- [String] -> Int -> IO String