Zulip Chat Archive
Stream: lean4
Topic: TermElabM expected type
Thomas Vigouroux (Sep 24 2024 at 13:20):
Hi,
In a TermElabM
monad, is there a way to check is the expected term's type is of a certain form, i.e MyType a b
while capturing a
and b
?
Henrik Böving (Sep 24 2024 at 13:36):
If you have the expected type available you can pattern match on it with match_expr
Thomas Vigouroux (Sep 24 2024 at 13:37):
Not sure if I have it or not.
Basically I have written a parser Parsec ...
and I'd like to embed it in an elaborator so that I can parse things into expressions
Thomas Vigouroux (Sep 24 2024 at 13:37):
Not sure I am clear
Thomas Vigouroux (Sep 24 2024 at 13:38):
I have been writting a bunch of ToExpr
instances to convert my actual value to an Expr
already
Last updated: May 02 2025 at 03:31 UTC