You’re practically describing Kim Jung Gi: https://youtu.be/MGbvhyTZXfs
data Exp = Num Int
| Bool Bool
| Var Var
| If Exp Exp Exp
| Lambda Var Exp
| App Exp Exp
An Expression is either: data Type = TyInt | TyBool | TyArrow Type Type
Our Types are TypeInt, TypeBool, or a Function (TyArrow) which goes from an input Type to an output Type