- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在为我正在学习的类(class)编写编译器。该类不是专门的 Haskell,但我使用 Haskell 来编写我的编译器和解释器。我有一个 cabal 包设置,希望能让我的教授轻松运行/编译。我在这两个可执行文件的构建工具字段中都有 happy 和 alex,但 Cabal 忽略了这一点,然后提示它找不到 Happy 和 Alex 应该生成的模块。如果我手动运行:
alex LimpScanner.x
happy LimpParser.y
-- limp.cabal auto-generated by cabal init. For additional options,
-- see
-- http://www.haskell.org/cabal/release/cabal-latest/doc/users-guide/authors.html#pkg-descr.
-- The name of the package.
Name: limp
-- The package version. See the Haskell package versioning policy
-- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for
-- standards guiding when and how versions should be incremented.
Version: 0.1
-- A short (one-line) description of the package.
Synopsis: LIMP Compiler (Compiler Construction course project)
-- A longer description of the package.
-- Description:
-- URL for the project homepage or repository.
Homepage: http://www.cs.rit.edu/~eca7215/limp/
-- The license under which the package is released.
License: AllRightsReserved
-- The file containing the license text.
License-file: LICENSE
-- The package author(s).
Author: Edward Amsden
-- An email address to which users can send suggestions, bug reports,
-- and patches.
Maintainer: eca7215@cs.rit.edu
-- A copyright notice.
-- Copyright:
Category: Language
Build-type: Simple
-- Extra files to be distributed with the package, such as examples or
-- a README.
-- Extra-source-files:
-- Constraint on the version of Cabal needed to build this package.
Cabal-version: >=1.2
Executable limp
-- .hs or .lhs file containing the Main module.
Main-is: Limp.hs
hs-source-dirs: src
-- Packages needed in order to build this package.
Build-depends: base, array, haskell98
-- Modules not exported by this package.
-- Other-modules:
-- Extra tools (e.g. alex, hsc2hs, ...) needed to build the source.
Build-tools: alex, happy
Executable limpi
Main-is: LimpInterpreter.hs
hs-source-dirs: src
Build-depends: base, array, haskell98
Build-tools: alex, happy
limp/
├── Setup.hs
├── limp.cabal
└── src/
├── Limp.hs
├── LimpInterpreter.hs
├── LimpParser.ly
├── LimpScanner.x
└── LimpToken.hs
最佳答案
对于 Warren Harris 和其他像他(和我自己)可能会在以后出现的人,需要将 other-modules 设置为(我猜?)预计将由 build-tools 中列出的工具构建的模块名称列表。
所以,就我而言,我的 .cabal 文件的相关部分最终看起来像这样:
build-tools: alex, happy
other-modules: Language.Heidi.Parser,
Language.Heidi.Lexer
关于haskell - 使用 alex/happy 和 Cabal,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4465666/
我是haskell和cabal的新手,所以我可能缺少一些简单的东西。 我更新了 cabal 安装: sudo cabal install cabal-install Password: Resolvi
这个问题只有yak-shaving尝试排除故障 another problem . 因此,为了诊断我的另一个问题,建议我尝试: cabal unpack base cd base-4.3.1.0 ca
当我安装 vector和: cabal install vector 我收到很多 SpecConstr如果我可以指定 -fspec-constr-count=SOMETHING-HIGHER,限制将消
当我尝试安装目录包时出现以下错误: $ cabal install directory Resolving dependencies... Failed to install directory-1.
我刚刚在运行 Mavericks 10.9 的 Mac 上安装了 Haskell 平台。包含的 cabal 版本 (1.16) 已过时,并提示我运行“cabal update”,然后运行“cabal
我已经在 I:\cabal 和 ghc 文件夹中分别安装了 cabal 和 I:\ghc 文件夹。我之前安装了 Haskell-Platform,但是没有用,我不得不卸载它。但是有一个名为 C:\Us
我已经制作了一个 Cabal 沙箱,并为它安装了一个软件包,但 runhaskell Setup configure提示我刚刚安装的软件包依赖项丢失了。 我验证了包名和版本,没问题。 运行 cabal
我是否需要手动编辑 *.cabal 文件的 build-depends部分添加包作为项目依赖? 或者也许有一种更方便的方法,它不像手动修改构建文件那样容易出错。 考虑我使用的几乎所有包管理器都具有的功
当我做 cabal --version我懂了: cabal-install version 0.14.0 using version 1.14.0 of the Cabal library 那么有什么
我刚刚做了brew install haskell-platform它安装了 Glorious Glasgow Haskell 编译系统,版本 7.6.3 。 $ cabal --version ca
我需要通过 Cabal 安装 Yesod 和依赖项,不幸的是我无法更新 cabal。外壳输出: ...$ sudo cabal install cabal-install Resolving depe
我似乎在 cabal 中的依赖关系图损坏方面遇到了很多问题,我最终尝试遵循 SO 建议转向 cabal-dev,但由于类似的原因,它无法安装。 跳过原始安装尝试的许多页面,以下是当前状态: C:\Us
每次我安装库时,cabal 都会告诉我安装新版本的 cabal-install。尽管我运行了(明显成功)下面列出的过程,但 cabal-install 的版本保持不变。我哪里错了? (我的操作系统是W
当我通过 sudo apt-get 安装 Haskell/GHC+cabal 时我安装了 Cabal 1.16 版。这显然不是最新的版本。我将如何升级到至少 1.18 版?我试着做 sudo apt-
我制作了自己的 cabal 包(我们称之为 package-1),其中包含两个目标,一个库和一个可执行文件。库部分有一个构建依赖列表,而可执行文件有另一个更大的构建依赖列表。 现在我创建了 packa
当我在 vim 中构建一个 cabal 项目时,使用 :set makeprg=cabal\ build :make haskellmode-vim似乎没有找到类型信息。当光标位于 foo 上时执行
我刚刚通过 apt-get 在 Linux Mint 12 上进行了全新的 haskell 平台安装。每次我尝试使用 cabal-install 安装一些 hackage 包时,我都会得到: coul
当我在 vim 中构建一个 cabal 项目时,使用 :set makeprg=cabal\ build :make haskellmode-vim似乎没有找到类型信息。当光标位于 foo 上时执行
我有两个正在开发的软件包,A和 B .包B取决于 A . A是在它自己的沙盒中开发的,B 也有类似的情况。 : A> cabal sandbox init A> cabal install --ena
看来我错过了什么。据我了解cabal sandbox init表示从当前文件夹和所有子文件夹全部 cabal install命令的范围为沙箱。因此,此文件夹之外的所有内容都不在沙箱中。 那么 caba
我是一名优秀的程序员,十分优秀!