• Stars
    star
    101
  • Rank 338,166 (Top 7 %)
  • Language
    Haskell
  • License
    ISC License
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

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

Repository Details

A small Haskell implementation of Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism

higher-rank

A small Haskell implementation of Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism. This is a sister project to the Racket implementation, which is adapted from this one.

This implementation is designed to be both simple and relatively complete. Where the two conflict, it prefers simplicity. This means that there is no source location reporting for type errors, for example, which would considerably complicate the implementation, but it does attempt to provide good error messages with the information it has.

The executable built by this project implements a simple REPL. You can run it from the command line with stack:

$ stack build
$ stack exec higher-rank
> ()
() : ()
> (\x -> x)
(\x -> x) : (a1' -> a1')
> ((\x -> x) ())
() : ()

The implementation is divided among the following modules:

  • Language.HigherRank.Types โ€” Holds type definitions used by other modules. This module mostly only exists to break module loading cycles between the printer and interpreter/typechecker.

  • Language.HigherRank.Typecheck โ€” The core implementation of the typechecker, which contains all of the code that implements the actual paper. If you are only interested in the typechecking algorithm and arenโ€™t interested in the interpreter or REPL, you can focus exclusively on this module and Language.HigherRank.Types.

  • Language.HigherRank.Interpret โ€” Contains the implementation of a very simple interpreter, which evaluates expressions without doing any typechecking.

  • Language.HigherRank.Parse โ€” Contains monadic parsers for parsing both types and expressions, the results of which may be fed to the typechecker or interpreter.

  • Language.HigherRank.Print โ€” Implements pretty-printers for types, expressions, and reduced expressions, which are the results of the interpreter. This is used to print results in the REPL as well as format types and expressions in error messages.

  • Language.HigherRank.Main โ€” This implements the actual REPL by combining all of the above pieces together.

More Repositories

1

hackett

WIP implementation of a Haskell-like Lisp in Racket
Racket
1,149
star
2

freer-simple

A friendly effect system for Haskell
Haskell
222
star
3

eff

๐Ÿšง a work in progress effect system for Haskell ๐Ÿšง
Haskell
113
star
4

mtl-style-example

A small example of using mtl style to unit test effectful code
Haskell
106
star
5

racket-r7rs

An implementation of R7RS in Racket
Racket
92
star
6

megaparsack

Racket parser combinators inspired by parsack and megaparsec
Racket
76
star
7

racket-collections

Generic collections API for Racket
Racket
52
star
8

blackboard

A (very) unfinished OpenType Math layout and rendering engine in Racket
Racket
51
star
9

threading

Threading macros for Racket
Racket
47
star
10

talks

Racket
42
star
11

functional

Functional interfaces and datatypes for Racket
Racket
42
star
12

monad-validate

A Haskell monad transformer library for data validation
Haskell
35
star
13

shattered-plans

Java
31
star
14

racket-commonmark

Fast, CommonMark-compliant Markdown parser written in Racket
Racket
31
star
15

heroku-buildpack-racket

a Heroku buildpack for deploying apps written in Racket
Shell
27
star
16

lexi-lambda.github.io

Racket
27
star
17

racket-mvar

An implementation of Haskellโ€™s MVars in Racket
Racket
27
star
18

mini-ml

An experimental implementation of a tiny ML-like language using an embedded custom expander (WIP, currently just System F core language)
Racket
21
star
19

racket-higher-rank

Racket
21
star
20

envy

An environment variable manager for Racket applications
Racket
17
star
21

racket-curly-fn

A meta-language for adding Clojure-style shorthand function literals to arbitrary Racket languages.
Racket
16
star
22

racket-tulip

Racket
15
star
23

racket-alexis-collections

Deprecated. Use https://github.com/lexi-lambda/racket-collections instead.
Racket
12
star
24

libsol

A C runtime for the sol programming language.
C
11
star
25

racket-multimethod

Proof-of-concept, mostly safe multimethods in Racket
Racket
11
star
26

case-kw-lambda

Racket
11
star
27

racket-alexis-pvector

Deprecated. Use https://github.com/lexi-lambda/racket-pvector instead.
Racket
11
star
28

scripty

Distributable shell scripts with dependencies
Racket
10
star
29

racket-macro-exercises

Small macro challenges to help learn Racketโ€™s macro system
Racket
9
star
30

lens-examples

A handful of small examples of parts of the Haskell `lens` package
Haskell
8
star
31

racket-2htdp-typed

A port of 2htdp to Typed Racket
Racket
8
star
32

learning-haskell

Racket
8
star
33

racket-pvector

Fast, immutable, persistent vectors for Racket
Racket
8
star
34

dotfiles

Racket
7
star
35

namespaced-transformer

Racket
6
star
36

racket-sample-heroku-app

a sample Racket application for deployment to Heroku
Racket
6
star
37

factorio-blueprints

Makefile
6
star
38

syntax-classes

Racket
5
star
39

SimpleJail

Simplistic Jail plugin for Bukkit
Java
5
star
40

clojure-fuzzy-urls

Clojure
5
star
41

struct-update

Racket
5
star
42

th-to-exp

Deprecated. Use Language.Haskell.TH.Syntax.Lift instead.
Haskell
4
star
43

aws-cloudformation-template

Racket
4
star
44

litpub

A small Medium clone in Racket designed for publishing stories
Racket
4
star
45

decontaminate

A Ruby DSL for extracting data from complicated XML documents
Ruby
3
star
46

alexis-collection-lens

Lens provider for Racket generic collections
Racket
3
star
47

SNESTile

A cross-platform SNES graphics editor.
Java
3
star
48

collections-lens

Lenses for Racket generic collections
Racket
3
star
49

racket-irc-client

Racket
3
star
50

racket-alexis

Various personal libraries and utilities for Racket
Racket
3
star
51

racket-match-plus

Racket
2
star
52

rackunit-spec

Racket
2
star
53

simple_split

dead simple A/B testing on Rails
Ruby
2
star
54

haskell-rolodex

Haskell
2
star
55

type-assertions

Runtime type assertions for testing
Haskell
1
star
56

monads-lecture

Haskell
1
star
57

racket-vector-struct

Racket
1
star
58

racket-semver

A Racket implementation of the semver specification
Racket
1
star
59

imgcap

Racket
1
star
60

incremental

Haskell
1
star
61

ut2k4-team-stats

A simple app that uses the data from the UT2k4 Stats server to track the performance of team duos
Racket
1
star
62

template-dom

A library for creating (V)DOM nodes using ES2015 tagged template strings
JavaScript
1
star