+
+-- Predicates for each of the context types
+is_appfirst_ctx, is_appsecond_ctx, is_letbinding_ctx, is_letbody_ctx, is_lambdabody_ctx
+ :: CoreContext -> Bool
+
+is_appfirst_ctx AppFirst = True
+is_appfirst_ctx _ = False
+
+is_appsecond_ctx AppSecond = True
+is_appsecond_ctx _ = False
+
+is_letbinding_ctx (LetBinding _) = True
+is_letbinding_ctx _ = False
+
+is_letbody_ctx (LetBody _) = True
+is_letbody_ctx _ = False
+
+is_lambdabody_ctx (LambdaBody _) = True
+is_lambdabody_ctx _ = False