Closed pwang347 closed 4 years ago
Some notes/questions:
assign-type
doesn't work for lists since (List A) needs to be evaluated in the context where A is defined. Is there a way to perform this expansion manually?Current state of affairs:
define/rec/match
now have source information copied over - cleaner error messages for totality checkVector
, seems to already exist in tests\stdlib\deppat.rkt
as Vect
TODO (blocked?):
free-identifier=?
, but it may be better to do this in one sweep once we establish a mechanism to distinguish type constructors from identifiers(define/rec/match minus-bad : Nat Nat -> Nat
[z _ => z]
[n z => n]
[(s n-1) (s m-1) => (minus n-1 m-1)])
can be fixed with
(define/rec/match minus-bad : Nat Nat -> Nat
[z _ => z]
[(s n-1) z => (s n-1)]
[(s n-1) (s m-1) => (minus n-1 m-1)])
so this change (to allow pattern variables to represent more complicated forms) would also require the ability to distinguish between constructors literals and variables
Summary of latest change:
Outstanding items:
Some notes:
Finally working on this, in pr-103-totality-checking
When I merged, I got some odd totality failures in bool. My guess would be either automatic merge did the wrong thing, or something about the merged termination checker broke something.
Finally working on this, in pr-103-totality-checking
When I merged, I got some odd totality failures in bool. My guess would be either automatic merge did the wrong thing, or something about the merged termination checker broke something.
Weird, I'm guessing it may be a sugar.rkt thing. Will take a look later, thanks!
Might be my fault. Looks like one of these depends on 7.6 and I was using 7.5. Updating know and will keep this PR updated.
Wasn't due to 7.6. Must be because define/rec/match got wrapped, to support totality checking. This is a bit strange since bool is one of the few places that didn't use the additional syntax added by the termination checker.
Most likely this: https://github.com/wilbowma/cur/pull/100/files#diff-bc56fe40e5300f5b41ec73c652f230c5R228
I moved the totality check up to the main call and I'm running travis on it right now. Will let you know how it goes!
You're a champ!
I agree that change looks suspicious, although it looks like I reverted it when I merged.
I was so deeply bothered by that coding artifact that I still remembered about it lol Looks like it's working so far (~7mins in)
We all know where our hacks are buried.
I replicated your changes locally and they seem to work---cur-lib builds properly now.
I'm a little confused by this change: https://github.com/wilbowma/cur/commit/4122d0d04bcd52ae2c7eb77f9c874b2f77a1e022#diff-bc56fe40e5300f5b41ec73c652f230c5R274
Given that the input was ((pat ...) => body)
in the define/rec/match
macro, and we didn't do any munges (as far as I can tell), this looks like it shouldn't match.
If I recall correctly, it's because I needed to pass the pat-bodies
as literals back into the syntax expression but I couldn't find a way to preserve it exactly as before; in this case I wanted a flattened form [p1 p2 => body] but the closest I got was [(p1 p2) => body].
--
Also, see some other minor fixes I added here: https://github.com/wilbowma/cur/compare/pr-103-totality-checking...pwang347:pr-103-totality-checking?expand=1
Accidentally triggered several travis requests without killing previous ones, so they all got queued up and it's still running.
Okay. I'll investigate. I might rewrite it to get rid of those local-expands and the repeated syntax-parsing.
I'll do a proper merge off your branch shortly.
Thanks again, and sorry it took me so long to get to merging this... last semester, 411 was all consuming.
Sounds good, do keep me updated if there are any other issues that arise. Also no worries at all, I do hope it was a successful reboot despite the abrupt ending to the term!
Hope you and your family are doing well!
Yeah it went great. Will be even better next time.
Thanks, you too. Stay safe.
Moved this to #105 so I can get github to run checks against my copy of the branch.
Closed by 9b3dc826660a21fdd14690a18cad0eaf5e301086
Description
This change presents an initial solution for #92, as well as various other features listed below.
Notes
get-constructors
incic-saccharata.rkt
, but it didn't seem to be pulling constructor infoget-typeof
instdlib\pattern-tree.rkt
for certain files. This is because it doesn't know how to handle implicitly defined constructors, especially trickier cases like :: which supports infinite nesting (this is the main TODO that I'm aware of)type-aliases
kwarg currently is only used in the totality checker to make sure we match against the right set of constructors. Future work could possibly integrate this into the pattern tree builder.Tests performed: