cabal

Build dependency in library or executable section of cabal file?

你。 提交于 2021-01-27 07:42:11
问题 First off, I'm new to using cabal and external packages with Haskell. I'm trying to use the Graphics.Gloss package inside of MyLib. I can make it work if I include gloss in both the build-depends of library and executable . Here is the relevant portion of the cabal file: library exposed-modules: MyLib build-depends: base ^>=4.13.0.0, gloss ^>=1.13.1.1 default-language: Haskell2010 executable ray-tracer main-is: Main.hs other-modules: MyLib build-depends: base ^>=4.13.0.0, ray-tracer, haskell

Build dependency in library or executable section of cabal file?

百般思念 提交于 2021-01-27 07:35:22
问题 First off, I'm new to using cabal and external packages with Haskell. I'm trying to use the Graphics.Gloss package inside of MyLib. I can make it work if I include gloss in both the build-depends of library and executable . Here is the relevant portion of the cabal file: library exposed-modules: MyLib build-depends: base ^>=4.13.0.0, gloss ^>=1.13.1.1 default-language: Haskell2010 executable ray-tracer main-is: Main.hs other-modules: MyLib build-depends: base ^>=4.13.0.0, ray-tracer, haskell

How to install an older version of base in Haskell

爷,独闯天下 提交于 2021-01-27 06:41:31
问题 I have installed Haskell platform and I have the 7.10.3 version of ghci, which has the 4.8.2.0 version of base. I need to install gloss-1.8.* which needs base-4.7.* version of base. My question is how to install this older version now, when I already have the newer version. Is it possible? Or do I have to uninstall the Haskell platform and install an older version? 来源: https://stackoverflow.com/questions/37195188/how-to-install-an-older-version-of-base-in-haskell

How to install an older version of base in Haskell

让人想犯罪 __ 提交于 2021-01-27 06:40:09
问题 I have installed Haskell platform and I have the 7.10.3 version of ghci, which has the 4.8.2.0 version of base. I need to install gloss-1.8.* which needs base-4.7.* version of base. My question is how to install this older version now, when I already have the newer version. Is it possible? Or do I have to uninstall the Haskell platform and install an older version? 来源: https://stackoverflow.com/questions/37195188/how-to-install-an-older-version-of-base-in-haskell

Pandoc 'Could not find module …' for installed module

倾然丶 夕夏残阳落幕 提交于 2021-01-27 06:31:36
问题 I'm currently trying to use pandoc (as a Haskell module, not as a program) to convert MediaWiki text to other formats. Let's assume this program: import Text.Pandoc.Readers.MediaWiki main = do print "foo" When using runghc to run it, I get the following error message: pandock.hs:1:8: Could not find module `Text.Pandoc.Readers.MediaWiki' Use -v to see a list of the files searched for. My first assumption was that pandoc was either not installed or incorrectly installed. Therefore I reinstalled

Building multiple executables in the default Haskell Stack project

不羁的心 提交于 2021-01-27 05:45:00
问题 I used the default stack new to setup a project that has a server and a client as separate executables. I altered the package.yaml file in what seems like the right way (As of April 21, 2020 "There is no user guide") and added a new file to my app directory called Client.hs . I got an error saying "Enabling workaround for Main module 'Main' listed in 'other-modules' illegally!" How do I have stack build both the client and the server? When I ran stack build I got: [... clip ...] Building

Haskell学习笔记(一) 安装

不想你离开。 提交于 2021-01-27 02:55:48
官网地址:https://www.haskell.org/downloads/ 1.在 官网 下载安装包。这里我直接下载的Haskell Platform安装包。有的教程推荐下载stack再进行后续安装,原因是platform版本之间存在一些不稳定的情况。但是下载platform是一种比较轻松省事的安装方式。(顺便祈祷不要出现不稳定的bug) 2.双击运行安装包,路径最好就不要改了,或者要好记一点。 在安装过程中会出现stack安装的弹窗 3.安装完毕之后,打开命令行输入 cabal user-config init ,会出现默认的放置配置文件的地址,然后到那个文件夹下修改config文件。 检查文件中是否有以下语句   extra-prog-path: 文件安装路径\msys\usr\bin   extra-lib-dirs: 文件安装路径\mingw\lib   extra-include-dirs: 文件安装路径\mingw\include 如果没有,在文件结尾加上。另外,以上三个路径可以存在由逗号隔开的多个地址。保存并关闭config文件。 4.打开开始菜单,可以看到GHCi和WinGHCi。GHCi是Haskell的解释器,使用类似于Python的shell或者MATLAB的命令行,输入算式敲回车就能进行计算。但是如果要进行复杂运算就需要编写程序、编译运行了

What is the suggested way of setting up Haskell on Archlinux?

眉间皱痕 提交于 2021-01-24 10:46:28
问题 Long story short, I'd like some guidance on what's the (best) way to have Haskell work on Archlinux. By work I mean all, in terms of the ghci command line tool, installing packages I don't have - such as vector-space, which this answer to a question of mine refers to -, and any other thing that could be necessary to a Haskell ostinate learner. Archlinux wikipage on Haskell lists three (alternative?) packages for making Haskell work on the system, namely ghc , cabal-install , and stack . I

How do I install the 'Data.List.Split' module for Haskell?

倾然丶 夕夏残阳落幕 提交于 2021-01-06 04:27:40
问题 I have been trying to import the 'Data.List.Split' module since yesterday. I looked around stack overflow for similar questions, but I couldn't find a definitive solution to my slightly basic problem. This is what I wrote in the text editor (excluding comments). import Data.List import Data.Char import System.IO data Cell = Fixed Int | Possible [Int] deriving (Show, Eq) type Grid = [Row] readGrid :: String -> Maybe Grid readGrid s | length s == 81 = traverse (traverse readCell) . Data.List

Generating documentation for my own code with Haddock and stack

别来无恙 提交于 2020-12-29 02:36:39
问题 I have annotated my code in Haddock style and would like to generate browse-able documentation. Since I am also using stack, I want to integrate the documentation generation into the workflow. However, I have not yet been able to generate anything useful. I can run stack haddock and it will generate documentation in the style I want (to be found deep inside ~/.stack/ ), but it only seems to generate documentation for the packages I depend on, rather than for my own code. When I run stack