Day 1: Haskell

TLDR : Getting started on the setup and installation

Haskell Day 1: Hello World

My System

OS : Pop OS (Ubuntu and this are pretty much same. You can use commands for Ubuntu all the time)
Version : 21.04

Prerequisites

  1. I visited this site and ran the following command.
sudo apt-get install haskell-platform
sudo apt-get install code
sudo snap install code

Starting Out

  1. I made a folder called haskell and opened the terminal in it.
    (Right click → open in terminal)
  2. Started a new project in it and decided to call it playground.
stack new playground
cd playground
code .

Hello World

Since we’re only beginning, let's print Hello World.

  1. Go to the app folder and open Main.hs
  2. Have a look there and see if you can understand anything. If not, replace
main = blank (or whatever is on the RHS of this equation) 
main = putStrLn "Hello World"
stack build
stack run

--

--

I do stuff. Like stuff about policy. And book stuff. And gaming stuff. And stuff about life. And stuff about stuff.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store