diff options
author | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2007-08-28 06:18:51 +0000 |
---|---|---|
committer | Manuel M T Chakravarty <chak@cse.unsw.edu.au> | 2007-08-28 06:18:51 +0000 |
commit | 5822cb8d13aa3c05d2b46b4510c13d94b902eb21 (patch) | |
tree | 56f7ed6a9697c4bc119a8d21885370cba8fa3c8b /darcs-all | |
parent | db14f9df7f2f62039af85ac75ac59a4e22d09787 (diff) | |
download | haskell-5822cb8d13aa3c05d2b46b4510c13d94b902eb21.tar.gz |
Type checking for type synonym families
This patch introduces type checking for type families of which associated
type synonyms are a special case. E.g.
type family Sum n m
type instance Sum Zero n = n
type instance Sum (Succ n) m = Succ (Sum n m)
where
data Zero -- empty type
data Succ n -- empty type
In addition we support equational constraints of the form:
ty1 ~ ty2
(where ty1 and ty2 are arbitrary tau types) in any context where
type class constraints are already allowed, e.g.
data Equals a b where
Equals :: a ~ b => Equals a b
The above two syntactical extensions are disabled by default. Enable
with the -XTypeFamilies flag.
For further documentation about the patch, see:
* the master plan
http://hackage.haskell.org/trac/ghc/wiki/TypeFunctions
* the user-level documentation
http://haskell.org/haskellwiki/GHC/Indexed_types
The patch is mostly backwards compatible, except for:
* Some error messages have been changed slightly.
* Type checking of GADTs now requires a bit more type declarations:
not only should the type of a GADT case scrutinee be given, but also
that of any identifiers used in the branches and the return type.
Please report any unexpected behavior and incomprehensible error message
for existing code.
Contributors (code and/or ideas):
Tom Schrijvers
Manuel Chakravarty
Simon Peyton-Jones
Martin Sulzmann
with special thanks to Roman Leshchinskiy
Diffstat (limited to 'darcs-all')
-rw-r--r-- | darcs-all | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -11,13 +11,14 @@ chomp $defaultrepo; my $defaultrepo_base; my $defaultrepo_lib; -if ($defaultrepo =~ /:/) { +if ($defaultrepo =~ /:\/\//) { # HTTP or SSH $defaultrepo_base = $defaultrepo; $defaultrepo_base =~ s#/[^/]+/?$##; $defaultrepo_lib = "$defaultrepo_base/packages"; } -elsif ($defaultrepo =~ /^\//) { +elsif (($defaultrepo =~ /^\//) or # unix + ($defaultrepo =~ /^.:/)) { # windows, e.g. c: # Local filesystem, absolute path (assumes a checked-out tree): $defaultrepo_base = $defaultrepo; $defaultrepo_lib = "$defaultrepo/libraries"; |