Attempting to convert each state in pipeline to be of type Stage a

Stage is just:

type Stage = ErrorT String Identity

so we can be a little more principled about throwing errors. Need to figure
out how I want to convert GMachine.hs. Looking into doing something like this:

type Eval a = StateT GMState Stage a

and then having the GMState-returning functions just be of type Eval (). May
replace the innermost Identity monad with IO to reimplement verbose output.
Adding Inference.hs providing typecheck :: Program -> Stage Program to perform type-inference

Largely based of the implementation of Hindley-Milner described in
"The Implementation of Functional Programming Languages" with some help
from "Typing Haskell in Haskell".

Currently, we convert the source program to a single letrec. For example,

data List a = Cons a (List a) | Nil;

length ls = case ls of {
    Cons x xs -> 1 + length ls;
    Nil       -> Nil;
};

main = length (Cons 1 (Cons 2 (Cons 3 Nil)));

gets transformed to

data List a = Cons a (List a) | Nil;
letrec {
    length = \ls -> case ls of {
        Cons x xs -> 1 + length ls;
        Nil       -> Nil;
    };
    main = length (Cons 1 (Cons 2 (Cons 3 Nil)));
} in main;

and then typechecked as a single expression. I might revisit this since it
makes giving good error messages difficult.