+let if_record t ~f ~otherwise =
+ match t with
+ | Record {fields; _} ->
+ f fields
+ | Unit
+ | Int
+ | String
+ | Name _
+ | Nil
+ | Array _ ->
+ otherwise ()
+
+let if_array t ~f ~otherwise =
+ match t with
+ | Array {ty=t; _} ->
+ f t
+ | Unit
+ | Int
+ | String
+ | Name _
+ | Nil
+ | Record _ ->
+ otherwise ()
+