当前位置:网站首页>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
边栏推荐
- pymysql. Error get error code and specific error information
- Common mistakes in software testing
- What are the virtual machine software? What are their respective roles?
- 12. object detection mask RCNN
- Stm32f407 ------ running lamp and buzzer
- LG. Hankson's interesting questions, C language
- stm32F407-------RTC实时时钟
- Typescript -- Section 3: Interface
- MSYQL is abnormal. Don't worry. Mr. Allen will point out the puzzle
- MNIST handwritten numeral recognition demo based on pytorch framework
猜你喜欢
随机推荐
The second session of question swiping and clock out activity -- solving the switching problem with recursion as the background (2)
12.物體檢測Mask-Rcnn
一条update语句到底加了多少锁?带你深入理解底层原理
10、YOLO系列
这玩意叫跳表?
入行数字IC验证后会做些什么?
Stm32f407------- general timer
点击劫持:X-Frame-Options未配置
毕业三年的25岁码农总结
urllib. Parse parses the parameters in the URL connection
Save data in Excel: use openpyxl to create multiple tables and set excel row limit
With notes: re understanding else if
Rongyun communication solution solves the pain points of enterprise communication
Stm32f407 ------- GPIO input experiment
ES6:let、const、箭头函数
【LeetCode】21. Merge two ordered linked lists - go language solution
What will be done after digital IC Verification?
Is it reliable and safe to avoid five in case of stock trading account opening
Stm32f407------- external interrupt
websocket-js连接如何携带token验证









