Giter Site home page Giter Site logo

haskell-2020's Introduction

haskell-2020

Material for the DL Haskell 2020 class

The Text

Getting started

Installing

The simplest way to get started is installing ghcup ghcup with curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh.

If the above gives you a difficult time there are other options.

This gives you the following:

  • GHC, Glasgow Haskell Compiler
  • Cabal, a build system which should generally be avoided like the plague.
  • Stack, a haskell project management / build system (almost a hazmat suit for using cabal).
  • Other suff (profilers, code coverage, etc)

note: make sure to have the following installed: sudo apt upgrade build-essential curl libgmp-dev libffi-dev libncurses-dev libtinfo5

Hello World

here we go:

$ cd $(mktemp -d)
$ echo 'main = putStrLn "Hello World"' > main.hs
$ runghc main.hs
Hello World

Not too bad.

In the above example we evaluated main.hs using an interpreter. We can also compile haskell:

$ ghc main.hs 
$ ./main
Hello World

We can also interactivly execute haskell code using ghci, the haskell repl:

$ ghci main.hs
GHCi, version 8.6.5: http://www.haskell.org/ghc/  :? for help
[1 of 1] Compiling Main             ( main.hs, interpreted )
Ok, one module loaded.
*Main> -- this is a haskell commnet
*Main> main -- run the main function
Hello World

haskell-2020's People

Contributors

mattcalef avatar masonwr avatar

Watchers

James Cloos avatar Ryan Keisler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.