您的位置:首页 > 其它

几种语言原生开发环境构建之--Haskell语言

2016-08-03 15:08 405 查看

构建工具安装stack

文档说明

快捷安装

$ wget -qO- https://get.haskellstack.org/ | sh


或者下载压缩包安装

$ cd /home/someuser/haskell
$  wget -O stack.tar.gz https://www.stackage.org/stack/linux-i386 #这里以linux32位系统为例
$ tar zxvf *gz
$ cd stack
$ cp stack ~/bin
# 这里 ~/bin是用户的指令路径
$ stack --help

项目构建

$ stack new hellworld #产生~/.stack全局配置目录
$ cd hellworld
$ stack setup #安装编译环境,如果之前没安装的话,使用lts-7.3
$ stack build # 编译,当前目录产生.stack-work工作目录
$ stack exec hellworld-exe #执行编译后的文件,以-exe结尾
$ stack test #测试
$ stack ghci #开启一个ghc 的repl命令行
$ stack install others-package # 安装其他的包

环境参数配置

全局~/.stack/config.yaml

package-indices:
- name: Tsinghua
download-prefix: http://mirrors.tuna.tsinghua.edu.cn/hackage/package/ http: http://mirrors.tuna.tsinghua.edu.cn/hackage/00-index.tar.gz templates:
params:
author-name: Your Name
author-email: youremail@example.com
category: Your Projects Category
copyright: 'Copyright: (c) 2016 Your Name'
github-username: yourusername


具体配置

默认仓库

清华仓库源镜像
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  Haskell