安裝haskell

本文介绍了如何手动安装Haskell开发环境,包括下载和安装ghcup、mingw,配置环境变量,设置ghcup的下载镜像源,以及安装GHC、Cabal、Stack和HL。此外,还提供了更新msys2的步骤。
摘要由CSDN通过智能技术生成

手动安装ghcup

下载ghcup

https://downloads.haskell.org/~ghcup/x86_64-mingw64-ghcup.exe

放置到 C:\ghcup\bin 目录下

下载安装mingw

https://repo.msys2.org/distrib/msys2-x86_64-latest.exe

安装到 C:\msys64

配置环境变量

在PATH 变量中 添加 C:\ghcup\bin

新增变量

GHCUP_MSYS2  = C:\msys64

GHCUP_INSTALL_BASE_PREFIX = c:\  这里的c:\是  c:\ghcup\bin 去掉 ghcup\bin 后获得的路径,如果ghcup安装到其他路径,会变化

CABAL_DIR = C:\cabal

配置ghcup,增加下载镜像

  • 执行: ghcup config init

  • 会在 c:\ghcup目录下生成 config.ymal

配置增加:

url-source:

OwnSource: "https://mirrors.ustc.edu.cn/ghcup/ghcup-metadata/ghcup-0.0.7.yaml"

参考:https://mirrors.ustc.edu.cn/help/ghcup.html, 注意 文档中的url没有加引号,ghcup可能会不识别

安装 ghc

  • 执行 ghcup install ghc --set recommended

  • 执行 ghcup install cabal latest

  • 执行 ghcup install stack latest

  • 执行 ghcup install hls latest

  • 执行 cabal update

更新msys2

  • ghcup run -m – pacman --noconfirm -Syuu

  • ghcup run -m – pacman --noconfirm -Syuu

  • ghcup run -m – pacman --noconfirm -S --needed curl autoconf mingw-w64-x86_64-pkgconf

  • ghcup run -m – pacman --noconfirm -S ca-certificates

这里就可以使用了,更多参考: https://www.haskell.org/ghcup/install/#manual-installation

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值