运行时提示返回调试GHC编译错误';s`Language.Haskell.Interpreter.runInterpreter`

运行时提示返回调试GHC编译错误';s`Language.Haskell.Interpreter.runInterpreter`,haskell,ghc,hint,Haskell,Ghc,Hint,我试图在Haskell程序运行时使用 外部程序进行编译,但当我运行它时,内部编译步骤失败。我得到了一个关于我假设的语法问题的描述,以及“交互式”代码中的位置,但我不知道如何查看有问题的代码 这里是Main.hs modulemain其中 导入数据列表(插入) 导入多义词(runM) 将合格的Language.Haskell.Interpreter导入为H 将符合条件的效果导入为E handleFailures::H.Translator或错误a->IO a handleFailures(左l)=

我试图在Haskell程序运行时使用

外部程序进行编译,但当我运行它时,内部编译步骤失败。我得到了一个关于我假设的语法问题的描述,以及“交互式”代码中的位置,但我不知道如何查看有问题的代码

这里是Main.hs

modulemain其中
导入数据列表(插入)
导入多义词(runM)
将合格的Language.Haskell.Interpreter导入为H
将符合条件的效果导入为E
handleFailures::H.Translator或错误a->IO a
handleFailures(左l)=ioError$userError$message l
哪里
消息(H.WontCompile es)=插入“\n”(标题:映射取消装箱es)
消息e=显示e
header=“错误:无法编译:”
unbox(H.GhcError e)=e
handleFailures(右a)=返回a
解释::字符串->H.解释器E.MyEffect
解释s=do
H.加载模块[“效果”]
H.setImportsQ[(“前奏曲”,无),(“效果”,无)]
效应
提取程序s=do
p-Sem-r-a
teletyplustoio=解释$\case
ReadPlus->embed$(“+”)getLine
WritePlus消息->嵌入$putStrLn$msg“+”
类型MyEffect=Sem[TeletypePlus,Teletype,嵌入IO]()
UserProvided.hs在
MyEffect
中包含一个简单的
do
表达式

do

我可以告诉我们你试图使用提示运行的程序吗?可能是错误在那里,而不是您的主程序。@bradrn:编辑后包含了两个引用文件。我应该澄清,所提供的代码应该是我正在努力解决的一个与多义词有关的不同问题的概念证明。您是否检查了
UserProvided.hs
独立编译?提示可能只是报告了一个编译错误。我刚刚发现了一个非常有趣的事情:只需执行
H.explain“pure()”(H.as::Sem'[Embed IO]())
就足以触发错误!但是我仍然不知道这个错误指示了什么,或者如何修复它…你能用提示向我们展示一下你试图运行的程序吗?可能是错误在那里,而不是您的主程序。@bradrn:编辑后包含了两个引用文件。我应该澄清,所提供的代码应该是我正在努力解决的一个与多义词有关的不同问题的概念证明。您是否检查了
UserProvided.hs
独立编译?提示可能只是报告了一个编译错误。我刚刚发现了一个非常有趣的事情:只需执行
H.explain“pure()”(H.as::Sem'[Embed IO]())
就足以触发错误!但我仍然不知道这个错误意味着什么,或者如何修复它…
$ cabal build
    Build profile: -w ghc-8.8.1 -O1
    In order, the following will be built (use -v for more details):
     - Hello-Polysemy-0.1.0.0 (exe:Hello-Polysemy) (file Main.hs changed)
    Preprocessing executable 'Hello-Polysemy' for Hello-Polysemy-0.1.0.0..
    Building executable 'Hello-Polysemy' for Hello-Polysemy-0.1.0.0..
    [2 of 2] Compiling Main             ( Main.hs, /home/mako/Git/Hello-Polysemy/dist-newstyle/buil/x86_64-linux/ghc-8.8.1/Hello-Polysemy-0.1.0.0/x/Hello-Polysemy/build/Hello-Polysemy/Hello-Polysemy-tmp/Main.o )
    Linking /home/mako/Git/Hello-Polysemy/dist-newstyle/build/x86_64-linux/ghc-8.8.1/Hello-Polysemy-0.1.0.0/x/Hello-Polysemy/build/Hello-Polysemy/Hello-Polysemy ...
$ cabal exec bash
$ cabal run
    Up to date
    Hello-Polysemy: user error (ERROR: Won't compile:
    <interactive>:10:135: error:
        Operator applied to too few arguments: :)