archives

Subtyping + overloading

It seems to me that Haskell imitates subtyping for numeric types by implicitly passing number literals to the coercion functions fromInteger or fromRational. Is it possible to give subtyping and overloading a more elegant/complete way to coexist?

If, for example, the literal "1" has type int, what needs to be added to an ML-like type system so that "1 + 0.3" will be typed as a float?

Thanks,
Alex

Labyrinth:how to find the exit?

I have a list of the rooms(e.x. ((1 2) (2 4) (IN 1) (IN 3) (1 3) (4 5) (5 OUT)),where () means that rooms are connected with each other "IN"-entrance,"OUT"-exit).Would you be so kind to explaine the algorithm ,which can find the exit ?