:- module subtyping.
 
:- interface.
:- import_module io.
:- pred main(io::di, io::uo) is det.
 
:- implementation.
 
:- import_module string, int.
:- type foo ---> bar(string)
; baz(int).
 
:- inst bar ---> bar(ground).
 
:- pred use_bar(foo::in(bar), string::out) is det.
use_bar(bar(X), X).
 
:- pred use_everything(foo::in, string::out) is det.
use_everything(Bar @ bar(_), String) :- use_bar(Bar, String).
use_everything(_Baz @ baz(_), "baz").
 
main(!IO) :-
  print("Testing\n", !IO).
