[英]Creating a Haskell REPL within a Haskell application
I'm trying to embed a Haskell REPL within one of my Haskell applications.我正在尝试在我的 Haskell 应用程序之一中嵌入 Haskell REPL。 The idea would be that only a subset of the Haskell libraries would be loaded by default, plus my own set of functions, and the user would use those in order to interact with the environment.
这个想法是默认情况下只加载 Haskell 库的一个子集,外加我自己的一组函数,用户将使用这些函数与环境交互。
To solve this problem, I know one way would be to create a (mini-)Haskell parser + evaluator and map my mini-Haskell parser's functions to actual Haskell functions, but I'm sure there is a better way to do this.为了解决这个问题,我知道一种方法是创建一个(迷你)Haskell 解析器 + 评估器和 map 我的 mini-Haskell 解析器的函数到实际的 Haskell 函数,但我确信有更好的方法来做到这一点。
Is there a nice and clean way to build a REPL for Haskell using Haskell?有没有一种使用 Haskell 为 Haskell 构建 REPL 的好方法?
A few things that already exist:一些已经存在的东西:
All of the above are assuming that you don't want to deal with writing a Haskell interpreter yourself, which is probably the case.以上所有内容都假设您不想自己编写 Haskell 解释器,可能就是这种情况。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.