Skip to content

Instantly share code, notes, and snippets.

@spl
Last active July 31, 2016 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spl/0b9fc285e6bd07fd2c249b15073cc791 to your computer and use it in GitHub Desktop.
Save spl/0b9fc285e6bd07fd2c249b15073cc791 to your computer and use it in GitHub Desktop.
Import and use a class without open in Lean
+ *.lean
- flycheck*.lean
- .#*.lean
namespace imported
structure is_unit [class] {A : Type} (R : A → unit) := (u : unit)
end imported
import export_class
-- This is required, though it feels like it shouldn't be:
-- open [class] imported
definition using_imported {A : Type} {R : A → unit} [imported.is_unit R] : unit := imported.is_unit.u R
-- Error on the above line:
-- don't know how to synthesize placeholder
-- A : Type,
-- R : A → unit,
-- _inst_1 : imported.is_unit R
-- ⊢ imported.is_unit R (lean-checker)
@spl
Copy link
Author

spl commented Jul 31, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment