I have many files that must be processed automatically. Each file holds the response of one student to an exercise which asks the student to give definitions for some functions given a type for each function.

My idea is to have an Haskell script that loads each student file, and verifies if each function has the expected type.

A constraint is that the student files are not defined as modules.

How can I do this?

My best alternative so far is to spawn a GHCi process that will read stdin from a "test file" with GHCi commands, for example:

```
:load student1.hs
:t g
... and so on ...

```

then parse the returned output from GHCi to find the types of the functions in the student file.

Is there another clean way to load an arbitrary Haskell file and introspect its code?

Thanks