links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
332 stars 42 forks source link

Confusing Names #789

Open dhil opened 4 years ago

dhil commented 4 years ago
links> sig ++ : (Int, Int) -> Int op x ++ y { x + y };
links> (++);
fun : (Int, Int) -> Int
links> [] ++ [];
[] : [_]
links> (++)(2, 2);
4 : Int
links> 2 ++ 2;
<stdin>:1: Type error: The infix operator
    `++'
has type
    `([a], [a]) -b-> [a]'
while the arguments passed to it have types
    `Int'
and
    `Int'
and the currently allowed effects are
    `wild'
In expression: 2 ++ 2.

I hope you enjoyed this piece of poetry. I wish you a good weekend.

dhil commented 4 years ago

Here is another variation

links> op x > y { "test" };
> = fun : (_, _) -> String
links> 2 > 2;
***: Internal Error in instantiate.ml (Please report as a bug): Kind mismatch in type application: (_, _) -> String applied to type arguments: Int, { |wild }