diff options
author | Richard Eisenberg <eir@cis.upenn.edu> | 2015-12-11 18:19:53 -0500 |
---|---|---|
committer | Richard Eisenberg <eir@cis.upenn.edu> | 2015-12-11 18:23:12 -0500 |
commit | 6746549772c5cc0ac66c0fce562f297f4d4b80a2 (patch) | |
tree | 96869fcfb5757651462511d64d99a3712f09e7fb /README.md | |
parent | 6e56ac58a6905197412d58e32792a04a63b94d7e (diff) | |
download | haskell-6746549772c5cc0ac66c0fce562f297f4d4b80a2.tar.gz |
Add kind equalities to GHC.
This implements the ideas originally put forward in
"System FC with Explicit Kind Equality" (ICFP'13).
There are several noteworthy changes with this patch:
* We now have casts in types. These change the kind
of a type. See new constructor `CastTy`.
* All types and all constructors can be promoted.
This includes GADT constructors. GADT pattern matches
take place in type family equations. In Core,
types can now be applied to coercions via the
`CoercionTy` constructor.
* Coercions can now be heterogeneous, relating types
of different kinds. A coercion proving `t1 :: k1 ~ t2 :: k2`
proves both that `t1` and `t2` are the same and also that
`k1` and `k2` are the same.
* The `Coercion` type has been significantly enhanced.
The documentation in `docs/core-spec/core-spec.pdf` reflects
the new reality.
* The type of `*` is now `*`. No more `BOX`.
* Users can write explicit kind variables in their code,
anywhere they can write type variables. For backward compatibility,
automatic inference of kind-variable binding is still permitted.
* The new extension `TypeInType` turns on the new user-facing
features.
* Type families and synonyms are now promoted to kinds. This causes
trouble with parsing `*`, leading to the somewhat awkward new
`HsAppsTy` constructor for `HsType`. This is dispatched with in
the renamer, where the kind `*` can be told apart from a
type-level multiplication operator. Without `-XTypeInType` the
old behavior persists. With `-XTypeInType`, you need to import
`Data.Kind` to get `*`, also known as `Type`.
* The kind-checking algorithms in TcHsType have been significantly
rewritten to allow for enhanced kinds.
* The new features are still quite experimental and may be in flux.
* TODO: Several open tickets: #11195, #11196, #11197, #11198, #11203.
* TODO: Update user manual.
Tickets addressed: #9017, #9173, #7961, #10524, #8566, #11142.
Updates Haddock submodule.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 90 |
1 files changed, 71 insertions, 19 deletions
@@ -1,39 +1,91 @@ -The Glasgow Haskell Compiler -============================ +Dependent Types Branch of GHC +============================= -[![Build Status](https://api.travis-ci.org/ghc/ghc.svg?branch=master)](http://travis-ci.org/ghc/ghc) +This is a fork of GHC, with work toward supporting dependent types. +Anyone is welcome to download and play with this implementation, +and I am happy to receive feedback and issue reports on GitHub. -This is the source tree for [GHC][1], a compiler and interactive -environment for the Haskell functional programming language. +There are two options of using this branch: manual, and Nix-based. -For more information, visit [GHC's web site][1]. +Manual +------ + +This code should build, but I have tested it only on `DEBUG` settings; +I recommend using build style `devel2` in `build.mk`. + +Here is a minimal script you can follow to build this at home; +see the [GHC Building Guide] [3] for more info. + +~~~ +git clone https://github.com/goldfirere/ghc.git +cd ghc +git checkout nokinds +git remote set-url origin git://git.haskell.org/ghc.git # so submodules work +git submodule update --init +cd mk +cp build.mk.sample build.mk +## edit build.mk to uncomment the line to choose the `devel2` configuration +cd .. +perl boot +./configure +make +~~~ + +Check out the `testsuite/tests/dependent/should_compile` directory for +a few sample programs that should compile on this fork of GHC. + +For more information about GHC, visit [GHC's web site][1]. Information for developers of GHC can be found on the [GHC Trac][2]. +Nix-based +--------- + +Thanks to @deepfire, this branch is available in Nixpkgs, which means that with +some effort it can be fairly automatically employed to build any package from +Hackage. This way, though, requires that one installs the Nix package manager in +parallel with the system package manager -- and this option is currently +unavailable on Windows. + +Here are the instructions: + +1. To install the Nix package manager, taking over /nix for package storage: + + curl https://nixos.org/nix/install | sh + +2. Make Nix use the `master` repository of Nixpkgs package definitions: -Getting the Source -================== + git clone https://github.com/NixOS/nixpkgs.git + pushd ~/.nix-defexpr + rm -rf channels + ln -s ../nixpkgs + popd + echo 'export NIX_PATH=nixpkgs=/home/---<USERNAME>---/nixpkgs' >> ~/.bashrc + export NIX_PATH=nixpkgs=/home/---<USERNAME>---/nixpkgs -There are two ways to get a source tree: +3. [OPTIONAL] To enable prebuilt binaries from Peter Simons/NixOS Hydra servers: - 1. *Download source tarballs* + sudo mkdir /etc/nix + echo 'binary-caches = http://hydra.nixos.org/ http://hydra.cryp.to/' | sudo dd of=/etc/nix/nix.conf - Download the GHC source distribution: + # If you don't do that, everything will still work, just it'll have + # to build everything from source. - ghc-<version>-src.tar.bz2 +4. Enter a shell with `ghc-nokinds` available: - which contains GHC itself and the "boot" libraries. + nix-shell -p haskell.compiler.ghcNokinds - 2. *Check out the source code from git* +5. See it's indeed `nokinds`: - $ git clone --recursive git://git.haskell.org/ghc.git + wget https://raw.githubusercontent.com/goldfirere/ghc/nokinds/testsuite/tests/dependent/should_compile/KindEqualities2.hs + runhaskell KindEqualities2.hs - Note: cloning GHC from Github requires a special setup. See [Getting a GHC - repository from Github] [7]. +To apply 'nokinds' to building packages from Hackage, the best option would be +to follow instructions from the "Nix loves Haskell" talk by Peter Simons: - **DO NOT submit pull request directly to the github repo.** - *See the GHC team's working conventions re [how to contribute a patch to GHC](http://ghc.haskell.org/trac/ghc/wiki/WorkingConventions/FixingBugs "ghc.haskell.org/trac/ghc/wiki/WorkingConventions/FixingBug").* + http://cryp.to/nixos-meetup-3-slides.pdf +..where the relevant compiler name would be "ghcNokinds". Building & Installing ===================== |