Haskell with Visual Studio Code on Windows

Step 1: Install Haskell Complier and Build tool stack https://docs.haskellstack.org/en/stable/README/ (There are many other popular build tool available like cabal)

Step 2: Complete stack tool installation/setup via PowerShell prompt

> stack ghci

No alt text provided for this image


Step 3: Install Visual Studio Code

Step 4: Install Visual Studio Code extension: Haskell

Step 5: Create a new Haskell project on the Visual Studio Code Power shell terminal

No alt text provided for this image

Create a new project named Project1 by typing following on Terminal

>stack new Project1

No alt text provided for this image

wait for command to complete

No alt text provided for this image

It creates a new folder Project1

Step 6: Open the folder from Visual Studio Code

No alt text provided for this image

Navigate to the folder Project1 & open

No alt text provided for this image

All these files are auto generated

The sub folder app and src are for keeping Haskell source code files

No alt text provided for this image

Step 7: Execute following command on Visual Studio Code PowerShell Terminal to build the code

> stack build

No alt text provided for this image

It might take some time

Step 8: To run this project type stack run on the Visual Studio Code PowerShell Terminal

No alt text provided for this image


Jyotil Rai

Babson College Glavin Global Fellow | Junior Studying Finance & Entrepreneurship

1 年

Thanks for providing clear directions on setting up Haskell. It really helped out.

回复

Very nice to use Code for Haskell on Fedora/Linix too…

要查看或添加评论,请登录

社区洞察

其他会员也浏览了