当前位置:网站首页>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
边栏推荐
- Save data in Excel: use openpyxl to create multiple tables and set excel row limit
- MapReduce案例
- After eight years of testing and opening experience and interview with 28K company, hematemesis sorted out high-frequency interview questions and answers
- WPF implementation calls local camera~
- Trois questions PWN
- Is it safe to open an account for buying stocks online?
- JVM底层又是如何实现synchronized的
- Notes: three ways to define setters and Getters
- PHP uses curl to download Excel files after logging in to the website
- TypeScript--第五节:类
猜你喜欢
随机推荐
pymysql. Error get error code and specific error information
[machine learning] numerical analysis 02 -- finding roots of arbitrary equations
Sword finger offer 12 Path in matrix
Blue Bridge Cup top ten common heaven level skill - breath of water The type of one recursion
每日一题:消失的数字
LG. Hankson's interesting questions, C language
How to guarantee the delivery quality through the cloud effect test plan
【C Primer Plus第二章课后编程题】
Is the compass stock software reliable? Is it safe to trade stocks on it?
Typescript-- section 4: Functions
MySQL connection query is easy to understand
websocket-js连接如何携带token验证
Easy to use free ppt template
Mysql的四种引擎介绍
LeetCode每日一题:实现strStr()
随笔记:模拟类数组(array-like)的方法
[buuctf.reverse] 131-135
Online yaml to JSON tool
Use menu resources to implement option menus and context menus
var、let、const 三者的区别








![[buuctf.reverse] 131-135](/img/c2/b8b06c8191af2c75bf4ad5c82feaea.png)