O bitter one
peter morris wrote:
I'd like to complain bitterly...
-----------------------------------------------------------
( P, Q : A -> * ; p : Ex (lam a => Or (P a) (Q a)) !
let !---------------------------------------------------!
! ex8 p : Or (Ex P) (Ex Q) )
ex8 p <= case p { ex8 (wit (lam a' => Or ( a') (' a')) a p) [] } -----------------------------------------------------------
That is the 'helpful' name choices (for the things that are called P and Q in the type) are *nothing* and prime, personally i prefered x4 and x5 the i got from the older version. They certanly make it easier to refer to the first of the two...
Oddly enough, it's perfectly possible (if counterintuitive) to complete this exercise without reference to either. But that's by the by; the bug was as I suspected and I've just committed a fix. Now P and Q are called (oddly enough) P and Q. I wonder what I've broken this time.
While I was at it, I also addressed another well known evil: if you declare a function (... --- f _x y z : T), the _x, previously doomed to be invisible in patterns, is now doomed to be visible in patterns. A bit more interactive control would be nice, but at least this is a more reasonable default. Upshot: the following was developed interactively, with no emacs touching-up
-----------------------------------------------------------------------------
( n : Nat !
data (---------! where (------------! ; !-------------!
! Nat : * ) ! zero : Nat ) ! suc n : Nat )
-----------------------------------------------------------------------------
( n : Nat ; X : * ! ( x : X ; xs : Vec n X !
data !------------------! where (------------! ; !-----------------------!
! Vec n X : * ) ! vnil : ! ! vcons x xs : !
! Vec zero ! ! Vec (suc n) X )
! % X )
-----------------------------------------------------------------------------
( n ; x : X !
let !--------------------!
! vec _n x : Vec n X ) vec _ n x <= rec n
{ vec _ n x <= case n
{ vec _ zero x => vnil
vec _ (suc n) x => vcons x (vec x)
}
}
-----------------------------------------------------------------------------
( fs : Vec n (S -> T) ; ss : Vec n S !
let !-------------------------------------!
! vapp fs ss : Vec n T ) vapp fs ss <= rec fs
{ vapp fs ss <= case fs
{ vapp vnil ss <= case ss
{ vapp vnil vnil => vnil
}
vapp (vcons f fs) ss <= case ss
{ vapp (vcons f fs) (vcons s ss) => vcons (f s) (vapp fs ss)
}
}
}
-----------------------------------------------------------------------------What I haven't yet done is the extension of the rereadable pattern language with enough extra stuff to allow lambdas in patterns to get reloaded. I'm hoping that won't turn out to be too much like hard work.
Any road, I'm sure there are more exciting times ahead. Joy.
Cheers
Conor
-- http://www.cs.rhul.ac.uk/~conor
