[plt-scheme] detecting parameter types (contracts?)
Indeed -- there is a dependency between the arguments. This
particular case is easily solved by unification -- the core of the
Hindley-Milner type inference algorithm -- with the cost that you
can't write particular classes of programs and have them type check w/
HM. For example, you cannot express functions, like map, that take a
varying number of arguments.
Nevertheless, HM is fairly simple and expressive. If you're doing
some kind of type checking on a restricted class of programs you might
find it sufficient for your needs.
N.
On 8/30/07, Corey Sweeney <corey.sweeney at gmail.com> wrote:
> hmm, your right. I thought my particular needs were going to be
> simple enough to not have to worry about this, but on second thought,
> I might run into this. The issue here being that the type of the
> second argument depends on the first argument, and thus i don't know
> wether to pass it a list of numbers or charactors, etc...
>
> I guess in my case, I could avoid the use of map, and just use the
> static primatives that can be used to create map....
>
> Corey