parsing - 找不到模块“Text.Megaparsec.Char.Lexer”
问题描述
我尝试了“stack install megaparsec”,在 project.yaml 文件中添加 megaparsec 和 parsec 作为依赖项并运行 stack build,我尝试在项目文件夹的所有级别上进行 stack build。另外奇怪的是,我可以加载包含被 VSCode 标记为问题的导入的模块并显示错误消息,我还可以运行所述模块中的函数,这些函数使我们可以使用导入的东西,但我无法编译文件。
ghci 版本是 9.0.1
堆栈版本是 2.7.3
阴谋集团版本:1.12
module Parsing where
import Control.Monad (void)
import Data.Void
import Syntax
import Data.Text (Text)
vvvvv these 3 are marked as problems and are the reason I can't compile the file.
import Text.Megaparsec
import Text.Megaparsec.Char
import qualified Text.Megaparsec.Char.Lexer as L
.cabal 文件
library
exposed-modules:
Example
Lib
Parsing
Print
Semantics
Syntax
other-modules:
Paths_parser
hs-source-dirs:
src
build-depends:
base >=4.7 && <5
, containers
, megaparsec
, parsec
, text
default-language: Haskell2010
executable parser-exe
main-is: Main.hs
other-modules:
Paths_parser
hs-source-dirs:
app
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
, parser
default-language: Haskell2010
test-suite parser-test
type: exitcode-stdio-1.0
main-is: Spec.hs
other-modules:
Paths_parser
hs-source-dirs:
test
ghc-options: -threaded -rtsopts -with-rtsopts=-N
build-depends:
base >=4.7 && <5
, parser
default-language: Haskell2010
解决方案
推荐阅读
- sql - 在 SQL 语句中使用变量作为列名 - python?
- python - 操作熊猫数据框以组合类似的列
- javascript - 只执行“if”5 秒,然后继续执行“else”
- html - 纯 CSS 中非全宽 div 的视差滚动
- php - 过滤具有相同值的数组键
- java - Java combining two hashmaps of the same type into a new hashmap keeping duplicates
- python - 用于固定字符长度的 Python 正则表达式
- cordova - 尝试运行离子项目时出错
- rust - 在命令缓冲区执行之间清除非瞬态图像
- java - Spark 独立模式:有没有办法以编程方式从 Spark 的 localhost:8080 获取每个工作人员的核心/内存信息