« first day (1 day earlier)      last day (1777 days later) » 

Leo
11:14 AM
How would you add non-determinism?
What I had thought was using backtracking: if the type checker fails with the first meaning of all functions it backtracks, tries the next meaning of the last function encountered, and so on until it finds a working combination
 
 
2 hours later…
1:30 PM
@Leo Um yeah, when I said nondeterminism, I really meant backtracking (as in "the list monad models nondeterministic computation"). Implementing our own type inference engine may also enable us to guide the backtracking and possibly make it faster on average (like, if the return type of most functions is determined by the types of the arguments, then it makes sense to find out the arguments' types first and unify the function's type with them, and proceed to the return type afterwards).
Another crazy idea: the invisible infix operator for function application is overloaded to one or more forms of function composition. :P Then we could do +K+TQ as in the above example and have the type inference engine work out the semantics that make sense.
 
Leo
2:14 PM
I've thought about something like that, but probably when your + is overloaded with enough different meanings you will find one general enough to fit the arguments and you won't get the chance to try different meanings of the function application.
Or vice versa, in any case I think we would find ourselves overloaded by overloadings xD
 
2:45 PM
@Leo Heh. :P I don't know, there probably is a "sweet spot" between overloading everything to the max and having the inference engine always spit out the wrong types, and not overloading enough to get any real benefit. I want to believe that the invisible operator can be overloaded in that sweet spot, but we'll see.
 

« first day (1 day earlier)      last day (1777 days later) »