Discussion:
nullary copattern matching
(too old to reply)
Christian Sattler
2018-03-20 22:12:27 UTC
Permalink
What is the syntax for copattern matching on a record with zero fields? I
could not find anything in the documentation. For pattern matching on a
data type with zero constructors, we have syntax for denoting an impossible
case, but what about the analogous situation for copatterns? Note that C-c
C-c will happily produce invalid code ("missing definition").

Christian
Andreas Abel
2018-03-20 23:20:43 UTC
Permalink
Post by Christian Sattler
What is the syntax for copattern matching on a record with zero fields?
There isn't any yet, although Jesper and I discussed adding it:

record True : Set where

triv : True
triv .()

The syntax would be a post-fix absurd projection pattern.

Do you have an interesting application for it? With eta-equality, there
is not so much use it seems, since the same can be obtained by

triv = _

Cheers,
Andreas
Post by Christian Sattler
What is the syntax for copattern matching on a record with zero fields?
I could not find anything in the documentation. For pattern matching on
a data type with zero constructors, we have syntax for denoting an
impossible case, but what about the analogous situation for copatterns?
Note that C-c C-c will happily produce invalid code ("missing definition").
Christian
_______________________________________________
Agda mailing list
https://lists.chalmers.se/mailman/listinfo/agda
--
Andreas Abel <>< Du bist der geliebte Mensch.

Department of Computer Science and Engineering
Chalmers and Gothenburg University, Sweden

***@gu.se
http://www.cse.chalmers.se/~abela/
Thorsten Altenkirch
2018-03-21 11:00:21 UTC
Permalink
It would be relevant if we allow indexed records and coinductive types as discussed recently.

Thorsten
Post by Christian Sattler
What is the syntax for copattern matching on a record with zero fields?
There isn't any yet, although Jesper and I discussed adding it:

record True : Set where

triv : True
triv .()

The syntax would be a post-fix absurd projection pattern.

Do you have an interesting application for it? With eta-equality, there
is not so much use it seems, since the same can be obtained by

triv = _

Cheers,
Andreas
Post by Christian Sattler
What is the syntax for copattern matching on a record with zero fields?
I could not find anything in the documentation. For pattern matching on
a data type with zero constructors, we have syntax for denoting an
impossible case, but what about the analogous situation for copatterns?
Note that C-c C-c will happily produce invalid code ("missing definition").
Christian
_______________________________________________
Agda mailing list
https://lists.chalmers.se/mailman/listinfo/agda
--
Andreas Abel <>< Du bist der geliebte Mensch.

Department of Computer Science and Engineering
Chalmers and Gothenburg University, Sweden

***@gu.se
http://www.cse.chalmers.se/~abela/
_______________________________________________
Agda mailing list
***@lists.chalmers.se
https://lists.chalmers.se/mailman/listinfo/agda





This message and any attachment are intended solely for the addressee
and may contain confidential information. If you have received this
message in error, please contact the sender and delete the email and
attachment.

Any views or opinions expressed by the author of this email do not
necessarily reflect the views of the University of Nottingham. Email
communications with the University of Nottingham may be monitored
where permitted by law.

Loading...