Zulip Chat Archive
Stream: lean4
Topic: At type level, how do I enforce possbility of pattern match?
nrs (Sep 01 2024 at 23:07):
inductive Term where
| var : String -> Term
| (other Terms)
prefix: max "!!" => Term.var
I'd like to make a function (t: Term) -> Term
that enforces that t = !!s
, i.e., that it must be able to pattern-match on !!s
. How could I encode this on the type-level?
nrs (Sep 01 2024 at 23:09):
Argh, just realized this is the wrong channel. very sorry
Last updated: May 02 2025 at 03:31 UTC