• Stars
    star
    636
  • Rank 70,723 (Top 2 %)
  • Language
    Haskell
  • License
    MIT License
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A little course to learn about some of the more obscure GHC extensions.

GHC exercises 🚀

For solutions, please see the Exercises.hs modules inside the answers branch.

OK, you know your monoids from your monads. You know how to write a terminal application or two. What's next? What are these language extensions that keep being mentioned? How "type-safe" can you really be?

This repository, I hope, will provide some stepping stones. We'll go through extensions one at a time, and build up a richer vocabulary for talking about Haskell programs, and look to move our assertions up into types, where they can be verified at compile time.


What this isn't.

This is a deep dive into GHC extensions, the power that each one gives us, and how we can combine extensions to achieve very strong guarantees at compile-time. This is not based around concepts; there won't be sections on "dependently-typed programming", or "generic programming", though these concepts will turn up throughout as we dig deeper into the extensions.

If you're interested in something more project-based, I absolutely, 1000% recommend Thinking with Types, written by Sandy Maguire. It is a fantastic resource, and one on which I already rely when explaining concepts to others.

Contents

  1. GADTs
  2. FlexibleInstances
  3. KindSignatures
  4. DataKinds
  5. RankNTypes
  6. TypeFamilies
  7. ConstraintKinds
  8. PolyKinds
  9. MultiParamTypeClasses
  10. FunctionalDependencies

Setup

Assuming you have Cabal or Stack setup, you should be able to navigate to any of the exercise* directories, and run your usual commands:

Repl

$ stack repl
$ cabal repl

Build

$ stack build
$ cabal build

It's going to make it a lot easier to iterate through the exercises if you cabal install ghcid or stack install ghcid. Just as above, once this is done, you can navigate to the exercise directory and run it with your preferred repl command:

$ ghcid -c "stack repl"
$ ghcid -c "cabal repl"

More Repositories

1

holmes

A reference library for constraint-solving with propagators and CDCL.
Haskell
298
star
2

higgledy

Higher-kinded data via generics
Haskell
170
star
3

fantas-eel-and-specification

Examples and exercises from the blog series
JavaScript
85
star
4

learn-me-a-haskell

Trying to get back all the stuff I had in JavaScript.
Haskell
70
star
5

purescript-panda

What would TEA look like if we had no VDOM?
PureScript
68
star
6

purescript-prelewd

An introduction to common PureScript operators through the only truly universal language.
PureScript
49
star
7

oops

Classy error-handling (and dispatching!) in Haskell.
Haskell
48
star
8

LICK

Idris-written, correct-by-construction, simply-typed lambda calculus.
Idris
39
star
9

world-building-in-haskell

Code written for the Berlin FP meetup.
Haskell
25
star
10

dagless

A monadic interface for DAG construction.
Haskell
24
star
11

schemer

A Joi-inspired interface for formatting and validating data structures in PHP.
PHP
18
star
12

wi-jit

A very minimal set of functional utilities. Just enough to get you going.
JavaScript
14
star
13

dagmore

Less Type, more Typeable.
Haskell
14
star
14

purescript-data-algebrae

Reified operations for several common data structures.
PureScript
13
star
15

purescript-propagators

Bidirectional computations as networks of relationships.
PureScript
10
star
16

purescript-super-circles

A simplified Super Hexagon clone written in PureScript.
PureScript
9
star
17

papers

I'm trying to learn things in my time away.
Haskell
8
star
18

purescript-spirographs

CodeMesh 2018 - An introduction to PureScript canvas rendering and the Behaviors library.
PureScript
7
star
19

i-am-tom.github.io

My personal website for blogging my coding exploits.
JavaScript
6
star
20

php-folding-talk

Code for the lightning talk on folds at PHPSW.
PHP
6
star
21

haskell

A "monorepo" of "packages" that I accidentally ended up making while trying to do something else.
Haskell
5
star
22

php-free-talk

Supporting material for my PHP Free monad talk!
PHP
4
star
23

opengl-playground

Dumping ground for OpenGL experiments.
Haskell
3
star
24

herald

Experiments in re-interpreting applicative programs
Haskell
3
star
25

purescript-amplitude

Amplitude wrappers for PureScript
PureScript
3
star
26

neopreen

A formatting library to complement the neo4j-driver package.
JavaScript
3
star
27

learn-me-a-rust

Trying to get back all the stuff I had in Haskell.
Rust
3
star
28

minim

My 2-day Elm hackathon in quarantine
Elm
3
star
29

purescript-easings

The standard set of easing functions. Implemented in PureScript.
PureScript
3
star
30

hoot

Contentful + Mustache = CMS
Haskell
2
star
31

puzzled

Arved and Tom attempt to write a solver.
Haskell
1
star
32

purescript-money

Really made a meal of this one, didn't I?
PureScript
1
star
33

h-and-h

PureScript
1
star