type 'a list = Nil | Cons of 'a * 'a list
class H 'a { h : 'a -> int }
instance ['a] H 'a => H 'a list { h = fun (x : 'a list) -> 0 }
instance H int { h = fun (x_1 : int) -> x_1[] }
let
['a] (hd : 'a list -> 'a) =
  ['a] fun (l : 'a list) -> match l[] with Cons['a](x_2, _) -> x_2[]
let
['a] [ H 'a ] (f : 'a list -> int) =
  ['a] fun (l_1 : 'a list) -> let (y : 'a) = hd['a] l_1[] in h['a list] l_1[]
let (g : int -> int) = fun (x_3 : int) -> h[int] x_3[]
let ['a] [ H 'a ] (k : 'a -> int) = ['a] fun (x_4 : 'a) -> h['a] x_4[]