Skip to content

pritesh-shrivastava/learn-you-a-haskell-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository includes my notes for the free online e-book, Learn You a Haskell for Great Good, written by Miran Lipovača. The book written in the form of a tutorial is available on this link

The Haskell code and problems from the book can be tried on an Online REPL or a local Haskell installation (stack recommended).

Online iHaskell notebook is available at Binder but it can crash sometimes while building.

Useful commands

Haskell Interpreter

You can start an interpreter using the command stack ghci

To load a Haskell script into the interpreter, use :load or :l, for eg. :l <script-name.hs>

To check the type of an expression, use :type or :t, for eg., :t "Pritesh" should return [Char]

To load a module in the interpreter, use :m + Data.List, say, for importing the module Data.List, or use :m + Data.List Data.Map Data.Set to import more than 1 modules via the interpreter.

Running a script on the command line

Option 1 : To compile a Haskell program, run stack ghc <name-of-program.hs> in the folder where the program is present. To run the compiled program, now run ./<name-of-program.hs>.

Option 2: To run a Haskell program on the fly, instead of compiling first, use stack runhaskell helloworld.hs

About

Programming exercises from the book Learn You a Haskell

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published