There follows an extremely rough approximation to Haskell's type checker, written as a logic program. Mostly to explore type inference and syntactic sugar.
For the most part, we won't need a lot of syntactic checks in this implementation, but for terms with no internal structure, like variables and numbers, it's useful to specify their members.