Git Product home page Git Product logo

haskell-trainings's Introduction

Haskell training: 101 and 102.

This repository contains the source for the slides and the exercises used in the Haskell trainings at Google. Haskell is not one of the internally "blessed" languages, but a dedicated team of volunteers is making use of 20% time to try to make Haskell at Google possible! This set of lessons was created in 2016, to allow newcomers to the language to get involved with the team.

Slides

The slides use LaTeX. Simply run make to create the PDFs, assuming you have all the required dependencies.

You need xelatex and the Yanone Kaffeesatz fonts installed on your machine.

On an Ubuntu system, you can get all of these by running

sudo apt-get install texlive-xetex texlive-fonts-extra fonts-yanone-kaffeesatz

Exercises

The codelabs only require ghc to be installed and in the path as well as one of Stack or Cabal. Step-by-step instructions will be provided to guide you through the installation process, at the point where these tools will be necessary. In case you already have them installed, running make in each codelab directory will identify which of the tool is installed and use that to build the exercises as well as run the test.

There is also a possiblity to run the codelabs using Docker. See the instructions in the codelab directories.

To solve an exercise, you need to replace codelab with the actual implementation. For the 101 course, each different codelab directory (except 00_setup which is only used to test installation) has a src/Codelab.hs where you would need to do the exercises. For the 102 course, all the exercises are in the same directory in multiple files, given that we are building a full project. Consult the slides for instructions on how to run each codelab.

We also provide solutions, in the same directory as the corresponding exercise.

Recordings

Public recordings of the training (in an old format) are available: Haskell 101, Haskell 102.

Release

See the releases to download the generated PDFs and the codelabs.

Warning

This code is presented as-is, without the speaker notes. This is not an officially supported Google product.

haskell-trainings's People

Contributors

amalloy avatar hmemcpy avatar hussainjaffery avatar ilya-bobyr avatar marcellodesales avatar mihaimaruseac avatar nicuveo avatar nosarthur avatar pvaret avatar shaneikennedy avatar xnning avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

haskell-trainings's Issues

101: Add example of the tuple destructuring

People are confused as to how to destructure a tuple. Probably explain in the exercise comments.
Adding it to the slides would be overloading the slides with too much detail.

101: Types people see when they use ":t" is confusing to them

tl;dr: Mention that :t output will not be useful until 102 material.

This is something we have discussed a few times in the past.
Until typeclasses in 102, types even for simple functions such as (+) and div are not really that helpful.

We have tried looking into monomorphising ghci output and considered writing a replacement for a limited number of operations in Prelude, so that during 101 people would not see typeclasess.

While been technically challenging, it might also not be the best solution from the educational standpoint.

An alternative is to mention, in 101, that types people will see when they type :t involve abstractions covered in 102, and just suggest they wait until 102, to understand them.
We literally start 102 with slides that explain what those types are.

System.Random is missing

Hi, I'm trying to complete the 102 codelab but I get an error when I'm doing make:

→ make
ghc -Wall -O2 -threaded -feager-blackholing Main.hs -o codelab
[1 of 3] Compiling Codelab          ( Codelab.hs, Codelab.o )
[2 of 3] Compiling Game             ( Game.hs, Game.o )

Game.hs:29:1: error:
    Failed to load interface for ‘System.Random’
    Use -v to see a list of the files searched for.
Makefile:15: recipe for target 'codelab' failed
make: *** [codelab] Error 1

My GHC version is 8.0.1. ;) Thanks!
The videos are very good by the way!

102 should mention what the game is going to be

The codelab just seems to start right in on implementing low-level stuff with no explanation of how it's going to be related to the game, and the slides don't mention the game at all. It would be more fun if students knew what they were building.

101 codelab: Remove "Spacing is irrelevant" sentance

Haskell is actually sensitive to spaces in the let binding, so this sentence is confusing.
It is also is unnecessary, as people should probably follow examples, and not address this question until later.
But, we may want to add an examples of a multiple if/then/else expression, to show how to write it over multiple lines into the codelab comments.

PDFs?

Why don't you upload the PDFs too? If it's a material from 2016, I don't think it would change much in the future.

A branch in my name

I am planning to keep working on this material, but in my own way. I do not agree with all the changes that have been made in master, far from it. If someone were to create a branch with my name, based on v1.0, I could start submitting PRs with my modifications.

Need a better example for immutability

In slide 7 in Haskell 101, it uses the following example to show immutability:

let a = 3
in a = a + 1

I think we need a better example than this one. Because of the following reasons:

(1) This is syntactically wrong. And the syntactic failure has nothing to do with immutability. We can, for example, rewrite it to

let a = 3
in b = c + 1

and it just fails.

(2) We can, actually, slightly revise the example to:

let a = 3
in let a = 4
in a + 1

This works. But this is, of course, related to shadowing rather than immutability. Then this example is quite confusing.

(3) We can, actually, further revise the example to:

let a = 3
in let a = a + 1
in a + 1

This works. But it just loops forever, because in the definition a = a + 1, the a being defined is brought into the scope of a + 1. So it just recurs forever. Again, this example is being confusing.

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.