2014-11-30 21:16:01 -08:00
|
|
|
prelude namespace foo
|
2014-10-02 16:20:52 -07:00
|
|
|
constant A : Type.{1}
|
|
|
|
constant a : A
|
|
|
|
constant x : A
|
|
|
|
constant c : A
|
2014-08-07 16:59:08 -07:00
|
|
|
end foo
|
2014-06-16 18:42:39 -07:00
|
|
|
|
2014-08-23 15:44:28 -07:00
|
|
|
context
|
2014-09-03 16:00:38 -07:00
|
|
|
open foo (renaming a->b x->y) (hiding c)
|
2014-06-16 18:42:39 -07:00
|
|
|
check b
|
|
|
|
check y
|
|
|
|
check c -- Error
|
|
|
|
end
|
|
|
|
|
2014-08-23 15:44:28 -07:00
|
|
|
context
|
2014-09-03 16:00:38 -07:00
|
|
|
open foo (a x)
|
2014-06-16 18:42:39 -07:00
|
|
|
check a
|
|
|
|
check x
|
|
|
|
check c -- Error
|
|
|
|
end
|
|
|
|
|
2014-08-23 15:44:28 -07:00
|
|
|
context
|
2014-09-03 16:00:38 -07:00
|
|
|
open foo (a x) (hiding c) -- Error
|
2014-06-16 18:42:39 -07:00
|
|
|
end
|
|
|
|
|
2014-08-23 15:44:28 -07:00
|
|
|
context
|
2014-09-03 16:00:38 -07:00
|
|
|
open foo
|
2014-06-16 18:42:39 -07:00
|
|
|
check a
|
|
|
|
check c
|
|
|
|
check A
|
|
|
|
end
|
|
|
|
|
|
|
|
namespace foo
|
2014-10-02 16:20:52 -07:00
|
|
|
constant f : A → A → A
|
2014-07-01 16:55:41 -07:00
|
|
|
infix `*`:75 := f
|
2014-08-07 16:59:08 -07:00
|
|
|
end foo
|
2014-06-16 18:42:39 -07:00
|
|
|
|
2014-08-23 15:44:28 -07:00
|
|
|
context
|
2014-09-03 16:00:38 -07:00
|
|
|
open foo
|
2014-06-16 18:42:39 -07:00
|
|
|
check a * c
|
|
|
|
end
|
|
|
|
|
2014-08-23 15:44:28 -07:00
|
|
|
context
|
2014-12-17 18:28:38 -08:00
|
|
|
open [notations] foo -- use only the notation
|
2014-06-16 18:42:39 -07:00
|
|
|
check foo.a * foo.c
|
|
|
|
check a * c -- Error
|
|
|
|
end
|
|
|
|
|
2014-08-23 15:44:28 -07:00
|
|
|
context
|
2014-09-03 16:00:38 -07:00
|
|
|
open [decls] foo -- use only the declarations
|
2014-06-16 18:42:39 -07:00
|
|
|
check f a c
|
|
|
|
check a*c -- Error
|
|
|
|
end
|