-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Guards? Or what? #44
Comments
Re Booleans, we must not use I'm also toying with the idea that 0(-) aborts without evaluating its argument and 1(x) is x. That's to say, guarding is also contextualization. |
The key question here is at what point we commit to a match. Too early, and we lose the ability to recover from failure. Too late, and we leak space like bastards, remembering all the alternative things we might do that we're just not going to do. How do we signal that commitment? Is that what |
One thing I've done on the
as used in
deserves to be
Pro tem, I'll use |
Might we write
? We find a row of ps which match the inputs, then each g contextualizes its e, but if g(-) aborts, we try the next guard in the same clause, or the next clause, if we've run out of guards. However, once we cross the Does that make sense? (Of course, the same notation works for function definition as well, except there we have |
At some point we will also need notation for suppressing effects. The simplest form of this is something like
which means that if So,
means the same as
where |
On the |
Bikeshedding has thus far confirmed Meanwhile, on the right, you have either one The translation via prioritization and masking makes guarding very easy to implement. |
Merged! |
Before we can even think about guards, we should ask how Boolean values are to be represented. Is it
[]
and'true
? Is it0
and1
? Is it altogether more wibbly-wobbly?Nothing is stopping us doing
p | g -> e
or the like.I guess my question is whether
p -> (1=g)(e)
should mean the same thing.When should
IncompletePattern
requests be handled by offers of alternative matches? Fun design space.The text was updated successfully, but these errors were encountered: