Commit Graph

11 Commits

Author SHA1 Message Date
Edwin Brady
da914af83e Consistency of implicit/pattern name binding rules
We've always said that the rules for binding names in patterns are the
same as the rules for binding names in implicits, i.e. a name beginning
with a lower case letter, not applied to anything, will be bound
implicitly, or treated as a pattern variable. This hasn't actually
always been quite true, even though it was supposed to be...

Correspondingly, added a warning for constructor names which may be
unexpectedly bound implicitly.

This patch changes the pattern binding rules so that it is the case.
Fixes #2653
2015-10-17 18:44:00 +01:00
David Raymond Christiansen
ce403f6c60 Merge remote-tracking branch 'upstream/master' into wip/tactical
Conflicts:
	CHANGELOG
2015-09-23 13:24:36 +02:00
Edwin Brady
b678d7c93c Changed scoping rules for unbound implicits.
Any name which would be a valid unbound implicit is now *always* an
unbound implicit. This is much more resilient to changes in inputs, but
does require that function names be explicitly qualified when in
argument position.

Updated libraries/tests accordingly.

WARNING: This is likely to break some code; the fix is, in all cases, to
give explicit namespaces for function names in types in an argument
position (i.e. a valid position for it to be an unbound implicit).
2015-09-21 17:23:33 +01:00
David Raymond Christiansen
752a2fcc77 Update tests for proof deprecation 2015-09-10 12:01:39 +02:00
Edwin Brady
9a7f7d9a34 Make 'case' more flexible with dependent types
Implicit variables remain implicit in the generated case (or, more
accurately, variables which are unused in the rhs are made implicit on
the lhs), meaning that it is no longer necessary for each branch to
target the same type or for each case of the scrutinee to have the same
type.

In other words, case is now allowed provided that it does not affect the
form of any variable which is explicitly used in the case block.

Example, which is now allowed but wasn't before:

  app : Vect n a -> Vect m a -> Vect (n + m) a
  app xs ys = case xs of
                   [] => ys
                   (x :: xs) => x :: app xs ys
2015-07-10 11:19:07 +01:00
Jan de Muijnck-Hughes
5ea6aa0520 Address semantic differences in putting things to STDOUT.
The changes are as follows:

+ `print` is for putting showable things to STDOUT.
+ `printLn` is for putting showable things to STDOUT with a new line
+ `putCharLn` for putting a single character to STDOUT, with a new line.

Effects has been updated accordingly.
2015-03-06 17:26:33 +00:00
Edwin Brady
0d8a153cb0 New way of dealing with unmatchable patterns
Any term which is not matchable, i.e. a function application or a
repeated variable on the left hand side, is automatically put in a
PHidden. The effect of elaborating PHidden t is to:

1. Delay the elaboration of 't' to the end of elaboration
2. When elaborating t, ensure that its value is already known due to
solving some other unification problem.

If something is PHidden, but not solvable by unification, elaboration
fails.
This finally fixes #323, and probably several other things.
2014-12-20 20:52:46 +00:00
Ahmad Salim Al-Sibahi
f0ed9e992f First renaming attempt 2014-09-26 07:34:28 +02:00
Matus Tejiscak
014f993726 Add --nowarnreach to two tests. 2014-04-11 09:10:26 +01:00
David Raymond Christiansen
bd13bf92c3 Fix filename case in test run scripts
This causes them to properly clean up IBC files after them on
case-sensitive filesystems.

Fixes #866.
2014-02-08 10:54:51 +01:00
Edwin Brady
1d2fc7f8e0 Categorise tests 2014-01-30 17:24:08 +00:00