Skip to content

typed-space/fp-workshop

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Functional Programming workshops

Haskell as a teaching language

Why?

  • Purely functional
  • Strongly typed

GHC - industry standard Haskell compiler.

Install stack

Stack is a GHC tool used for building, running, testing, dependencies management and downloading.

http://docs.haskellstack.org/en/stable/install_and_upgrade/

Linux/macOS:

  • curl -sSL https://get.haskellstack.org/ | sh

Windows:

  • binary installer

Create new project

Open terminal. In your projects directory type:

stack new fp

It creates a subfolder fp with following structure:

fp
├── ChangeLog.md
├── LICENSE
├── README.md
├── Setup.hs
├── app
│   └── Main.hs
├── fp.cabal
├── package.yaml
├── src
│   └── Lib.hs
├── stack.yaml
└── test
    └── Spec.hs

3 directories, 10 files

Go inside: cd exercises.

Check the content of all files.

Try stack

stack setup

  • installs appropriate GHC version (may take a while - 260MB).

stack build

  • builds (compile and link) current project. Will do the setup if previous step was omitted.

stack exec -- exercises-exe

  • runs compiled applicaiton

stack run

  • compiles and runs default executable

stack ghci

  • runs REPL - interactive interpreter.

REPL commands

:help (:h, :?)
:load (:l)
:reload (:r)
:type (:t)
:info (:i)
:quit (:q)

Important links:

Further reading

FP.md

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Haskell 100.0%