Last active
July 31, 2016 14:08
-
-
Save spl/0b9fc285e6bd07fd2c249b15073cc791 to your computer and use it in GitHub Desktop.
Import and use a class without open in Lean
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ *.lean | |
- flycheck*.lean | |
- .#*.lean |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace imported | |
structure is_unit [class] {A : Type} (R : A → unit) := (u : unit) | |
end imported |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the mailing list discussion.