What the real problem can be when I get a type error that seems not to be an error?
Type error in application: incompatible operand type
Operator: (∘) (tlr fa) :: ('a ⇒ 'a × 'log) ⇒ 'a ⇒ 'b × 'log
Operand: rtf :: 'a ⇒ 'a × 'log
The argument of the operator has the very same type as the operand. I really wonder about this.
Maybe do a declare [[show_sorts]]
before and check the sort constraints.
Or you can do declare [[unify_trace_failure]]
and try to read the trace of that. Although I'd recommend only doing that right before the error occurs; otherwise there is too much of an overhead.
You can also do note [[unify_trace]]
in an Isar proof or using [[unify_trace]]
in a proof state.
Manuel Eberl said:
Maybe do a
declare [[show_sorts]]
before and check the sort constraints.
Yes that showed the problem and then I prescribed the type class constraint at some definitions and this cured the problem. Thanks.
Out of curiosity: could there be an automatic switch to showing sorts or a hint message if the sortless types agree, but the sorts not?
Last updated: Dec 21 2024 at 12:33 UTC