(module m (data IntList (ctor Nil) (ctor Cons (con Int) (con IntList))) (fn countGt (type (fn-type (params (own (con IntList))) (ret (own (con Int))))) (params xs) (body (match xs (case (pat-ctor Nil) 0) (case (pat-ctor Cons h t) (let rest (app countGt t) (match (app compare h 5) (case (pat-ctor GT) (app + 1 rest)) (case _ rest))))))) (fn main (type (fn-type (params) (ret (own (con Unit))) (effects IO))) (params) (body (let xs (term-ctor IntList Cons 3 (term-ctor IntList Cons 7 (term-ctor IntList Cons 2 (term-ctor IntList Cons 9 (term-ctor IntList Cons 5 (term-ctor IntList Cons 8 (term-ctor IntList Nil))))))) (seq (app print (app countGt xs)) (do io/print_str "\n"))))))