This example lacks sufficient type information to synthesize the Pure instance.
example := do
typeclass instance problem is stuck
Pure ?m.12
Note: Lean will not try to resolve this typeclass instance problem because the type argument to `Pure` is a metavariable. This argument must be fully determined before Lean will try to resolve the typeclass.
Hint: Adding type annotations and supplying implicit arguments to functions can give Lean more information for typeclass resolution. For example, if you have a variable `x` that you intend to be a `Nat`, but Lean reports it as having an unresolved type like `?m`, replacing `x` with `(x : Nat)` can get typeclass resolution un-stuck.return 5
typeclass instance problem is stuck
Pure ?m.12
Note: Lean will not try to resolve this typeclass instance problem because the type argument to `Pure` is a metavariable. This argument must be fully determined before Lean will try to resolve the typeclass.
Hint: Adding type annotations and supplying implicit arguments to functions can give Lean more information for typeclass resolution. For example, if you have a variable `x` that you intend to be a `Nat`, but Lean reports it as having an unresolved type like `?m`, replacing `x` with `(x : Nat)` can get typeclass resolution un-stuck.
A prefix type ascription with Lean.Parser.Term.show : termshow, together with a hole, can be used to indicate the monad.
The default OfNat _ 5 instance provides enough type information to fill the hole with Nat.
example := show StateM String _ from do
return 5