1
1
mirror of https://github.com/anoma/juvix.git synced 2024-12-01 00:04:58 +03:00
juvix/tests/negative/Internal/AmbiguousInstances.juvix
2023-09-21 11:12:49 +01:00

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);