—————————————————
module foo
imports libstratego-lib
strategies

main =
foo(bar)

foo(s) =
s

bar(|x) =
!“bar(1,0)”

bar =
!“bar(0.0)”
—————————————————

Prints bar(0,0)


module foo
imports libstratego-lib
strategies

main =
foo(bar)

foo(s : a * b -> c) =
s(|1)

bar(|x) =
!“bar(1,0)”

bar =
!“bar(0.0)”
—————————————————

Prints bar(0,0)

The current approach seems to be to always prefer the 0,0 variant over the other alternatives. In the past, this used to raise an error. PHP-front actually uses this kind of overloading.

This is related to at least the following issues:

STR-17
STR-97
STR-496
STR-497
STR-498

The alternative would be to finally implement a real type checker and use this type information to reduce the number of ambiguity errors. The current situation is rather embarrassing.

Submitted on 20 November 2006 at 11:48

On 28 January 2013 at 14:46 Eelco Visser removed tag 0.18M2

On 28 January 2013 at 14:46 Eelco Visser tagged interesting

Log in to post comments