mirror of
https://github.com/anoma/juvix.git
synced 2024-12-01 00:04:58 +03:00
fe90da58ed
* Closes #2372
23 lines
425 B
Plaintext
23 lines
425 B
Plaintext
module AmbiguousInstances;
|
|
|
|
type Unit := unit;
|
|
|
|
type Box A B := box A B;
|
|
|
|
trait
|
|
type T A := mkT { pp : A → A };
|
|
|
|
instance
|
|
unitT : T Unit := mkT (pp := λ{_ := unit});
|
|
|
|
ppBox {A B} {{T A}} : Box A B → Box A B
|
|
| (box x y) := box (T.pp x) y;
|
|
|
|
instance
|
|
boxT {A} {{T A}} : T (Box A Unit) := mkT (pp := ppBox);
|
|
|
|
instance
|
|
boxTUnit {B} : T (Box Unit B) := mkT (pp := λ{x := x});
|
|
|
|
main : Box Unit Unit := T.pp (box unit unit);
|