TODO use types instead of graphs during type checking/inference implement Context module with fromList constructor, merging functions and check for multiple declarations implement type inference with annotated delegations?