当前位置:网站首页>Haskell configuring vs code development environment (june2022)
Haskell configuring vs code development environment (june2022)
2022-06-29 00:06:00 【SVIP_ Quanw】
Haskell To configure VS code development environment
0. brief introduction
Haskell It's a kind of standardized 、 General purpose pure functional programming language , There are non finite semantics and strong static types .
stay Haskell in , Functions are first class citizens .
As a functional programming language , The main control structure is function .
Haskell Language is 1990 In programming language Miranda Standardized on the basis of , And take λ calculus (Lambda-Calculus) Developed on the basis of .
have “ Proof is procedure 、 The conclusion formula is the program type ” Characteristics of .
This is also Haskell Language in Greek letters 「λ」(Lambda) As a sign of their own reasons .
Haskell The main execution environment of a language is GHC.
Haskell Official website :https://www.haskell.org/
1. install VS code Haskell development environment
You need an agent , Otherwise, the installation package cannot be downloaded , It's recommended here Express *** Yes 30 Days refund guarantee .
To use Haskell It won't be too difficult for people to deal with the agency
If it's hard , Suggest learning Scalainstall GHCup ( Suggestions from the official website )
This GHCup It's like Rust Of rustup, It is Haskell Development tool chain installer
stay Linux、macOS、FreeBSD or WSL2 Installation on
Run the following command in the terminal ( Act as not root user )
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
stay Windows Installation on
stay PowerShell Run the following command in the session ( As a non administrator user ):
Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true
You need to know a little English here
When selecting a position, note that there is no space in the path
HLS and Stack Put them all on
- install VS code plug-in unit
install VS code skip ( It's estimated that there are all ), lately VS code The update is a little small bug
Generally, you can install the following three
haskell.haskell
justusadam.language-haskell
hoovercj.haskell-linter

You can also install another Code Runner ( because Ghc compile haskell Very slowly )
formulahendry.code-runner

- install hlint
hlint It's a haskell Code specification detection program ( The prompt is not accurate )
Input at the console ~ enter
cabal install hlint
Here we are Haskell The development environment is configured
2. Simple to fit
Create a new empty folder
Call test Well You can also create a new one called CODE_HASKELL Of

Then open it in the folder Terminal perform
cabal init
The folder will be initialized to Haskell The basic development environment 
And then we use VS code open test Folder
open app / Main.hs
Commands to run the entire project
cabal run
Then it will compile and run ( The first time it will be slower )
But if it's just a single file, you can use Code Runner
It's used runhaskell command , It's going to be a lot faster

good Come here Your first Haskell And the program runs
Next, you can also learn about
cabal and stack command
cabal -h
stack --help
3. Carried some common commands and links
3.1 GHCup( The one installed above )
# For simple interactive TUI( stay Windows Not available on
ghcup tui
# List the available ghc/cabal edition
ghcup list
# Install the recommended GHC edition
ghcup install ghc
# Install specific GHC edition
ghcup install ghc 8.2.2
# Set up current “ active ” Of GHC edition
ghcup set ghc 8.4.4
# install cabal install
ghcup install cabal
# to update ghcup In itself
ghcup upgrade
3.2 GHCup install
边栏推荐
- Yyds dry goods inventory building knowledge map from scratch with neo4j (I)
- After eight years of testing and opening experience and interview with 28K company, hematemesis sorted out high-frequency interview questions and answers
- Stm32f407-------- NVIC interrupt priority management
- MapReduce case
- websocket-js连接如何携带token验证
- Online yaml to JSON tool
- 【C Primer Plus第二章课后编程题】
- Leetcode 178 Score ranking (June 27, 2022)
- 11. target segmentation
- stm32F407-------外部中断
猜你喜欢

矩 阵 压 缩

单机多实例MYSQL主从复制
![[buuctf.reverse] 131-135](/img/c2/b8b06c8191af2c75bf4ad5c82feaea.png)
[buuctf.reverse] 131-135

【LeetCode】21. Merge two ordered linked lists - go language solution

每日一题:移除元素

stm32F407-------跑马灯、蜂鸣器

PHP uses endroid/qrcode QR code to generate, and Gd library generates sharing posters

Stm32f407 ------- GPIO input experiment

Typescript-- section 4: Functions

Sword finger offer 12 Path in matrix
随机推荐
每日一题:移除元素
Common mistakes in software testing
stm32F407-------LCD
Chrome浏览器的基本使用
TypeScript -- 第六节 泛型
LinkedIn DataHub --- 经验分享
[buuctf.reverse] 131-135
这玩意叫跳表?
Save data in Excel: use openpyxl to create multiple tables and set excel row limit
mysql 高可用双主同步
每日一练:删除有序数组中的重复项
Reading notes of English grammar new thinking Basic Edition 2 (I)
Typescript -- Section 5: classes
入行数字IC验证后会做些什么?
WPF implementation calls local camera~
EditText监听焦点
Leetcode 178 Score ranking (June 27, 2022)
Stm32f407 ------- RTC real time clock
Typescript -- Section 6 generic
ES6 module